如何使用JavaScript动态更改Highcharts中的数据点 [英] How do I dynamically change a data point in Highcharts using JavaScript
本文介绍了如何使用JavaScript动态更改Highcharts中的数据点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图改变现有系列中的一个点。从查看API,我一直在尝试以下内容:
chart.series [0] .data [0]。 y = 43;
chart.redraw();
我确定我错过了一些简单的东西,但我无法弄清楚。感谢您的帮助。
解决方案
您不能只设置值。 chart.series [0] .data [0]返回一个点对象,然后您可以使用它的'update'方法更改它的值。
chart.series [0] .data [0] .update(y + = 10);
I'm trying to change a point in an existing series. From looking at the API, I've been trying the following:
chart.series[0].data[0].y = 43;
chart.redraw();
I'm sure I'm missing something simple but I can't figure it out. Thanks for your help.
解决方案
You can't just set the value. chart.series[0].data[0] returns a point object, which you can then use it's 'update' method to change it's values.
chart.series[0].data[0].update(y += 10);
You can see an example here: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/members/point-update-column/
这篇关于如何使用JavaScript动态更改Highcharts中的数据点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文