TAnnotaion
Posted: Fri Nov 14, 2008 4:09 pm
Hi
I have a chart which has three series and three left axis (two custom ones)
The axis positions are set up as percentages so
Series 0 - Left Axis is from 0 to 60
Series 1 - Custom 0 is from 60 to 80
Series 2 - Custom 1 is from 80 to 100
percent of the chart
For each series I need to write a label in the top left corner of that part of the chart. So for for Series 0 i want label at 2,2, for Series 1 I want a label at 2,X+2 (where X is 60% of the height of the plot area) and the same for Series 2. The label position needs to update as I resize the chart.
At the moment I'm doing:
But ChartBounds is the whole chart and not just the plot area. Similarly AChart.Height does not give me what I want.
How can I get at the positions I need?
I have a chart which has three series and three left axis (two custom ones)
The axis positions are set up as percentages so
Series 0 - Left Axis is from 0 to 60
Series 1 - Custom 0 is from 60 to 80
Series 2 - Custom 1 is from 80 to 100
percent of the chart
For each series I need to write a label in the top left corner of that part of the chart. So for for Series 0 i want label at 2,2, for Series 1 I want a label at 2,X+2 (where X is 60% of the height of the plot area) and the same for Series 2. The label position needs to update as I resize the chart.
At the moment I'm doing:
Code: Select all
with AChart.Tools.Add(TAnnotationTool) as TAnnotationTool do begin
Text := 'Test';
Shape.CustomPosition := true;
Shape.Shadow.Visible := false;
PositionUnits := muPixels;
Left := AChart.ChartBounds.Left + 2;
Top := Trunc(AChart.Height * 0.6) + 2;
end;
How can I get at the positions I need?