Welcome to the Flutter feedback portal. We’re happy you’re here! If you have feedback on how to improve the Flutter, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
It seem that plot band is not working well.
example code:
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_charts/charts.dart';
void main() { runApp(TestPage());
}
class TestPage extends StatelessWidget {
Widget build(BuildContext context) {
final List<Data> chartData = [
Data(0, -3),
Data(1, 2),
Data(2, 4),
Data(3, 8),
Data(4, 1),
];
return MaterialApp( home: Scaffold( appBar: AppBar( title: Text('Test'),
),
body: SfCartesianChart( series: <ChartSeries>[ LineSeries<Data, double>( dataSource: chartData,
xValueMapper: (Data sales, _) => sales.x,
yValueMapper: (Data sales, _) => sales.y,
),
],
primaryYAxis: NumericAxis(
plotBands: [
// replace the comment/code here with the code snippets for each case
],
),
),
),
);
}
}
class Data {
final double x;
final double y;
Data(this.x, this.y);
}
case 1
PlotBand(
start: 0,
end: -6,
)
case 2
PlotBand(
start: 20,
end: 3,
)
Problem: In these two cases, the plot bands are overflowed and may hide the axis label.
Case 3
primaryYAxis: NumericAxis(
visibleMinimum: 0,
visibleMaximum: 4,
plotBands: [
PlotBand(
start: 0,
end: 1,
),
],
),
zoomPanBehavior: ZoomPanBehavior(
enablePanning: true,
),
PlotBand(
start: 3,
),