Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

"Null check operator used on a null value" on legend with measures #786

Open
LamsaLL opened this issue Jul 21, 2022 · 1 comment
Open

"Null check operator used on a null value" on legend with measures #786

LamsaLL opened this issue Jul 21, 2022 · 1 comment

Comments

@LamsaLL
Copy link

LamsaLL commented Jul 21, 2022

When we set legendDefaultMesaure different than none and we want to toggle show\hide series on legend we got this error :
bar-chart-on-tap
bug-hide-series-on-legend

Here is the code of my graph :

class GroupedBarChart extends StatelessWidget {
  final List<charts.Series<dynamic, String>> seriesList;

  const GroupedBarChart({Key? key, required this.seriesList}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return charts.BarChart(seriesList,
        animate: true,
        barGroupingType: charts.BarGroupingType.grouped,
        behaviors: [
          charts.SeriesLegend(
              position: charts.BehaviorPosition.top,
              horizontalFirst: true,
              cellPadding: const EdgeInsets.only(right: 16),
              showMeasures: true,
              legendDefaultMeasure: charts.LegendDefaultMeasure.sum,
              measureFormatter: (num? value) {
                return value == null ? '-' : value.round().toString();
              }),
        ]);
  }
}
@heshaShawky
Copy link

did you get to fix it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants