Hello,
I'm using TeeChart Pro v7.02 with Delphi 6.
I have a PieSeries, with 100 datas. I show all these datas in the legend, but, obviously, not all datas fit in.
So, I want to group values below a certain %, in order to show less values in the legend (and in the pie, too).
I thought to loop in a way like this (pseudo-code):
PieSeries1.OtherSlice.Value := 0;
while (legend.values.count >= 10) do
begin
PieSeries1.OtherSlice.Value := PieSeries1.OtherSlice.Value + 1;
end;
in this way, I will get at most 10 items in legend, resulting more readable.
My questions:
- which PieSeries function or property gives me how many items are shown in legend?
- after set PieSeries1.OtherSlice.value, should I refresh something for changes to immediately take effect?
Thank you
PieChart: how many items are shown in legend?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi NoName,
No, nothing has to be refreshed. I'd suggest you to have a look at the "Other Legend" example at TeeChart features demo available at TeeChart's program group. Just run the demo and search for the example name.
You can use Chart1.Legend.Items.Count.My questions:
- which PieSeries function or property gives me how many items are shown in legend?
- after set PieSeries1.OtherSlice.value, should I refresh something for changes to immediately take effect?
No, nothing has to be refreshed. I'd suggest you to have a look at the "Other Legend" example at TeeChart features demo available at TeeChart's program group. Just run the demo and search for the example name.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi NoName,
TChart.Legend.Items works fine here with v7.06 (release by the end of last week) and this code:sorry, but "Items" is not member of chart.legend
I tried the following, but always return 0:
- chart.legend.TotalLegendItems
- chart.legend.NumCols
- chart.legend.NumRows
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues();
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Chart1.Title.Text[0] := IntToStr(Chart1.Legend.Items.Count);
end;
You'll find it at "New Features Demo". This demo is at TeeChart's program group if you used the binary installer. If you used the source code installer you should download the binary installer or download the demo from here. However, if you don't use the binary installer you may not have the demo sources. The example in the demo can be found at "All Features\Welcome!\Chart Styles\Standard\Pie\Other Legend".I can't find the example you suggested me, could you please attach it?
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |