We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to change the maxim value on y axis after lazy loading?

Hi,

After lazy loading of more data, the data range may become much bigger or smaller, the maxim value on y axis may have to be changed to get valid or better show, how to do that?


9 Replies 1 reply marked as answer

ZH Zhu March 27, 2023 03:43 AM UTC

I tried  ChartRangePadding, the chart may change too much during scrolling..

Not acceptable.



YG Yuvaraj Gajaraj Syncfusion Team March 27, 2023 12:15 PM UTC

Hi Zhu,


To achieve your requirement set the zoomMode property to x in the ZoomPanBehavior and make the series animationDuration to zero and set the rangePadding property to additional or round as per your requirement. Now the y-axis range will be calculated based on the visible data points only. We have shared the code snippet below for your reference.


Code snippet:

zoomPanBehavior: ZoomPanBehavior(
enablePanning: true,
zoomMode: ZoomMode.x,
),


primaryYAxis: NumericAxis(
rangePadding: ChartRangePadding.additional,
),

LineSeries(
animationDuration: 0,
)


If you are still facing the same issue, we kindly request you to share more information on your requirement in detail along with screenshots or screen recordings so that it will help us assist you in a better way.


Regards,

Yuvaraj.



ZH Zhu March 28, 2023 04:17 AM UTC

Hi, Yuvaraj,


I tried the way you recommended, it still have problem.


Please check the 2 pictures below, first is before scrolling, second is after scrolling, it changed too much and part of the purple line disappear in second picture.


Regards,

Zhu.



ZH Zhu March 28, 2023 06:46 AM UTC

Hi, Yuvaraj,


What I expect is changing the maxim limit of y axis after lazy loading when needed, then user can scroll without data trace  changing.


Regards,

Zhu.



YG Yuvaraj Gajaraj Syncfusion Team March 28, 2023 04:14 PM UTC

Hi Zhu,


We are validating your query at our end and we will update further details tomorrow. We appreciate your patience until then.


Regards,

Yuvaraj.



ZH Zhu March 29, 2023 01:59 AM UTC

Great, looking forward to it..



YG Yuvaraj Gajaraj Syncfusion Team March 29, 2023 08:38 AM UTC

Hi Zhu,


To maintain a consistent view without knowing the data trace changing, you can try setting the anchorRangeToVisiblePoints property to false on the y-axis, It will help you to maintain the y-axis range with maximum y value in overall data points. We have shared the code snippet below for your reference. 


Code snippet:

zoomPanBehavior: ZoomPanBehavior(
enablePanning: true,
zoomMode: ZoomMode.x,
),


primaryYAxis: NumericAxis(
anchorRangeToVisiblePoints: false,
),


Regards,

Yuvaraj.


Marked as answer

ZH Zhu March 30, 2023 01:32 AM UTC

Hi, Yuvaraj,


This way works, thank you so much for the help.


Best Regards,

Zhu.



YG Yuvaraj Gajaraj Syncfusion Team March 30, 2023 04:53 AM UTC

Most Welcome. Kindly get back to us if you have further queries. We are always happy to assist you.


Loader.
Live Chat Icon For mobile
Up arrow icon