From 282942a89337f813a3a289b12dff6ea57b9200ef Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Tue, 25 Sep 2018 13:37:09 +0100 Subject: [PATCH] Changed chart line colours. --- .../neviyn/Observations/api/AverageStatsChartJs.java | 12 ++++++------ .../Observations/resources/ObservationResource.java | 2 ++ frontend/src/views/Stats.vue | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/main/java/uk/co/neviyn/Observations/api/AverageStatsChartJs.java b/backend/src/main/java/uk/co/neviyn/Observations/api/AverageStatsChartJs.java index 96d82fa..ec74294 100644 --- a/backend/src/main/java/uk/co/neviyn/Observations/api/AverageStatsChartJs.java +++ b/backend/src/main/java/uk/co/neviyn/Observations/api/AverageStatsChartJs.java @@ -35,11 +35,11 @@ public class AverageStatsChartJs { teamwork.add(averageStats.getTeamwork()); knowledge.add(averageStats.getKnowledge()); } - datasets.add(new Dataset("Monitoring", "", monitoring)); - datasets.add(new Dataset("Control", "", control)); - datasets.add(new Dataset("Conservatism", "", conservatism)); - datasets.add(new Dataset("Teamwork", "", teamwork)); - datasets.add(new Dataset("Knowledge", "", knowledge)); + datasets.add(new Dataset("Monitoring", "#F90", monitoring)); + datasets.add(new Dataset("Control", "#3F0", control)); + datasets.add(new Dataset("Conservatism", "#33F", conservatism)); + datasets.add(new Dataset("Teamwork", "#FF0", teamwork)); + datasets.add(new Dataset("Knowledge", "#000", knowledge)); } @AllArgsConstructor @@ -50,7 +50,7 @@ public class AverageStatsChartJs { @NonNull @JsonProperty - private final String borderColor; + private final String backgroundColor; @NonNull @JsonProperty diff --git a/backend/src/main/java/uk/co/neviyn/Observations/resources/ObservationResource.java b/backend/src/main/java/uk/co/neviyn/Observations/resources/ObservationResource.java index b920649..7900c13 100644 --- a/backend/src/main/java/uk/co/neviyn/Observations/resources/ObservationResource.java +++ b/backend/src/main/java/uk/co/neviyn/Observations/resources/ObservationResource.java @@ -67,6 +67,7 @@ public class ObservationResource { @Path("/average/all/chartjs") @GET + @UnitOfWork public AverageStatsChartJs averageStatsChartJs() { return new AverageStatsChartJs(averageObservationScores()); } @@ -81,6 +82,7 @@ public class ObservationResource { @Path("/average/{id}/chartjs") @GET + @UnitOfWork public AverageStatsChartJs averageObservationScoresForSiteChartJs(@PathParam("id") long siteId) { return new AverageStatsChartJs(averageObservationScoresForSite(siteId)); } diff --git a/frontend/src/views/Stats.vue b/frontend/src/views/Stats.vue index 279558c..164b8de 100644 --- a/frontend/src/views/Stats.vue +++ b/frontend/src/views/Stats.vue @@ -32,7 +32,7 @@ export default { methods: { getAllTimeAverage: function() { Vue.axios - .get("/api/average/all/chartjs") + .get("/api/observation/average/all/chartjs") .then(response => { this.chartData = response.data; })