diff --git a/src/main/java/es/kauron/estraba/controller/DashboardController.java b/src/main/java/es/kauron/estraba/controller/DashboardController.java index 336475d..90ab116 100644 --- a/src/main/java/es/kauron/estraba/controller/DashboardController.java +++ b/src/main/java/es/kauron/estraba/controller/DashboardController.java @@ -13,6 +13,7 @@ import javafx.fxml.Initializable; import javafx.scene.chart.AreaChart; import javafx.scene.chart.LineChart; import javafx.scene.chart.PieChart; +import javafx.scene.chart.XYChart; import javafx.scene.control.Label; import javafx.scene.control.Tab; import javafx.scene.image.Image; @@ -125,10 +126,17 @@ public class DashboardController implements Initializable { // populate charts ObservableList chunks = trackData.getChunks(); + XYChart.Series elevationChartData = new XYChart.Series<>(); + XYChart.Series speedChartData = new XYChart.Series<>(); + XYChart.Series hrChartData = new XYChart.Series<>(); + XYChart.Series cadenceChartData = new XYChart.Series<>(); double lastDistance = Double.MIN_VALUE; - for (Chunk chunk : chunks) { + for (int i = 0; i < chunks.size(); i++) { + //map //elevationChart (range min-max+10) + elevationChartData.getData().add(new XYChart.Data<>(chunk.getDistance(), chunk.getAscent())); //speedChart (range 0-max+10) + speedChartData.getData().add(new XYChart.Data<>(chunk.getDistance(), chunk.getAscent())); //hrChart (range 30-200) //cadenceChart (range 0-200 (rollapalluza)) } diff --git a/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml b/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml index e903d24..8c707b5 100644 --- a/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml +++ b/src/main/resources/es/kauron/estraba/fxml/Dashboard.fxml @@ -4,6 +4,7 @@ + @@ -12,6 +13,7 @@ + @@ -28,20 +30,379 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + -