G'day,
I've currently got a graph that allows a number of series to be plotted. These series are actually divided into groups. For example, let's pretend I have three groups, each with a Quantity, Sold and Price series.
At the moment I'm just adding all the series to the legend, and that's fine, except you end up with something like:
[ ] Quantity [ ] Sold [ ] Price [ ] Quantity [ ] Sold etc
What I'd ideally like to know is if there's a way to break these down into their respective groups.
e.g.
Item1: [ ] Quantity [ ] Sold [ ] Price
Item2: [ ] Quantity [ ] Sold [ ] Price
Item3: [ ] Quantity [ ] Sold [ ] Price
I'd prefer to use the TeeChart legend, but if it comes to it I could probably figure something else out.
Breaking up the legend
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Gerard,
The best way would be creating several series groups. Setting each series to the group you want and then set "Series Groups" as legend style. This will make group names being displayed in the legend. Then you can customize each legend item text (directly or using the OnGetLegendText event). Here's an example modifying items directly:
You'll find series groups examples at the new features demo, available at TeeChart's program group. You should go to the "Search" tab and search for "series groups".
Hope this helps!
The best way would be creating several series groups. Setting each series to the group you want and then set "Series Groups" as legend style. This will make group names being displayed in the legend. Then you can customize each legend item text (directly or using the OnGetLegendText event). Here's an example modifying items directly:
Code: Select all
procedure TForm1.Chart1AfterDraw(Sender: TObject);
begin
Chart1.Legend.Item[0].Text := 'Item1: [ ] Quantity [ ] Sold [ ] Price ';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.Draw;
end;
Hope this helps!
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 |