Skip to content

Commit

Permalink
Merge pull request #821 from frappe/fix_ytd_chart_issues_divide_by_0
Browse files Browse the repository at this point in the history
Fix ytd chart issues divide by 0
  • Loading branch information
Isaac-GC authored Jan 25, 2024
2 parents 7e1de76 + 808116d commit 9c92a4f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Charts/BarChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default {
this.padding +
this.left +
(i * (this.viewBoxWidth - this.left - 2 * this.padding)) /
(this.count - 1)
(this.count - 1 || 1) // The "or" one (1) prevents accidentally dividing by 0
);
},
z() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Charts/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export default {
this.padding +
this.left +
(i * (this.viewBoxWidth - this.left - 2 * this.padding)) /
(this.count - 1)
(this.count - 1 || 1) // The "or" one (1) prevents accidentally dividing by 0
);
},
ys() {
Expand Down

0 comments on commit 9c92a4f

Please sign in to comment.