I have a StackedBarChart which shows serveral values per day. Now i want to switch the view from absolute values to relative values. Therefore i need to change the valueAxis properties like
valueAxis.min = 0;
valueAxis.max = 100;
valueAxis.strictMinMax = true;
valueAxis.calculateTotals = true;
valueAxis.renderer.minWidth = 50;
But how can i get the valueAxis from an existing chart object?
You can access your axis object by accessing it from the xAxes
or yAxes
list, depending on where you assigned the object to, and use getIndex
or loop through them using each
if you have multiple axes you want to update.
// assuming you have one value axis on the y axis:
var valueAxis = chart.yAxes.getIndex(0);
// make updates to the variable
// if you have multiple value axes:
chart.yAxes.each(function(valueAxis) {
// make changes to each axis object
});