usando GraphPlus()

72 views
Skip to first unread message

Ronaldo Geniais

unread,
May 28, 2026, 12:24:55 PM (10 days ago) May 28
to Harbour Minigui
usando o recurso GraphPlus()
quando gero um grafico tipo barras horizontais,
ele gera o grafico com uma cor unica, mas apresenta as legendas
nas cores definidas.
se eu fizer o mesmo grafico usando pizza, o problema nao ocorre.

como esta o codigo :

   aCores := { RED,YELLOW,ORANGE,FUCHSIA,GREEN,BROWN, ;
                BLUE,PINK,PURPLE, BLACK, WHITE, GRAY, ;
                SILVER, TEAL, NAVY, AQUA, LGREEN, OLIVE, MAROON,CELESTE,AZUL,CAFE,VERDE}

      // BARRAS HORIZONTAIS  DESPESAS  
   oObj := GraphPlus():New()
   WITH OBJECT oObj
      :GraphData   := { aVDesp  }        
      :Legends     := aLegDes  //{ "Despesas"} //, "Serie 3" }
      :Categories  := aLegDes
      :GraphColors := acores
      :Title := "Periodo :"+Dtoc(Pridia)+" a "+Dtoc(Ultdia)
      :Picture := '@B@E 9,999,999'
      :BarGapRatio := -0.6
      :BarGapWidthRatio := 0.2      
      :GraphType := GT_BAR
      :nVDivision := 4
   ENDWITH
   AAdd( aGraphObjects, oObj )  
   
   // PIZZA  DESPESAS  
   oObj := GraphPlus():New()
   WITH OBJECT oObj
      :GraphData   := { aVDesp  }        
      :Legends     := aLegDes  //{ "Despesas"} //, "Serie 3" }
      :Categories  := aLegDes
      :GraphColors := acores
      :Title := "Periodo :"+Dtoc(Pridia)+" a "+Dtoc(Ultdia)
      :Picture := '@B@E 9,999,999'
      :BarGapRatio := -0.6
      :BarGapWidthRatio := 0.2      
      :GraphType := GT_PIE
      :nVDivision := 4
   ENDWITH
   AAdd( aGraphObjects, oObj )   

anexo imagens geradas
gra2.jpeg
gra1.jpeg
gra3.jpeg

Ronaldo Geniais

unread,
Jun 2, 2026, 12:46:12 PM (5 days ago) Jun 2
to Harbour Minigui
Could someone help me with this question?  
Why doesn't the bar chart display multiple colors according to the legend, while it works in the pie chart?

Grigory Filatov

unread,
11:23 AM (7 hours ago) 11:23 AM
to Harbour Minigui
Dear Ronaldo,

Yes, sure.

Please compare the following images with the Bars implementation from advanced GraphPlus example.

Is the second image iacceptable for you?

image1.png

This is what is displayed after clicking the "Switch Rows and Columns" button.
image2.png

HTH,
Grigory

вторник, 2 июня 2026 г. в 18:46:12 UTC+2, Ronaldo Geniais:
Reply all
Reply to author
Forward
0 new messages