How to change the direction of dynamic chart.


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Peter C. on 7th September 2016
I would like to use www.rgraph.net/demos/line-dynamic-last-10-minutes.html however I would like it to go the other way like www.rgraph.net/demos/line-dynamic-scrolling-dual-canvas.html does. how can I change this?
  

thank you for your time!!
Peter.
Posted by Richard on 7th September 2016
Hi there,

Well the key bit is where it uses unshift() and pop() to add a number to the front of the data. You could change this to use the shift() and push() functions instead to add an element to the end of the array instead (other changes may be necessary).

There are examples of a line scrolling in the opposite direction here (you could take this code instead and change the configuration to change the appearance):

www.rgraph.net/demos/line-dynamic-scrolling.html
www.rgraph.net/demos/line-dynamic-updates.html




Richard

Add a reply

 




« Back to message list
RGraph on social media