acullen72
acullen72

Reputation: 827

Programmatically change a chart title in highcharts

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.

Upvotes: 49

Views: 48422

Answers (1)

Bhesh Gurung
Bhesh Gurung

Reputation: 51030

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

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

See an example: jsfiddle

See the API Ref.

Upvotes: 101

Related Questions