D6Pro, Teechart 7.07, Chart with 4 lineseries. I would like to customise the legend so that I can add a columns for stats, so it could show say the average, and maybe the standard deviation and min and max. Is there a recommended way to do this?
thanks
Sean
custom legend
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Sean,
It may help you doing something like the examples below in the features demo:
All Features\Welcome!\Miscellaneous\Legend\Drawing more text
All Features\Welcome!\Miscellaneous\Legend\Multiple legends
You'll find the features demo at the program group created by the binary installer.
It may help you doing something like the examples below in the features demo:
All Features\Welcome!\Miscellaneous\Legend\Drawing more text
All Features\Welcome!\Miscellaneous\Legend\Multiple legends
You'll find the features demo at the program group created by the binary installer.
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 |
-
- Newbie
- Posts: 48
- Joined: Fri Mar 12, 2004 5:00 am
thanks, but I'm still having trouble. I have 32 Teecharts, each with one lineseries, the chartys stacked one above the other on a form. all charts are same height and width. I need all series and x-axes to align vertiocally, and all legends to align vertically.
I've got
procedure TLineplotfrm.Chart1GetLegendPos(Sender: TCustomChart;
Index: Integer; var X, Y, XColor: Integer);
begin
with charts[1].Legend do
customposition:=true;
x:=charts[1].width-100;
xcolor:=x-15;
end;
and this gives the alignment for charts and legends. But I can't see how to add columns to the legend. there is a demo which shows
chart1.legend.columnwidhs[0]:=
chart1.legend.columnwidhs[1]:=
but how do I add text to the columns.
I tried using the afterdraw of the charts with
with charts[1].Legend.shapebounds do
begin
WITH charts[1].Canvas do
begin
textalign:=ta_left;
font.Size:=8;
textout(charts[1].legend.left+30,bottom,'Text-1');
textout(left+30,bottom+10,'Text-2');
end;
end;
but this doesn't track correctly when the chart/form is resized in X, so it moves in its vertical alignment the series titles in the legend. I supect in the afterdraw I'm not getting the correct position of the legend.
thanks
Sean
I've got
procedure TLineplotfrm.Chart1GetLegendPos(Sender: TCustomChart;
Index: Integer; var X, Y, XColor: Integer);
begin
with charts[1].Legend do
customposition:=true;
x:=charts[1].width-100;
xcolor:=x-15;
end;
and this gives the alignment for charts and legends. But I can't see how to add columns to the legend. there is a demo which shows
chart1.legend.columnwidhs[0]:=
chart1.legend.columnwidhs[1]:=
but how do I add text to the columns.
I tried using the afterdraw of the charts with
with charts[1].Legend.shapebounds do
begin
WITH charts[1].Canvas do
begin
textalign:=ta_left;
font.Size:=8;
textout(charts[1].legend.left+30,bottom,'Text-1');
textout(left+30,bottom+10,'Text-2');
end;
end;
but this doesn't track correctly when the chart/form is resized in X, so it moves in its vertical alignment the series titles in the legend. I supect in the afterdraw I'm not getting the correct position of the legend.
thanks
Sean
Hi Sean,
I'm afraid that seeing the manner you want to get texts in the legend, the best way would be to draw your custom legend (using the Canvas techniques) directly onto the Chart canvas and not to use the Chart.Legend.
I'm afraid that seeing the manner you want to get texts in the legend, the best way would be to draw your custom legend (using the Canvas techniques) directly onto the Chart canvas and not to use the Chart.Legend.
Pep Jorge
http://support.steema.com
http://support.steema.com