I can't dispaly on a chart negative value.

Hi! 

I have implemented your chart plugin and can't draw negative value on the chart.

my code here:

  fill array with data:


List<_WeightData> data = [ // заполняем этот масив для графика
_WeightData('21 Jan', -35, 28),
_WeightData('22 Feb', -28, 28),
_WeightData('23 Mar', -34, 28),
_WeightData('24 Mar', 56, 28),
_WeightData('25 Mar', 60, 28),
_WeightData('26 Mar', 55, 28),
_WeightData('27 Mar', 55, 28),
_WeightData('28 Mar', -65, 28),
_WeightData('29 Mar', -75, 28),
_WeightData('24 Apr', -90, 28),
_WeightData('May', 40, -28)
];
class _WeightData {
_WeightData(this.day, this.weight, this.weight_start_val);

String day;
int weight;
int weight_start_val;
}

And implement chart:

child: SfCartesianChart(
primaryXAxis: CategoryAxis(/*labelPlacement: LabelPlacement.betweenTicks, interval: 2*/),
primaryYAxis: NumericAxis(minimum: _minimum_weight_of_array),

zoomPanBehavior: ZoomPanBehavior(enablePinching: true),

series: <ChartSeries<_WeightData, String>>[
SplineRangeAreaSeries<_WeightData, String>(
dataSource: data,
// Setting the gradient for the series
gradient: _linearGradient,
xValueMapper: (_WeightData weight, _) => weight.day,
highValueMapper: (_WeightData weight, _) => weight.weight,
lowValueMapper: (_WeightData weight, _) => weight.weight_start_val

)
]
)

And I got only chart with positive value:


How can I get my negative values on the chart?


1 Reply

YG Yuvaraj Gajaraj Syncfusion Team December 20, 2021 03:35 PM UTC

Hi metcenger,


We have analyzed the customer query and we would like to let you know that the reported issue has been already resolved in the latest version of our package. Kindly upgrade to our latest version from below.


Version:
https://pub.dev/packages/syncfusion_flutter_charts/versions/19.4.38


Regards,

Yuvaraj.


Loader.
Up arrow icon