Skip to content

Commit

Permalink
more chart label research
Browse files Browse the repository at this point in the history
  • Loading branch information
solderq35 committed Dec 20, 2023
1 parent 2963856 commit d67c1bb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/view/modals/edit_card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export default {
}
const charts = this.$store.getters[blockPath + '/charts']
console.log(charts)
for (let index in this.form.sets) {
if (index < charts.length) {
Expand Down
12 changes: 12 additions & 0 deletions src/store/block_modifiers/building_compare.mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,20 @@ export default class CompareModifier {
module is block module, data is new incoming
data.
*/
console.log(this.data.buildingIds)
console.log(data.datasets)
if (this.data.buildingIds[0]) {
data.datasets[0].label = this.buildingName(store, this.data.buildingIds[0])
}
// along with the section in edit_card.vue, this also controls how the chart name is updated.
// comment it out for now just in case
/*
for (let i = 0; i < data.datasets.length;) {
if (this.data.buildingIds[i]) {
data.datasets[i].label = this.buildingName(store, this.data.buildingIds[i])
i += 1
}
}
*/
}
}
4 changes: 4 additions & 0 deletions src/store/chart.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ const actions = {

// Grab the default value. Building page URL = `http://localhost:8080/#/compare/["16","29"] > building 16 is default
// Need a better way of doing this in future

// As noted in edit_card.vue line 371 ish, the chart name will change after editing the timeframe via the edit card
// web UI component. So we need a better way of distinguishing charts from each other, or rework how the rename
// system works.
if (store.getters.name === 'Total Electricity') {
reqPayload.dateStart = nov
reqPayload.dateEnd = dec
Expand Down

0 comments on commit d67c1bb

Please sign in to comment.