Closed nasr25 closed 5 years ago
No answer ???
Hi, it's just me on this project so there isn't much support.
You can sort the data before providing it to the line chart. This sorts your data by the X axis value ascending:
final sortedData = <List<int>>[]..addAll(myData)..sort((a, b) {
return a.first.compareTo(b.first);
});
Ok, thanks
Hi
i have example code to show line chart, but X and Y axis values not ordered, how can i make it ordered from 0 to big number in series.
`class SimpleLineChart extends StatelessWidget { // X value -> Y value static const myData = [ [2,5], [1,3], [10,9], ];
@override Widget build(BuildContext context) { return new LineChart( lines: [ new Line<List, String, String>(
data: myData,
xFn: (datum) => datum[0],
yFn: (datum) => datum[1],
),
],
chartPadding: new EdgeInsets.fromLTRB(30.0, 10.0, 10.0, 30.0),
);
}
}`