Multiple legends
Posted: Mon Feb 14, 2005 12:41 pm
Hi,
I would like to add multiple legends to my chart, as demonstrated in one of your demo's.
In my application I add series as follows:
for (iSeries=0;iSeries<noSeries;iSeries++)
{
for (i=0;i<noPnts;i++) tChart1.Series[iSeries].Add(x,y);
}
Now I would like to split up those series over more than one legend, as those series represent different items. E.g. for series[0:10] I want to show the first 5 series in legend #1 and the last 5 in legend #2.
On my tChart1_AfterDraw event I added a function with code:
Steema.TeeChart.Legend legend = tChart1.Legend;
// legend #1
legend.FirstValue = 0;
legend.Top = 100;
legend.Bottom = 300;
legend.Paint(tChart1.Graphics3D,legend.ShapeBounds);
// legend #2
legend.FirstValue = 5;
legend.Top = 400;
legend.Bottom = 600;
legend.Paint(tChart1.Graphics3D,legend.ShapeBounds);
but the first legend still displays ALL my series.
What I am missing is a property LastValue for setting the last series to be displayed in my legend.
Is there a proper workaround for this ?
Thanks a lot.
Kind regards,
Antoon Koster
Netherlands
I would like to add multiple legends to my chart, as demonstrated in one of your demo's.
In my application I add series as follows:
for (iSeries=0;iSeries<noSeries;iSeries++)
{
for (i=0;i<noPnts;i++) tChart1.Series[iSeries].Add(x,y);
}
Now I would like to split up those series over more than one legend, as those series represent different items. E.g. for series[0:10] I want to show the first 5 series in legend #1 and the last 5 in legend #2.
On my tChart1_AfterDraw event I added a function with code:
Steema.TeeChart.Legend legend = tChart1.Legend;
// legend #1
legend.FirstValue = 0;
legend.Top = 100;
legend.Bottom = 300;
legend.Paint(tChart1.Graphics3D,legend.ShapeBounds);
// legend #2
legend.FirstValue = 5;
legend.Top = 400;
legend.Bottom = 600;
legend.Paint(tChart1.Graphics3D,legend.ShapeBounds);
but the first legend still displays ALL my series.
What I am missing is a property LastValue for setting the last series to be displayed in my legend.
Is there a proper workaround for this ?
Thanks a lot.
Kind regards,
Antoon Koster
Netherlands