以编程方式更改高图中的图表标题 [英] Programmatically change a chart title in highcharts

查看:139
本文介绍了以编程方式更改高图中的图表标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的柱状图,通过AJAX进行更新,并且所有工作都很好,除非我在更新数据时无法更改图表的实际标题。



我已经尝试了明显的 -

  chart.title =新标题; 
//和
chart.title.text =新标题;

等。 - 无济于事,在网上找到解决方案并没有成功。



任何帮助都将不胜感激。 您可以使用 setTitle(titleObj,subTitleObj)

  chart.setTitle {text:New Title}); 

查看示例: jsfiddle

请参阅 API参考资料


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.

解决方案

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

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

See an example: jsfiddle

See the API Ref.

这篇关于以编程方式更改高图中的图表标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆