You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
final lineData =<Map<String, dynamic>>[];// {"Date": "04.01.2016", "Close": 126.12};configLineData() {
final now =DateTime.now();
final random =Random();
for (int i =0; i<40000; i++) {
final time = now.subtract(Duration(minutes: i));
final timeStr ="${time.year}-${time.month.toString().padLeft(2,'0')}-${time.day.toString().padLeft(2,'0')}${time.hour.toString().padLeft(2,'0')}:${time.minute.toString().padLeft(2,'0')}:00";
lineData.add({"Date": timeStr, "Close": random.nextDouble() *20+70});
}
}
The text was updated successfully, but these errors were encountered:
It seems to me that you're generating all that data synchronously during the build method. Try doing it asynchronously and use something like a FutureBuilder to only show the chart once you have the adata generated.
下面是数据源
The text was updated successfully, but these errors were encountered: