google / charts

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

Is there a way to limit the range of Y-axis to only show max + 5 and min - 5 for ticks? #738

Open kespaldon opened 2 years ago

kespaldon commented 2 years ago

For example, I have weight progression data that I wanted to display as a line chart. It does not make sense for me to display the zero tick on the Y-axis.

I would like for the Y-axis to display the adjacent range of my min-max weight values.

something like this:

image

palicka commented 2 years ago
...
        // Provide a tickProviderSpec which does NOT require that zero is
        // included.
        primaryMeasureAxis: new charts.NumericAxisSpec(
            tickProviderSpec:
                new charts.BasicNumericTickProviderSpec(zeroBound: false)));
                ...

source:

https://google.github.io/charts/flutter/example/axes/nonzero_bound_measure_axis

OnesWYong commented 2 years ago

For example, I have weight progression data that I wanted to display as a line chart. It does not make sense for me to display the zero tick on the Y-axis.

I would like for the Y-axis to display the adjacent range of my min-max weight values.

something like this:

image

Hi, how did you display so many y-axis bars? I mean those vertical lines

OnesWYong commented 2 years ago

Besides using ScatterPlotChart, is there any other way?