I've not done exactly what you need before, but something similar by  
creating a subclass of LinearAxis and overriding the dataChanged  
method (IIRC, may possibly be update) and using this class as the  
vertical axis.

In the override you can get hold of the DataDescription object of  
your data from the dataDescriptions array.  This tells you the min  
and max values of the data, and you can then use them to set the  
maximum and minimum properties of the axis.  The only worry is that  
the data descriptions may report the min and max of the whole data  
series in your scenario, in which case you may have to pass the date  
range into your axis class and dig through the data yourself :(

HTH.
Stephen


On 2 Nov 2007, at 15:22, imjackson84 wrote:
> Hi,
>
> I have a stock market line chart with a CategoryAxis (representing
> dates) along the bottom and a LinearAxis up the side. My chart has the
> option of adjusting the date range, which is done by switching the
> category data provider for the x-axis, but keeping the actual line
> series data provider the same.
>
> However, when I change the x-axis range, the y-axis range remains
> unchanged, as the min and max are being determined from the entire
> series data provider. How can I adjust the y-axis range to match only
> what is currently visible on the graph?
>
> Thanks,
>
> Iain

Reply via email to