Skip to content

Chart data not visible after updating from v23.1.43 to v26.1.35 #1926

@aamoronatti

Description

@aamoronatti

Bug description

Chart data not visible after updating from v23.1.43 to v26.1.35

Steps to reproduce

I updated the charts package from v23.1.43 to v26.1.35 and data is no longer visible on the chart.

I just changed from ChartSeries to CartesianSeries

Code sample

Code sample
class FreqCoordinationChart extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    final List<Color> color = <Color>[];
    color.add(Colors.yellow[50]!);
    color.add(Colors.yellow[200]!);
    color.add(Colors.yellow);

    final List<double> stops = <double>[];
    stops.add(0.0);
    stops.add(0.4);
    stops.add(1.0);

    final LinearGradient gradientColors = LinearGradient(
        colors: color,
        stops: stops,
        begin: Alignment.bottomCenter,
        end: Alignment.topCenter);
    return GetBuilder<FreqCoordinationController>(
      builder: (_) => SfCartesianChart(
        series: <CartesianSeries>[
          AreaSeries<GraphData, double>(
              dataSource: _.graphData,
              xValueMapper: (GraphData data, _) => data.x,
              yValueMapper: (GraphData data, _) => data.y,
              gradient: gradientColors),
          ColumnSeries<Transmitter, double>(
              enableTooltip: true,
              animationDuration: 0,
              dataSource: _.getSelectedTransmitter(),
              width: 0,
              borderWidth: 3,
              borderColor: Colors.blue,
              dataLabelMapper: (data, _) => data.hasConflicts ? "⚠" : "",
              dataLabelSettings: DataLabelSettings(
                  textStyle: TextStyle(
                    fontWeight: FontWeight.bold,
                    color: Colors.red[300],
                  ),
                  isVisible: true,
                  labelAlignment: ChartDataLabelAlignment.outer),
              xValueMapper: (tx, _) => tx.freq,
              yValueMapper: (tx, _) => tx.height,
              pointColorMapper: (tx, _) => tx.color),
          ColumnSeries<ThirdOrderData3Tx, double>(
              animationDuration: 0,
              dataSource:
                  _.calculate3rdOrder3Tx(_.transmitterList.transmitters),
              width: 0,
              borderWidth: 1.25,
              borderColor: Colors.orange,
              xValueMapper: (ThirdOrderData3Tx tx, _) => tx.freq,
              yValueMapper: (ThirdOrderData3Tx tx, _) => tx.height,
              pointColorMapper: (ThirdOrderData3Tx tx, _) => tx.color),
          ColumnSeries<ThirdOrderData2Tx, double>(
              animationDuration: 0,
              dataSource:
                  _.calculate3rdOrder2Tx(_.transmitterList.transmitters),
              width: 0,
              borderWidth: 1.25,
              borderColor: Colors.orange,
              xValueMapper: (ThirdOrderData2Tx tx, _) => tx.freq,
              yValueMapper: (ThirdOrderData2Tx tx, _) => tx.height,
              pointColorMapper: (ThirdOrderData2Tx tx, _) => tx.color),
          ColumnSeries<FifthOrderData, double>(
            animationDuration: 0,
            dataSource: _.calculateFifthOrder(_.transmitterList.transmitters),
            width: 0,
            borderWidth: 1.25,
            borderColor: Colors.lightBlue[200]!,
            xValueMapper: (FifthOrderData tx, _) => tx.freq,
            yValueMapper: (FifthOrderData tx, _) => tx.height,
            pointColorMapper: (FifthOrderData tx, _) => tx.color,
          ),
          ColumnSeries<SeventhOrderData, double>(
            animationDuration: 0,
            dataSource: _.calculateSeventhOrder(_.transmitterList.transmitters),
            width: 0,
            borderWidth: 1.25,
            borderColor: Colors.purple,
            xValueMapper: (SeventhOrderData tx, _) => tx.freq,
            yValueMapper: (SeventhOrderData tx, _) => tx.height,
            pointColorMapper: (SeventhOrderData tx, _) => tx.color,
          ),
        ],
        primaryYAxis: NumericAxis(
          minimum: 0,
          maximum: 60,
          axisLine: AxisLine(width: 0),
          majorTickLines: MajorTickLines(width: 0),
        ),
        primaryXAxis: NumericAxis(
          minimum: _.getMinBoundaries() - 50,
          maximum: _.getMaxBoundaries() + 50,
          axisLine: AxisLine(width: 0),
          interactiveTooltip: InteractiveTooltip(enable: false),
          majorTickLines: MajorTickLines(width: 0),
        ),
        zoomPanBehavior: ZoomPanBehavior(
          enableSelectionZooming: true,
          maximumZoomLevel: 0.01,
          enablePinching: true,
          zoomMode: ZoomMode.x,
          enablePanning: true,
          enableMouseWheelZooming: false,
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

v26 - Not working
v26

v23 - Working
v23

Stack Traces

Stack Traces
[Add the Stack Traces here]

On which target platforms have you observed this bug?

Android, iOS

Flutter Doctor output

Doctor output
[Add your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingchartsCharts componentfixedFixed and delivered update

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions