Updating Secondary Axis minimum and maximum after scrolling in FastCandleBitmapSeries

Hello,

I need to update minimum and maximum ranges of secondary axis according to the visible data points.

For example I have a chart with 1000 candles. I use scrollbar and AutoScrollingDelta = 100. So I can see 100 candles on chart. When I scroll the chart I want Secondary Axis (Price) minimum and maximum be adjusted to the highest price  and lowest price of these 100 candles. How can I do that?


1 Reply

GM Gayathri Manickam Syncfusion Team November 1, 2021 01:29 PM UTC

Hi Alex, 
 
We analyzed your query “On scrolling the chart, SecondaryAxis (Price) minimum and maximum be adjusted to the highest price and lowest price of these 100 candles”. You can achieve this requirement with the help of Zooming event like PanChanged event which is occurred while scrolling. 
 
We can get the visible range datapoints using the series.GetDataPoints method. After getting the data points and we can find minimum and maximum value for secondary axis from the data points and set the Minimum and Maximum range for the secondary axis. Please refer below code snippet for your reference.   
 
List<object> data; 
//You can get the visible datapoints count by using the list.     
data = series.GetDataPoints(primaryAxis.VisibleRange.Start, primaryAxis.VisibleRange.End, secondaryAxis.VisibleRange.Start, secondaryAxis.VisibleRange.End);                              
 
 
By changing the Minimum and Maximum range of secondary axis while scrolling, chart UI looks like flickering. 
 
Thanks, 
Gayathri M. 


Loader.
Up arrow icon