admin管理员组文章数量:1312741
High Charts API .setData()
javascript
....
$('#button').click(function() {
chart.series[0].setData( //How can I use this method to add the data?
['Firefox', 55.0],
['IE', 16.8],
['Safari', 7.5],
['Opera', 7.2],
['Others', 0.7]
);
See full code and example on jfiddle /
High Charts API http://api.highcharts./highcharts#Series.setData()
javascript
....
$('#button').click(function() {
chart.series[0].setData( //How can I use this method to add the data?
['Firefox', 55.0],
['IE', 16.8],
['Safari', 7.5],
['Opera', 7.2],
['Others', 0.7]
);
See full code and example on jfiddle http://jsfiddle/bK7fh/
Share Improve this question asked Jan 19, 2013 at 18:47 user1530249user1530249 1,0573 gold badges19 silver badges29 bronze badges1 Answer
Reset to default 6You forgot that set data takes an array of data, not lots of arrays.
Here is an example:
$('#button').click(function () {
chart.series[0].setData([
['Firefox', 55.0],
['IE', 16.8],
['Safari', 7.5],
['Opera', 7.2],
['Others', 0.7]
]);
});
Here is your fiddle, and working: http://jsfiddle/bK7fh/2/
本文标签: javascriptUsing HighCharts setData for multiple variablesStack Overflow
版权声明:本文标题:javascript - Using HighCharts setData for multiple variables? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741890998a2403301.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论