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