diff --git a/lib/entity_widgets/history_chart/combined_history_chart.dart b/lib/entity_widgets/history_chart/combined_history_chart.dart index ac5ae8e..785a227 100644 --- a/lib/entity_widgets/history_chart/combined_history_chart.dart +++ b/lib/entity_widgets/history_chart/combined_history_chart.dart @@ -148,7 +148,7 @@ class _CombinedHistoryChartWidgetState extends State }); if ((_selectedId == -1) && (numericDataLists.isNotEmpty)) { - _selectedId = 0; + _selectedId = numericDataLists.length -1; } List> result = []; numericDataLists.forEach((attrName, dataList) { @@ -202,6 +202,11 @@ class _CombinedHistoryChartWidgetState extends State _selectedId -= 1; }); } + else { + setState(() { + _selectedId = _parsedHistory.first.data.length - 1; + }); + } } void _selectNext() { @@ -210,6 +215,12 @@ class _CombinedHistoryChartWidgetState extends State _selectedId += 1; }); } + else { + setState(() { + _selectedId = 0; + }); + + } } void _onSelectionChanged(charts.SelectionModel model) { diff --git a/lib/entity_widgets/history_chart/numeric_state_history_chart.dart b/lib/entity_widgets/history_chart/numeric_state_history_chart.dart index 8e6aaab..8645a37 100644 --- a/lib/entity_widgets/history_chart/numeric_state_history_chart.dart +++ b/lib/entity_widgets/history_chart/numeric_state_history_chart.dart @@ -103,7 +103,7 @@ class _NumericStateHistoryChartWidgetState extends State( @@ -132,6 +132,11 @@ class _NumericStateHistoryChartWidgetState extends State( @@ -137,14 +137,25 @@ class _SimpleStateHistoryChartWidgetState extends State