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!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

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,
)

Screenshot_1578293358.png

case 2

PlotBand(
start: 20,
end: 3,
)


Screenshot_1578293459.png

Problem: In these two cases, the plot bands are overflowed and may hide the axis label.

Expectation
: plot bands should only draw with in the plot area.

Suggestion 2
Should end < start be allow? um, may be no? Not allowing end < start can fix many bugs. The same problem also exist for Axis's visible minimum and maximum.

Case 3

primaryYAxis: NumericAxis(
visibleMinimum:
0,
visibleMaximum: 4,
  plotBands: [
PlotBand(
start:
0,
      end: 1,
    ),
  ],
),
zoomPanBehavior: ZoomPanBehavior(
enablePanning:
true,
),

Screenshot_1578295626.pngScreenshot_1578295669.png
Problem: The plot band show only if it is fully visible.

Expectation: The plot band should show even if it is partly visible.

case 4:
PlotBand(
start: 3,
),

Screenshot_1578295873.png
Problem: Exception thrown if end value is not provided.

Expectation: Plot band show from 
provided start value to axis visible maximum. (just like providing end value but omitting start value.)

Exception message:

I/flutter (28288): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════

I/flutter (28288): The following NoSuchMethodError was thrown during paint():

I/flutter (28288): The method '<=' was called on null.

I/flutter (28288): Receiver: null

I/flutter (28288): Tried calling: <=(4.0)

I/flutter (28288):

I/flutter (28288): The relevant error-causing widget was:

I/flutter (28288): CustomPaint

I/flutter (28288): file:///C:/Dev/Flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_charts-17.4.40/lib/src/chart/base/chart_base.dart:1319:23

I/flutter (28288):

I/flutter (28288): When the exception was thrown, this was the stack:

I/flutter (28288): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)

I/flutter (28288): #1 _PlotBandPainter._renderPlotBandElement (package:syncfusion_flutter_charts/src/chart/axis/plotband.dart:638:13)

I/flutter (28288): #2 _PlotBandPainter._renderPlotBand (package:syncfusion_flutter_charts/src/chart/axis/plotband.dart:580:7)

I/flutter (28288): #3 _PlotBandPainter.paint (package:syncfusion_flutter_charts/src/chart/axis/plotband.dart:516:11)

I/flutter (28288): #4 RenderCustomPaint._paintWithPainter (package:flutter/src/rendering/custom_paint.dart:531:13)