From bd44c5608a36c9246214f86c8bbd6c718fa7c4cd Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Tue, 19 Jan 2021 21:30:25 +0100 Subject: [PATCH] bugfix: change colors and put lines in the front of the temp chart Signed-off-by: Stefan Dej --- src/components/charts/TempChart.vue | 11 ++++++++++- src/store/printer/tempHistory/mutations.js | 2 +- src/store/variables.js | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/components/charts/TempChart.vue b/src/components/charts/TempChart.vue index 2ed81787..46b607cf 100644 --- a/src/components/charts/TempChart.vue +++ b/src/components/charts/TempChart.vue @@ -49,7 +49,16 @@ export default { computed: { datasets: { get () { - return this.$store.state.printer.tempHistory.datasets + const datasets = this.$store.state.printer.tempHistory.datasets + + return datasets.sort((a,b) => { + if ('name' in a && 'name' in b) { + if (a.name.endsWith("_target") > b.name.endsWith("_target")) return -1 + if (a.name.endsWith("_target") < b.name.endsWith("_target")) return 1 + } + + return 0 + }) } }, maxTemp: { diff --git a/src/store/printer/tempHistory/mutations.js b/src/store/printer/tempHistory/mutations.js index e43e6b41..7dc072aa 100644 --- a/src/store/printer/tempHistory/mutations.js +++ b/src/store/printer/tempHistory/mutations.js @@ -63,7 +63,7 @@ export default { dataPoints:[], showInLegend: false, markerType: 'none', - fillOpacity: .3, + fillOpacity: .1, lineThickness: 0, toolTipContent: "{name}: {y}°C", color: masterDataset.color || '#666' diff --git a/src/store/variables.js b/src/store/variables.js index 592f76fc..27bcdbcd 100644 --- a/src/store/variables.js +++ b/src/store/variables.js @@ -1,9 +1,9 @@ export const colorArray = [ '#F44336', - '#9C27B0', - '#673AB7', + '#8e379d', + '#03DAC5', '#3F51B5', - '#00BCD4', + '#ffde03', '#009688', '#E91E63', ]