I need help because I can't resolve this error even putting sidetiltle #1609
Unanswered
pradofelipe
asked this question in
Q&A
Replies: 1 comment
-
Please provide more information. And a reproducible code (a main.dart file content) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
import 'package:flutter/material.dart';
import 'package:fl_chart/fl_chart.dart';
class WeightChart extends StatefulWidget {
@OverRide
_WeightChartState createState() => _WeightChartState();
}
class _WeightChartState extends State {
List<Map<String, dynamic>>? chartData = [
{"measured_at": "2022-01-01", "weight": 70.0},
{"measured_at": "2022-02-01", "weight": 72.0},
{"measured_at": "2022-03-01", "weight": 71.5},
{"measured_at": "2022-04-01", "weight": 73.0},
{"measured_at": "2022-05-01", "weight": 72.5},
{"measured_at": "2022-06-01", "weight": 72.8},
{"measured_at": "2022-07-01", "weight": 74.0},
]; // Lista para armazenar os dados do gráfico
@OverRide
Widget build(BuildContext context) {
return LineChart(
LineChartData(
minX: 0,
maxX: (chartData!.length - 1).toDouble(), // Define o intervalo no eixo X
}
}
Beta Was this translation helpful? Give feedback.
All reactions