Forum > TAChart

[solved with GENIUS demo] Why is my pie not unicolored?

(1/1)

Nicole:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  IBQuery_SekBra.First; // Setze den Cursor zurück zum ersten Datensatz     sektorID_sic:= -1;    i:= 0;    while not IBQuery_SekBra.Eof do // Sektor-Prozent und Sektor hinzufügen, innerer Kreis      begin        sektorID := IBQuery_SekBra.FieldByName('ID_SEKTOR').AsInteger;        if sektorID <> sektorid_sic then begin           d := IBQuery_SekBra.FieldByName('SektorProzent').AsFloat;           s := IBQuery_SekBra.FieldByName('SEKTOR').AsString;            inc(i);           if i > High(Farben) then i:= 0;            Series_Sektoren.Add(d, s, Farben[i]);           Series_Branchen.Add(d, s, Farben[i]);            sektorID_sic:=sektorID;              end;         IBQuery_SekBra.Next;      end;                                         

wp:
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...

Nicole:
Thank you so very much. I downloaded both of them and will check them on Monday.

Nicole:
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.







Navigation

[0] Message Index

Go to full version