 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Scott H Guest
|
Posted: Tue Apr 06, 2004 2:21 pm Post subject: Highlight TChart with a solid line on X or Y axis |
|
|
In a TChart, is it possible to highlight the Y axis with a solid line ?
sort of like this ...
3 #
2 # # #
1 # # #
0 ==================== <== I want a solid line at the 0 axis
-1 # #
-2 #
-3
On a similar note: is it possible to put a solid vertical line
at any point of the X axis like the vertical line below.
Ideally, I would like to be able to move the vertical line at runtime if possible
to another axis point (its is 3 in the diagram below)
3 |
2 |
1 |
0 =1==2==3===============
-1 |
-2 |
-3 |
Thanks a lot
Scott
|
|
| Back to top |
|
 |
John Leavey Guest
|
Posted: Tue Apr 06, 2004 4:00 pm Post subject: Re: Highlight TChart with a solid line on X or Y axis |
|
|
Scott H wrote:
| Quote: |
In a TChart, is it possible to highlight the Y axis with a solid line
? sort of like this ...
3 #
2 # # #
1 # # #
0 ==================== <== I want a solid line at the 0 axis
-1 # #
-2 #
-3
On a similar note: is it possible to put a solid vertical line
at any point of the X axis like the vertical line below.
Ideally, I would like to be able to move the vertical line at runtime
if possible to another axis point (its is 3 in the diagram below)
3 |
2 |
1 |
0 =1==2==3===============
-1 |
-2 |
-3 |
|
Put something like this in the BeforeDrawValues of your first chart
series.
procedure TForm1.Series1BeforeDrawValues(Sender: TObject);
var
YPos, XPos, XValue: Integer;
begin
with Chart1, Chart1.Canvas do
begin
Ypos := Series[ 0 ].CalcYPosValue( 0 );
Pen.Color := clBlack;
Pen.Width := 2;
Pen.Style := psSolid;
MoveTo( ChartRect.Left, YPos );
LineTo( ChartRect.Right, YPos );
XValue := 3;
Xpos := Series[ 0 ].CalcXPosValue( XValue );
Pen.Color := clBlue;
Pen.Width := 1;
Pen.Style := psDot;
MoveTo( XPos, ChartRect.Bottom );
LineTo( XPos, ChartRect.Top );
end;
end;
John Leavey
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|