google / charts

https://pub.dev/packages/charts_flutter
Apache License 2.0
2.8k stars 1.2k forks source link

behaviors: [charts.PanAndZoomBehavior()] does not work if domainAxis: charts.DateTimeAxisSpec() is used #734

Open mmalcek opened 2 years ago

mmalcek commented 2 years ago

I need to change color in case of darkMode which works with following code:

behaviors: [charts.PanAndZoomBehavior()],
domainAxis: charts.DateTimeAxisSpec(
          renderSpec: charts.GridlineRendererSpec(
              labelStyle: charts.TextStyleSpec(
                  fontSize: 10,
                  color: (Theme.of(context).brightness == Brightness.dark)
                      ? charts.MaterialPalette.white
                      : charts.MaterialPalette.black))),

But it breaks "PanAndZoomBehavior" functionality and it is no longer possible use pinchToZoom on chart

I've tried it also with minimal code - which does not work either

behaviors: [charts.PanAndZoomBehavior()],
domainAxis: const charts.DateTimeAxisSpec(),

Is this a bug or am I missing something?

piotrkovsy1331 commented 2 years ago

Did you found a solution ?