Skip to content

Commit

Permalink
Merge branch 'data-quality' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
devincowan committed Jul 12, 2024
2 parents b9e890b + e6418e8 commit 11732cf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
9 changes: 8 additions & 1 deletion frontend/src/components/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,14 @@ const options = {
}
label += ` ${selectedVariable.unit}`
return label;
}
},
footer: function (context) {
const dataQualityOption = chartStore.dataQualityOptions.find((option) => option.value == context[0]?.raw?.reach_q)
if (dataQualityOption) {
return `\n Data Quality: ${dataQualityOption.label}`
}
return ''
},
},
displayColors: false,
}
Expand Down
16 changes: 13 additions & 3 deletions frontend/src/components/NodeChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ import { mdiDownloadBox, mdiFileDelimited, mdiCodeJson, mdiMagnifyMinusOutline,
import { downloadMultiNodesCsv, downloadMultiNodesJson } from '../_helpers/hydroCron';
import { useDisplay } from 'vuetify'
import TimeRangeSlider from '@/components/TimeRangeSlider.vue'
import { useChartsStore } from '@/stores/charts';
const { lgAndUp } = useDisplay()
const chartStore = useChartsStore()
const props = defineProps({ data: Object, chosenVariable: Object })
const line = ref(null)
const downloading = ref({ csv: false, json: false, chart: false })
Expand Down Expand Up @@ -114,6 +117,9 @@ const options = {
tooltip: {
// https://www.chartjs.org/docs/latest/configuration/tooltip.html
callbacks: {
title: function (context) {
return `Distance: ${context[0].parsed.x} m`
},
label: function (context) {
// var label = context.dataset.label || '';
let selectedVariable = props.chosenVariable
Expand All @@ -129,9 +135,13 @@ const options = {
// add the timestamp as well
return label;
},
title: function (context) {
return `Distance: ${context[0].parsed.x} m`
},
footer: function (context) {
const dataQualityOption = chartStore.dataQualityOptions.find((option) => option.value == context[0]?.raw?.node_q)
if (dataQualityOption) {
return `\n Data Quality: ${dataQualityOption.label}`
}
return ''
}
},
displayColors: false,
},
Expand Down

0 comments on commit 11732cf

Please sign in to comment.