Page 1 of 1
Position in zoom window
Posted: Tue Jan 10, 2006 12:06 pm
by 8123141
How can I find out the last visible x-value (position) when I'm zooming in. In other words, I need to know the last shown x-value (independent of any series) of the zoom window and I need to know it in the
tChart_BeforeDrawSeries-method?
Many thanks in advance!
Posted: Tue Jan 10, 2006 2:12 pm
by narcis
Hi dotnetjunkee,
You can do what I suggested in your other thread. Why do you need that to be done in the BeforeDrawSeries event?
Posted: Tue Jan 10, 2006 2:49 pm
by 8123141
unfortunately I cannot do what you suggested because I don't want to know the most right x-value of the series. I want to know the most right x-value that is shown on the canvas.
And I need to do this in the tChart_BeforeDrawSeries-method because I'm working with annotations which need to be sticked to a vertical separator line.
To become a bit more concrete:
Lets say my chart is split into three parts, each part separated from its neighbor part with a separator line. There is an annotation on the left hand-side of a separator line and the last annotation is left hand-side of the right canvas border. When I zoom in, I need to find out if the last annotation should be shown, i. e. if I zoom into the right part of the chart.
That's why I couldn't find a way to use your solution.
Another question: I posted a question on a custom color pallete yesterday. The replay was that there is an example among the delivered demo programs. I've searched for this example but I couldn't find it. So can you post the code please.
Many thanks!
Posted: Tue Jan 10, 2006 3:20 pm
by narcis
Hi dotnetjunkee,
unfortunately I cannot do what you suggested because I don't want to know the most right x-value of the series. I want to know the most right x-value that is shown on the canvas.
The code below already shows you the last value drawn on TeeChart's canvas, not the last value of the series.
Code: Select all
tChart1.Header.Text="Maximum X Visible Value: " + tChart1.Axes.Bottom.Maximum.ToString();
And I need to do this in the tChart_BeforeDrawSeries-method because I'm working with annotations which need to be sticked to a vertical separator line.
To become a bit more concrete:
Lets say my chart is split into three parts, each part separated from its neighbor part with a separator line. There is an annotation on the left hand-side of a separator line and the last annotation is left hand-side of the right canvas border. When I zoom in, I need to find out if the last annotation should be shown, i. e. if I zoom into the right part of the chart.
That's why I couldn't find a way to use your solution.
Then I'd suggest you to implement that feature in TeeChart's AfterDraw event. If it doesn't work properly you may be interested in posting an example that we can run "as-is" to reproduce the problem here at [url]news://
www.steema.net/steema.public.attachments[/url] newsgroup.
Another question: I posted a question on a custom color pallete yesterday. The replay was that there is an example among the delivered demo programs. I've searched for this example but I couldn't find it. So can you post the code please.
You'll find that demo and its sources at TeeChart's example folder. However, the code is too large to be posted in a forums message. Do you mind if I send it to the e-mail address we have for your forums username?
Posted: Tue Jan 10, 2006 4:29 pm
by 8123141
yes, please email me the source code. I've just changed the email address in my profile!
Thanks a lot!
Posted: Wed Jan 11, 2006 9:48 am
by narcis
Hi dotnetjunkee,
Ok, I've just send it. Hope you received it.