
|
[JS]
function SetYAxisMinTo5() {
var chart = $('#container').ejChart('instance');
chart.model.primaryYAxis.range.min = 5; //This doesn't work?
chart.model.primaryYAxis.setRange = true;
chart.model.primaryYAxis.labelFormat = "{value} set to min 5?"
$('#container').ejChart('redraw');
}
function SetYAxisMinTo10() {
var chart = $('#container').ejChart('instance');
chart.model.primaryYAxis.setRange = true;
chart.model.primaryYAxis.range.min = 10; //This doesn't work?
chart.model.primaryYAxis.labelFormat = "{value} set to min 10?"
$('#container').ejChart('redraw');
}
|
Thank you! This helps.
My next question is: After setting the range.min/max to a certain value, how can I reset the primaryYAxis so that it is redrawn and looks like before?
I think I have to set the primaryYAxis.range.min/max to their default value which is null (I think). This works partly but the axis range is padded to the min and max values of the given values.
Attached, again, an example.
Initially, I have a padding that sets min to 0 and max to 16.

SetYAxisMinTo10MaxTo12()/SetYAxisMinTo2() successfully change the ranges.
UpdateChart() should reset to the initial values (based on given rangePadding) of 0(min) .. 16(max) but sets it to 2/15.
