admin管理员组文章数量:1418659
Right now I'm using plot.ly javascript library to visualise an array of numbers. I want to update this plot in every iteration. I tried to Plotly.newPlot('id',data);
after values changed, however it takes time to re-define plot object every time.
I went through plot.ly documentation yet did not find a solution for my case.
I want to update graph in every interruption, maybe I need to update plot more 200 times after calling iterating function. Any solutions/suggestions for this problem? I can use another plotting library if there is one fits for this case.
Right now I'm using plot.ly javascript library to visualise an array of numbers. I want to update this plot in every iteration. I tried to Plotly.newPlot('id',data);
after values changed, however it takes time to re-define plot object every time.
I went through plot.ly documentation yet did not find a solution for my case.
I want to update graph in every interruption, maybe I need to update plot more 200 times after calling iterating function. Any solutions/suggestions for this problem? I can use another plotting library if there is one fits for this case.
Share Improve this question asked Dec 17, 2015 at 21:58 Bedi EgilmezBedi Egilmez 1,5523 gold badges18 silver badges27 bronze badges2 Answers
Reset to default 6Try Plotly.extendTraces
Unfortunately no official examples are available at the moment.
I'd remend:
- looking the source code here, and
- the test cases here.
Bedi, unfortunately, I cannot respond to your ment directly. I don't have enough points (I need 50 and I have 15). Plotly.extendTraces()
is what you need. The error you've noted is because update.y
needs to be an array with a length equal to that of the indices
argument to Plotly.extendTraces()
. Looking at the source, indices is the third argument to the extendTraces
. Your indices
argument is only one item long ([0].length === 1
). As long as itemList
is an array of length 1 you should not be having a problem. Run console.log(itemList.length === [0].length)
and I think you'll discover that you're trying to add too many points at once to your trace.
本文标签: bar chartVisualising data with javascript graphsdynamicallyStack Overflow
版权声明:本文标题:bar chart - Visualising data with javascript graphs - dynamically - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745295162a2652031.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论