Cropping in spline series even with chartRangePadding.additional

SfCartesianChart(
margin: EdgeInsets.fromLTRB(0, 0, 0, 0),
legend: Legend(isVisible: false),
plotAreaBorderWidth: 0,
enableAxisAnimation: false,
primaryXAxis: DateTimeAxis(
isVisible: false,
minimum: DateTime.now().add(Duration(hours: 12)),
maximum: DateTime.now().add(Duration(days: 7, hours: 12)),
),
primaryYAxis: NumericAxis(
isVisible: false,
rangePadding: ChartRangePadding.additional,
),
series: <SplineSeries<PointData, DateTime>>[
for (var graph in loadedGraphs.keys)
if (graph.isVisible)
SplineSeries<PointData, DateTime>(
dashArray: graph.isInput ? [5, 15] : [1, 1],
markerSettings: MarkerSettings(
isVisible: true,
height: 14,
width: 14,
borderWidth: 6,
borderColor: appUser.getCategoryColor(graph.categoryId),
),
width: 10,
color: appUser.getCategoryColor(graph.categoryId),
emptyPointSettings: EmptyPointSettings(
mode: EmptyPointMode.average,
),
dataSource: loadedGraphs[graph],
xValueMapper: (PointData pointData, _) =>
DateTime.now().add(Duration(days: pointData.index)),
yValueMapper: (PointData pointData, _) => pointData.points,
)
],
),


Here is a picture illustrating the problem: https://imgur.com/a/OZVisdK

I get this problem only when there is a certain high low value sequence. Like here, which is high value, low

value, high value, high value, and low value. Is there any workaround with this?

Note: by cropping i only mean in the x axis, since i am intentionally cropping in the y axis, in the example provided

I can solve the problem by increasing the margin, but that flattens the other graphs where this problem is not present


1 Reply

DD Dharanidharan Dharmasivam Syncfusion Team August 16, 2021 12:56 PM UTC

Hi Marco, 
 
Thanks for the provided information. We suspect that the cropping in x-axis is due to the minimum and maximum range you have used. We have tried to replicate this but without your exact data source we are unable to replicate the exact scenario. So, kindly tr to replicate the scenario with your data source in the attached sample and revert us. This will be helpful in providing the solution sooner. 
 
 
Thanks, 
Dharani. 


Loader.
Up arrow icon