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 

TChart grid drawing and more TChart question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Tumurbaatar S.
Guest





PostPosted: Wed Mar 23, 2005 6:35 am    Post subject: TChart grid drawing and more TChart question Reply with quote



Is it possible to force an axis grid drawing after a series drawing?
I use TAreaSeries and it's colored area overlaps grid lines,
but I need the grid was visible. Any ideas?
Also, my series X values are date/time and XScreenToValue(N)
method returns date/time which corresponds to Nth pixel.
This date/time value shows only place on the X axis, but I need
a _nearest_ _existing_ point's (relative to X axis) X value. E.g.
my series has points with X values ..., 00:05, 00:08... and
above XScreenToValue(N) method returns 00:07. The point with
such date/time value does not exist. So I need to locate the nearest
point in a series: 00:08. How?



Back to top
Damon Chandler (TeamB)
Guest





PostPosted: Sat Mar 26, 2005 7:49 am    Post subject: Re: TChart grid drawing and more TChart question Reply with quote



Hi,
For the gridlines to appear on top of the Series, you can call the
Draw() method of your chart's axes from within an OnAfterDraw event
handler...

void __fastcall TForm1::Chart1AfterDraw(TObject *Sender)
{
Chart1->LeftAxis->Draw(false);
Chart1->BottomAxis->Draw(false);
}

For the XScreenToValue() issue, have you tried looping through your list
of x-values (via the XValues property of the series) to find the nearest
neighbor? This should work if your x-values are monotonic.

Good luck,
--
Damon (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com
BCB Commonly Asked Questions
http://bcbjournal.com/bcbcaq


Tumurbaatar S. wrote:
Quote:
Is it possible to force an axis grid drawing after a series drawing?
Also, my series X values are date/time and XScreenToValue(N)
8< ---
such date/time value does not exist. So I need to locate the nearest
point in a series: 00:08. How?

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) 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.