thekeenant / fcharts

:bar_chart: Create beautiful, responsive, animated charts using a simple and intuitive API.
https://pub.dartlang.org/packages/fcharts
MIT License
326 stars 46 forks source link

[Question] Y axis order #21

Closed marianoarga closed 5 years ago

marianoarga commented 5 years ago

Hello, how can I order the Y axis in order to show a kind of timeline chart? I'm trying something like this, but the Y axis is not ordering, it just appears in the order is set, '37.93' should appear at the top:

static const myData = [
  ["2018-10-23","37.65"],
  ["2018-10-24","37.63"],
  ["2018-10-25","37.93"],
  ["2018-10-26","37.85"],
  ["2018-10-27","37.85"]
];

...

LineChart(
              lines:
              [
                new Line<List, String, double>(
                  stroke: PaintOptions.stroke(color: Colors.green,strokeWidth: 3.0),
                  marker: MarkerOptions(paint: PaintOptions.fill(color: Colors.blue)),
                  data: myData,
                  xFn: (datum) => datum[0],
                  yFn: (datum) => double.parse(datum[1]),
                ),
              ],
              chartPadding: new EdgeInsets.fromLTRB(60.0, 10.0, 10.0, 30.0),
            )
thekeenant commented 5 years ago

Sounds like you want the Y-Axis to be quantitative, similar to what would find here (the "size" of the city).

Something like this?

yAxis: new ChartAxis(
  span: new DoubleSpan(37.5, 38.0),
  tickGenerator: IntervalTickGenerator.byN(0.05)
)