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
Getting Exception: indicatorsData and touchedSpotOffsets size should be same. here's my code:
return MaterialApp( home: Scaffold( backgroundColor: Color(0xFFF0F2F6), body: Center( child: Container( padding: const EdgeInsets.all(10), width: double.infinity, height: 200, child: LineChart( // curve: Curves.easeInCubic, LineChartData( lineTouchData: LineTouchData( getTouchLineEnd: (barData, spotIndex) => barData.spots[spotIndex].y + 1000000, getTouchLineStart: (barData, spotIndex) => 0, getTouchedSpotIndicator: (barData, spotIndexes) => [ TouchedSpotIndicatorData( FlLine( dashArray: [4, 4], color: Colors.grey, ), FlDotData()) ], touchTooltipData: LineTouchTooltipData( maxContentWidth: 150, tooltipRoundedRadius: 8, fitInsideHorizontally: true, fitInsideVertically: true, tooltipBgColor: Colors.white, getTooltipItems: (touchedSpots) { return [ LineTooltipItem( 'May 9, 2023', TextStyle( color: Colors.grey, fontSize: 10, fontWeight: FontWeight.w400), children: [ TextSpan(text: '\nBalance'), TextSpan( text: "\nRs. ${touchedSpots[0].y.toString()}", style: TextStyle( color: Colors.black, fontSize: 12, fontWeight: FontWeight.w500)) ]), ]; }, )), titlesData: FlTitlesData(show: false), gridData: FlGridData(show: false), borderData: FlBorderData(show: false), lineBarsData: [ LineChartBarData( // preventCurveOverShooting: true, dotData: FlDotData(show: false), isCurved: true, color: Color(0xff0B72EB), spots: data, ) ]), ), ), ), ), );
The text was updated successfully, but these errors were encountered:
Flutter version? Package version? Steps to reproduce..? Add more detailed information please
Sorry, something went wrong.
fl_chart: ^0.66.2 Flutter 3.19.0 the exception occurs every time the indicator in the chart is moved or intereracted with.
Hi, can you please provide us with a reproducible code? (a main.dart file content that runs without any dependency)
No branches or pull requests
Getting Exception: indicatorsData and touchedSpotOffsets size should be same.
here's my code:
return MaterialApp(
home: Scaffold(
backgroundColor: Color(0xFFF0F2F6),
body: Center(
child: Container(
padding: const EdgeInsets.all(10),
width: double.infinity,
height: 200,
child: LineChart(
// curve: Curves.easeInCubic,
LineChartData(
lineTouchData: LineTouchData(
getTouchLineEnd: (barData, spotIndex) =>
barData.spots[spotIndex].y + 1000000,
getTouchLineStart: (barData, spotIndex) => 0,
getTouchedSpotIndicator: (barData, spotIndexes) => [
TouchedSpotIndicatorData(
FlLine(
dashArray: [4, 4],
color: Colors.grey,
),
FlDotData())
],
touchTooltipData: LineTouchTooltipData(
maxContentWidth: 150,
tooltipRoundedRadius: 8,
fitInsideHorizontally: true,
fitInsideVertically: true,
tooltipBgColor: Colors.white,
getTooltipItems: (touchedSpots) {
return [
LineTooltipItem(
'May 9, 2023',
TextStyle(
color: Colors.grey,
fontSize: 10,
fontWeight: FontWeight.w400),
children: [
TextSpan(text: '\nBalance'),
TextSpan(
text:
"\nRs. ${touchedSpots[0].y.toString()}",
style: TextStyle(
color: Colors.black,
fontSize: 12,
fontWeight: FontWeight.w500))
]),
];
},
)),
titlesData: FlTitlesData(show: false),
gridData: FlGridData(show: false),
borderData: FlBorderData(show: false),
lineBarsData: [
LineChartBarData(
// preventCurveOverShooting: true,
dotData: FlDotData(show: false),
isCurved: true,
color: Color(0xff0B72EB),
spots: data,
)
]),
),
),
),
),
);
The text was updated successfully, but these errors were encountered: