Recent

Author Topic: [solved with GENIUS demo] Why is my pie not unicolored?  (Read 340 times)

Nicole

  • Hero Member
  • *****
  • Posts: 1095
[solved with GENIUS demo] Why is my pie not unicolored?
« on: April 26, 2025, 04:35:45 pm »
I have a Pie Chart. You can see at the screenshot what it shall do:
There is an inner circle with "sectors" and percents.
And there is an outer circle with "branches or parts of the inner circle".
In other words: The pie of the inner circle is splitted in further parts, which shall be visible in the outer circle.

Please see at the screenshots what happens instead.
Of my (debug-)code I would expect the outer cirble to be the same size and the same color of the inner circle.


 
Code: Pascal  [Select][+][-]
  1.   IBQuery_SekBra.First; // Setze den Cursor zurück zum ersten Datensatz
  2.  
  3.     sektorID_sic:= -1;
  4.     i:= 0;
  5.     while not IBQuery_SekBra.Eof do // Sektor-Prozent und Sektor hinzufügen, innerer Kreis
  6.       begin
  7.         sektorID := IBQuery_SekBra.FieldByName('ID_SEKTOR').AsInteger;
  8.         if sektorID <> sektorid_sic then begin
  9.            d := IBQuery_SekBra.FieldByName('SektorProzent').AsFloat;
  10.            s := IBQuery_SekBra.FieldByName('SEKTOR').AsString;
  11.  
  12.            inc(i);
  13.            if i > High(Farben) then i:= 0;
  14.  
  15.            Series_Sektoren.Add(d, s, Farben[i]);
  16.            Series_Branchen.Add(d, s, Farben[i]);
  17.  
  18.            sektorID_sic:=sektorID;
  19.               end;
  20.  
  21.         IBQuery_SekBra.Next;
  22.       end;
  23.                                          
« Last Edit: April 28, 2025, 12:56:19 pm by Nicole »

wp

  • Hero Member
  • *****
  • Posts: 12784
Re: Why is my pie not unicolored?
« Reply #1 on: April 26, 2025, 08:12:33 pm »
Hmmm... I think you do not populate the two series in the correct way because you always add Sektor and Branche together - I think you should add them independently, and in a way that the pies are still aligned. Study the attached demo which takes a few of your data with some random numbers - it is working as expected for me. Note that my values are "sales" rather than percentages, because with percentage it is not clear to what they refer: to the total of all sectors or to each individual sector only. It will be very difficult to align Sektor and Branche this way.

Also, I have the impression that this kind of application rather quickly brings the TAChart pie series to its limits: I wanted to add headers to the legend to group the legend by "Sektor", but found that headers can be added only per series, but not at any point in the value sequence. Or, I wanted to label the Branchen pies by numbers listed at the beginning at each legend item; here we have the limitation that series labels and legend labels must be the same...
« Last Edit: April 26, 2025, 08:16:09 pm by wp »

Nicole

  • Hero Member
  • *****
  • Posts: 1095
Re: Why is my pie not unicolored?
« Reply #2 on: April 26, 2025, 09:28:59 pm »
Thank you so very much. I downloaded both of them and will check them on Monday.

Nicole

  • Hero Member
  • *****
  • Posts: 1095
Re: [solved with GENIUS demo] Why is my pie not unicolored?
« Reply #3 on: April 28, 2025, 01:53:07 pm »
This demo I love!
Even the list-marks are colored the same! How nice.

Not sure, if I shall be sorry, not to write the second series as labels.
Nobody ever would reads / needs this seriously. There are hundreds of.

I wrote a small editor, which loads the branches of each sector chosen.
There the user can see the branches in a nice, small list including set-percentage each.








 

TinyPortal © 2005-2018