Programmatically change a chart title in highcharts

acullen72 picture acullen72 · Oct 26, 2011 · Viewed 42.3k times · Source

I have a simple column chart that I update via AJAX, and all is working fine except I cannot change the actual title of the chart when I'm updating the data.

I've tried the obvious -

chart.title="new title";
//and
chart.title.text="New title";

etc. - to no avail, and have had no success finding a solution online.

Any help will be greatly appreciated.

Answer

Bhesh Gurung picture Bhesh Gurung · Oct 26, 2011

You can use setTitle(titleObj, subTitleObj) for that.

chart.setTitle({text: "New Title"});

See an example: jsfiddle

See the API Ref.