I am drawing my graph,
Data.chart.series[0].remove();
Data.chart.xAxis[0].axisTitle.attr({ text: xAxisTitle});
//Data.chart.xAxis[0].categories = xAxisCategories;
Data.chart.addSeries({
name: yAxisTitle,
data: formattedData,
pointInterval: pointInterval
});
Data.chart.redraw();
I simply can't see anything in the documentation for changing the xAxis categories, is this possible? I couldn't see anything 4 changing the title, but managed to get a snippet online, I really need to avoid destroying & recreating the graph.
You can do this with the setCategories
method found on the Axis object. See the reference documentation for axis here: http://www.highcharts.com/ref/#axis-object
Example: http://jsfiddle.net/4tuvC/
Since Highcharts 5.0.0 you can use the update() function to update the chart options after render time:
Data.chart.xAxis[0].update({categories: xAxisCategories});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With