💄 Optimize graph painting
This commit is contained in:
		| @@ -410,12 +410,22 @@ class _CalculatorHomePageState extends State<CalculatorHomePage> { | |||||||
|                               sideTitles: SideTitles( |                               sideTitles: SideTitles( | ||||||
|                                 showTitles: true, |                                 showTitles: true, | ||||||
|                                 reservedSize: 40, |                                 reservedSize: 40, | ||||||
|  |                                 getTitlesWidget: (value, meta) => | ||||||
|  |                                     SideTitleWidget( | ||||||
|  |                                       axisSide: meta.axisSide, | ||||||
|  |                                       child: Text(value.toStringAsFixed(2)), | ||||||
|  |                                     ), | ||||||
|                               ), |                               ), | ||||||
|                             ), |                             ), | ||||||
|                             bottomTitles: AxisTitles( |                             bottomTitles: AxisTitles( | ||||||
|                               sideTitles: SideTitles( |                               sideTitles: SideTitles( | ||||||
|                                 showTitles: true, |                                 showTitles: true, | ||||||
|                                 reservedSize: 30, |                                 reservedSize: 30, | ||||||
|  |                                 getTitlesWidget: (value, meta) => | ||||||
|  |                                     SideTitleWidget( | ||||||
|  |                                       axisSide: meta.axisSide, | ||||||
|  |                                       child: Text(value.toStringAsFixed(2)), | ||||||
|  |                                     ), | ||||||
|                               ), |                               ), | ||||||
|                             ), |                             ), | ||||||
|                             topTitles: AxisTitles( |                             topTitles: AxisTitles( | ||||||
| @@ -431,6 +441,19 @@ class _CalculatorHomePageState extends State<CalculatorHomePage> { | |||||||
|                               color: Theme.of(context).colorScheme.outline, |                               color: Theme.of(context).colorScheme.outline, | ||||||
|                             ), |                             ), | ||||||
|                           ), |                           ), | ||||||
|  |                           lineTouchData: LineTouchData( | ||||||
|  |                             enabled: true, | ||||||
|  |                             touchTooltipData: LineTouchTooltipData( | ||||||
|  |                               getTooltipItems: (touchedSpots) { | ||||||
|  |                                 return touchedSpots.map((spot) { | ||||||
|  |                                   return LineTooltipItem( | ||||||
|  |                                     'x = ${spot.x.toStringAsFixed(2)}', | ||||||
|  |                                     const TextStyle(color: Colors.white), | ||||||
|  |                                   ); | ||||||
|  |                                 }).toList(); | ||||||
|  |                               }, | ||||||
|  |                             ), | ||||||
|  |                           ), | ||||||
|                           lineBarsData: [ |                           lineBarsData: [ | ||||||
|                             LineChartBarData( |                             LineChartBarData( | ||||||
|                               spots: points, |                               spots: points, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user