I'm using line charts with a numeric axis.
In it, when I scroll the chart, the axis value is a decimal point.
I want to keep the axis values fixed at integers when scrolling.
Please tell me how to solve these problems.
|
SfCartesianChart(
onAxisLabelRender: (args) {
// checked the name of the axis/
if (args.axisName == 'primaryXAxis') {
// Floored the axis label value and set to its text argument to render the axis labels in
// integers in the chart.
args.text = args.value.floor().toString();
}
},
primaryXAxis: NumericAxis(
// Assigned name for x-axis to use it in the callback event
name: 'primaryXAxis',
decimalPlaces: 0,
)
// Your configuration
) |
|
SfCartesianChart(
primaryXAxis: NumericAxis(
decimalPlaces: 0,
)
// your configuration
), |