Hi
We are using TeeChart version 3.5.3187.15585
Ive spent some time searching the forums for an example of how to do a simple zoom IN on the horizontal axis only. The vertical axis should not be zoomed. Is it possible to do this.
Simple example. If the chart has 100 points starting from x=1 to x=100 but I just want to display from points 10 to 90 then how do I do this? Ive been playing about with the ZoomPercent() function but that doesn't restrict the zoom to any axis, just seems to zoom in both axes (also I cant seem to zoom in only zoom out). There is a ZoomRect() function also which looks more promising but again not sure how to implement this and the zoom parameters appear to be in pixels.
A code snippet would be great or perhaps its been done before and a link would help also.
Thanks!!
A simple Zoom on the X-Axis??
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: A simple Zoom on the X-Axis??
Hello Dave,
?
Have you tried:Dave wrote:A code snippet would be great or perhaps its been done before and a link would help also.
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Series.Add(typeof(Line)).FillSampleValues();
tChart1.Zoom.Direction = ZoomDirections.Horizontal;
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: A simple Zoom on the X-Axis??
Hi Christopher
Thanks but thats not really helping. I dont think Ive explained it very well
Please see the chart I've attached. What I want is to really select a rectangle from X coords -15 to +15 and height 65,000 and then display. Only not drawing a rectangle but using code to replicate this.
Ive just tried the following code;
Rectangle r = new Rectangle(-15, 65000, 30, 65000);
spectrumChart.Zoom.ZoomRect(r);
However this doesn't work at all. I see nothing and it seems to have zoomed into a small area in my chart.
Am I on the right track?
Thanks but thats not really helping. I dont think Ive explained it very well
Please see the chart I've attached. What I want is to really select a rectangle from X coords -15 to +15 and height 65,000 and then display. Only not drawing a rectangle but using code to replicate this.
Ive just tried the following code;
Rectangle r = new Rectangle(-15, 65000, 30, 65000);
spectrumChart.Zoom.ZoomRect(r);
However this doesn't work at all. I see nothing and it seems to have zoomed into a small area in my chart.
Am I on the right track?
- Attachments
-
- chart1.PNG (17.5 KiB) Viewed 9672 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: A simple Zoom on the X-Axis??
Hello Dave,
Possibly the easiest way to do this would be to use the Axis.SetMinMax method, e.g.
Yes and noDave wrote:Hi Christopher
Thanks but thats not really helping. I dont think Ive explained it very well
[...]
Am I on the right track?
Possibly the easiest way to do this would be to use the Axis.SetMinMax method, e.g.
tChart1.Axes.Bottom.SetMinMax(-15, 15);
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: A simple Zoom on the X-Axis??
Sensational!
Thanks Christopher.
Thanks Christopher.