There is a chart generated in Billboard.js which has the possibility to introduce custom values as minimum and maximum for the Y-axis.
The problem that I encounter is that even the axis is changing when the values are modified, they are not very close to the introduced value.
For example this screenshot:
On the maximum value I don't think it is a great problem. But on the minimum one it is. The default value was 0, after there was introduced 300 I would expect to start from a closer value to it, not 0 as before. The Y-axis just moved few pixels after that change.
The html code:
<input type="number" ng-change="$ctrl.updateY('max')" ng-model="$ctrl.max">
The JS code:
updateY(val) {
if(val=== 'max') {
if(this.max || this.max === 0) {
this.maxValue = this.max;
}
} else {
if(this.min || this.min === 0) {
this.minValue = this.min;
}
}
const maxNumber = Number(this.maxValue);
const minNumber = Number(this.minValue);
this.lineView.chart.axis.range({max: {y: maxNumber}, min: {y: minNumber}});
this.resetY = false;
}
This is the code for max
, same one for min
.
I think that maybe the problem is from range, it doesn't generate the Y-axis with the values introduced.
Any suggestions?