I am having trouble simply changing the y-axis limits from the previous developers’ callback.
$("#simpleGraphs,#detailedGraphs").on('change', '.yRange', function (event) {
var viewindex = event.target.id.split("-")[2];
// This works for this part
views[viewindex].dygraph.updateOptions({
valueRange: [$("#y-min-" + viewindex).val(), $("#y-max-" + viewindex).val()],
}, false);
let currentValueRange = views[viewindex].dygraph.getOption('valueRange');
// This does not work and thus the y-axis limits are not changed
// Previous developers’ comments
// update y range selectors to match the new zoom level The dygraph may actually adjust what we passed in - based on pixels or to make sure all the points are included
// so need to ask it what it actually set, not just what we passed.
let y_min = views[viewindex].dygraph.yAxisRange(0)[0];
let y_max = views[viewindex].dygraph.yAxisRange(0)[1];
y_min = currentValueRange[0];
y_max = currentValueRange[1];
# this works to reset the UX controls
$("#y-min-" + viewindex).val(y_min);
$("#y-max-" + viewindex).val(y_max);
});
I have tried about 20 ideas, both mine and A.I.-suggested.
The y-axis limits did not change.
Any ideas would be appreciated.
New contributor
keesh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.