diff --git a/src/main/java/es/kauron/estraba/controller/DashboardController.java b/src/main/java/es/kauron/estraba/controller/DashboardController.java index 9f39ea5..1758510 100644 --- a/src/main/java/es/kauron/estraba/controller/DashboardController.java +++ b/src/main/java/es/kauron/estraba/controller/DashboardController.java @@ -27,6 +27,7 @@ package es.kauron.estraba.controller; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXSpinner; +import com.jfoenix.controls.JFXToggleButton; import com.lynden.gmapsfx.GoogleMapView; import com.lynden.gmapsfx.MapComponentInitializedListener; import com.lynden.gmapsfx.javascript.object.*; @@ -45,8 +46,6 @@ import javafx.scene.Scene; import javafx.scene.chart.AreaChart; import javafx.scene.chart.LineChart; import javafx.scene.chart.PieChart; -import javafx.scene.chart.XYChart; -import javafx.scene.control.ChoiceBox; import javafx.scene.control.Label; import javafx.scene.control.Tab; import javafx.scene.image.Image; @@ -103,7 +102,7 @@ public class DashboardController implements Initializable, MapComponentInitializ private LineChart speedTChart, hrTChart, cadenceTChart; @FXML - private ChoiceBox choiceBox; + private JFXToggleButton toggleCharts; @FXML private StackPane charts; @@ -127,10 +126,7 @@ public class DashboardController implements Initializable, MapComponentInitializ imgDistance.setImage(new Image(App.class.getResourceAsStream("img/distance.png"))); imgElevation.setImage(new Image(App.class.getResourceAsStream("img/elevation.png"))); - choiceBox.getItems().add(App.GENERAL_BUNDLE.getString("label.distance")); - choiceBox.getItems().add(App.GENERAL_BUNDLE.getString("label.time")); - choiceBox.setValue(choiceBox.getItems().get(0)); - choiceBox.valueProperty().addListener((observableValue, s, t1) -> { + toggleCharts.selectedProperty().addListener((observableValue, s, t1) -> { for (Node n : charts.getChildrenUnmodifiable()) n.setVisible(!n.isVisible()); }); diff --git a/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml b/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml index 3ea61fe..fb2450f 100644 --- a/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml +++ b/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml @@ -25,16 +25,27 @@ ~ --> - + + + + - - - - - - - + + + + + + + + + + + + + + + + @@ -354,7 +365,17 @@ - + + + +