Skip to content

Commit

Permalink
decimals for small values in a bar chart - fixes #648
Browse files Browse the repository at this point in the history
  • Loading branch information
junedchhipa committed Aug 3, 2019
1 parent c0ad570 commit be0a671
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/modules/Formatters.js
Expand Up @@ -68,6 +68,12 @@ class Formatters {
if (w.config.xaxis.type === 'numeric' && w.globals.dataPoints < 50) {
return val.toFixed(1)
}
if (w.globals.isBarHorizontal) {
const range = w.globals.maxY - w.globals.minYArr
if (range < 4) {
return val.toFixed(1)
}
}
return val.toFixed(0)
}
return val
Expand Down

0 comments on commit be0a671

Please sign in to comment.