Page 1 of 1

Teechart Autoscale Price Axis

Posted: Thu Nov 20, 2008 9:33 am
by 10048793
Hi,

I have a Delphi 7/Teechart program that allows you to zoom on the date/price axis of a line series. I added a scroll bar under the chart so I can easily scroll along the date axis when it is zoomed. The problem is that as I scroll the line can disappear as it is out of the bounding box 'Price' range.

What I'd like is an autoscale price axis that shows the best size axis for the visible part of the series in the chart pane.
As you scroll, the price axis automatically adjusts to display all the visible data in the chart Window using a 'best fit' type method.

Is this feature built into Teechart (VCL) or can it be easily implemented?

Thanks

Posted: Mon Nov 24, 2008 8:00 am
by narcis
Hi Rania,

Could you please give us some more details about your application? Which TeeChart version are you using? Are you using TChartScrollBar or standard TScrollBar? There are some known issues with TChartScrollBar on that field, we'd better recommend using TScrollBar. I can send you an example if necessary.

Posted: Mon Nov 24, 2008 8:24 am
by 10048793
Hi,
We have the latest version. The problem is NOT the scroll bar. I want the X axis to auto scale a sthe chart is scrolled. Thanks

Posted: Mon Nov 24, 2008 8:27 am
by narcis
Hi Rania,

There was a bug with TChartScrollBar (TV52013102) which was fixed in latest v8.04 release as you can see in the release notes.

Can you please confirm you are using v8.04 and TChartScrollBar component?

Thanks in advance.

Posted: Mon Nov 24, 2008 9:46 am
by 10048793
Hi Narcis,
We are running 8.02. I have NO problem with scrolling the chart. I need the X axis to autoscale based on the visible data in the chart pane.

How do I do this?

Posted: Mon Nov 24, 2008 9:55 am
by narcis
Hi Rania,

As you can see in TV52013102's description in the release notes:
12) [TV52013102]
TChartScrollBar component modified axes
scales incorrectly when zooming or panning
associated chart.
This means that when having a TChartScrollBar associated to a chart and you zoomed or scrolled that chart the TChartScrollBar tool wrongly modified axis scales, even you didn't manipulate the scroll bar directly.

I suspect that your probelm coud be related to this bug so could you please let us know if you are using a TChartScrollBar or a TScrollBar? Could you also please try using v8.04, available at the client area?

Thanks in advance.

Posted: Mon Nov 24, 2008 10:39 am
by 10048793
Hi Narcis,
I think we are tyalking at cross purposes.


Please look at the video in http://www.rania.co.uk/teechart/scalezoom.zip and you'll see what I want to recreate using Teechart.


Is there a property that turns ON/OFF the autoscaling of the Y axis as you scroll along the date axis?


Thanks
Don

Posted: Mon Nov 24, 2008 6:19 pm
by narcis
Hi Don,

In that case you can do something like the example here. You could use the OnZoom and OnScroll events for calling Chart1.Draw and then set left axis min. and max. values as you wish.

Hope this helps!