From 2db6dafa0b2d56c833bc61b4a3c702fff1eb348d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20V=C3=A9lez=20Palacios?= Date: Wed, 18 May 2016 13:15:07 +0200 Subject: [PATCH] new dashboard progress --- .../controller/DashboardController.java | 10 +- .../es/kauron/estraba/fxml/Dashboard.fxml | 379 +++++++++++++++++- 2 files changed, 379 insertions(+), 10 deletions(-) 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 @@ - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + -