Skip to content

Commit

Permalink
Fix edge case for dynamically changing from line to scatter for none
Browse files Browse the repository at this point in the history
  • Loading branch information
andreped committed Aug 9, 2024
1 parent 8c1eb15 commit ad1f92b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tabs/visualization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ class _VisualizationTabState extends State<VisualizationTab> {
if (newValue != null) {
setState(() {
_aggregationMethod = newValue;
// Automatically switch to Scatter if 'None' is selected
if (_aggregationMethod == 'None' && _chartType == 'Line') {
_chartType = 'Scatter';
}
});
if (_selectedExercise != null) {
_fetchDataPoints(_selectedExercise!);
Expand Down Expand Up @@ -188,7 +192,7 @@ class _VisualizationTabState extends State<VisualizationTab> {
lineBarsData: [
LineChartBarData(
spots: _dataPoints,
isCurved: false,
isCurved: false, // Straight lines
color: Colors.blue,
dotData: FlDotData(show: false),
belowBarData: BarAreaData(show: false),
Expand Down

0 comments on commit ad1f92b

Please sign in to comment.