Skip to content

Commit 95bf41a

Browse files
committed
fix issue where yAxis doesn't rescale correctly when zoomed in
1 parent 216e830 commit 95bf41a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

components/Charts/PowerEnergyChart.vue

+6-8
Original file line numberDiff line numberDiff line change
@@ -832,17 +832,16 @@ export default {
832832
let total = 0
833833
834834
this.powerEnergyDomains.forEach((domain) => {
835-
total += d[domain.id] || 0
835+
const value = d[domain.id] || 0
836+
total += value < 0 ? value : 0
836837
})
837838
838839
if (total < lowest) {
839840
lowest = total
840841
}
841842
})
842843
843-
console.log('computedGrowthYMin', lowest)
844-
845-
return lowest < -10000 ? lowest * 2 : lowest * 1.1
844+
return lowest
846845
},
847846
848847
computedGrowthYMax() {
@@ -860,17 +859,16 @@ export default {
860859
filteredDataset.forEach((d) => {
861860
let total = 0
862861
this.powerEnergyDomains.forEach((domain) => {
863-
total += d[domain.id] || 0
862+
const value = d[domain.id] || 0
863+
total += value > 0 ? value : 0
864864
})
865865
866866
if (total > highest) {
867867
highest = total
868868
}
869869
})
870870
871-
console.log('computedGrowthYMax', highest)
872-
873-
return highest < 10000 ? highest * 2 : highest * 1.1
871+
return highest
874872
},
875873
876874
computedYMin() {

0 commit comments

Comments
 (0)