Hi Yudhisthir,
Kindly find the response for your queries below.
Query #1: Can I make all the numbers on the y-axis as whole numbers and not decimal ones?
Yes, using the decimalplaces and globalized number format property of the axis, your requirement can be achieved. Find the code snippet to achieve this.
|
SfCartesianChart(
primaryYAxis: NumericAxis(
numberFormat: NumberFormat.compact(),
decimalPlaces: 0)
)
|
Query #2: Is there any way to set the interval in such a way that all the charts have an equal number of gridLines
Yes, using the onActualRangeChangedEvent, your requirement can be achieved. Find the code snippet below to achieve this.
|
SfCartesianChart(
onActualRangeChanged: (ActualRangeChangedArgs args){
final double gridLineCount = 4;
if(args.axisName == 'primaryYAxis')
args.visibleInterval = (args.visibleMax - args.visibleMin) / gridLineCount;
},
)
|
Query #3: Is there any way for me to get that maximum value?
Yes, your requirement can be achieved as a workaround. Before assigning the data source to chart, we have found the maximum y-value from the data source using the getMaxYValue method in the sample.
Sample for above can be found below.
Thanks,
Dharani.