 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tumurbaatar S. Guest
|
Posted: Wed Mar 23, 2005 6:35 am Post subject: TChart grid drawing and more TChart question |
|
|
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
|
Posted: Sat Mar 26, 2005 7:49 am Post subject: Re: TChart grid drawing and more TChart question |
|
|
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 |
|
 |
|
|
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
|
|