BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi,
Here are my questions:
1. I want to put Legend under the X axis, seems not an option for ChartAlignment?
2. I don't want Y axis to change interval when do zooming, so I set enableAutoIntervalOnZooming to false, but it don't work, why?
Hi Zhu,
Greetings from Syncfusion.
Query #1: I want to put Legend under the X axis, seems not an option for ChartAlignment?
For placing the legend under the x-axis you can use the position property used to position the legend relatively. The available options are auto, bottom, left, right, and top. We have shared the code snippet below for your reference.
Code snippet:
legend: Legend( isVisible: true, position: LegendPosition.bottom, ), |
Screenshot:
Query 2#: I don't want Y axis to change interval when do zooming, so I set enableAutoIntervalOnZooming to false, but it don't work, why?
When the enableAutoIntervalOnZooming property is set to 'false', the nice interval will not be calculated based on the visible range. Instead, the actual interval will be maintained while zooming. This means that the difference between the two axis labels will remain the same as the original interval. E.g., if the actual interval is 2, after performing zooming the interval will be the same. We have shared the UG link below for your reference.
UG, https://help.syncfusion.com/flutter/cartesian-charts/zoom-pan#auto-interval-on-zooming
Regards,
Yuvaraj.
Hi, Yuvaraj,
Thank you so much for the detailed reply.
About question 2, what I need is to change intervals on X axis to apply to zooming, but on Y axis keep the old intervals at zooming time, how to do that?
I tried to set enableAutoIntervalOnZooming to false on Y axis, but it don't work.
Regards,
Zhu
Query: What I need is to change intervals on X axis to apply to zooming, but on Y axis keep the old intervals at zooming time, how to do that?
Your requirement can be achieved by setting the zoommode property value to ZoomMode.x in the ZoomPanBehavior and setting the y-axis anchorRangeToVisiblePoints to false. This will result in applying the zooming only on the x-axis range and will not affect the y-axis range.
Code snippet:
SfCartesianChart( zoomPanBehavior: ZoomPanBehavior( enableMouseWheelZooming: true, zoomMode: ZoomMode.x, ), primaryXAxis: NumericAxis(), primaryYAxis: NumericAxis( anchorRangeToVisiblePoints: false, ), ), |
For more details, please refer the following ug:
https://help.syncfusion.com/flutter/cartesian-charts/zoom-pan#panning
https://help.syncfusion.com/flutter/cartesian-charts/axis-customization#auto-range-calculation
Regards,
Lokesh Palani.
Hi, Lokesh Palan,
I added 'zoomMode: ZoomMode.x' and it works!
Thank you so much for the help.
Regards,
Zhu
Hi Zhu,
Most Welcome. Kindly get back to us if you have further queries. We are always happy to assist you.
Regards,
Yuvaraj.