BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Highlight TChart with a solid line on X or Y axis

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting
View previous topic :: View next topic  
Author Message
Scott H
Guest





PostPosted: Tue Apr 06, 2004 2:21 pm    Post subject: Highlight TChart with a solid line on X or Y axis Reply with 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 |

Thanks a lot
Scott


Back to top
John Leavey
Guest





PostPosted: Tue Apr 06, 2004 4:00 pm    Post subject: Re: Highlight TChart with a solid line on X or Y axis Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Reporting-Charting All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.