Billboard.js allows for custom minimum and maximum values to be set for the Y-axis on a generated chart.
An issue I am facing is that when these values are adjusted, the axis does not align closely with the new input values.
Take this screenshot as an example:
https://i.sstatic.net/Yw0kN.png
The maximum value discrepancy may not be a major problem, but it becomes noticeable with the minimum value. Initially set at 0, when changed to 300, one would expect the Y-axis to start at a value closer to it rather than reverting to 0. The shift in the Y-axis position seems minimal after the adjustment.
Here is some of the HTML code used:
<input type="number" ng-change="$ctrl.updateY('max')" ng-model="$ctrl.max">
This snippet shows part of the JavaScript code handling the update:
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 code segment applies to both "max" and "min" updates.
I suspect the issue lies within the range method, which may not accurately reflect the introduced Y-axis values.
Any recommendations for resolving this?