重用jqplot对象来加载或重新绘制数据 [英] reuse jqplot object to load or replot data
问题描述
我正在使用JqPlot图表,我的问题是我想在不同的点击事件上加载不同的数据。
I am using JqPlot for charts , my problem is i want to load different data on different click events.
但是一旦图表被创建并加载了数据首次;我不知道当另一个事件触发时如何加载数据意味着我想重用图表对象并希望在事件被触发时加载/重新绘制数据...
But once the chart is created and loaded with the data for the first time; i don't know then how to load data when another event fires that means i want to reuse the chart object and want to load/replot the data when events get fired something like...
chartObj.data = [graphData]
推荐答案
这似乎适用于重新绘制数据。
That seems to work to replot data.
chartObj.series[0].data = [[0, 4], [1, 7], [2, 3]];
chartObj.replot();
Also, you can check this: https://groups.google.com/group/jqplot-users/browse_thread/thread/59df82899617242b/77fe0972f88aef6d%3Fq%3D%2522Groups.%2BCom%2522%2377fe0972f88aef6d&ei=iGwTS6eaOpW8Qpmqic0O&sa=t&ct=res&cd=71&source=groups&usg=AFQjCNHotAa6Z5CIi_-BGTHr_k766ZXXLQ?hl=en, hope it helps.
这篇关于重用jqplot对象来加载或重新绘制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!