We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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), ); } }`
The text was updated successfully, but these errors were encountered:
No answer ???
Sorry, something went wrong.
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
No branches or pull requests
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),
);
}
}`
The text was updated successfully, but these errors were encountered: