1

I want to use chart.js to plot a real time plot of data being received on the html webapp using websockets with the value received as Y-Axis and reception time (in secs) as X-Axis.

Amit Purohit
  • 11
  • 1
  • 2
  • You should show us some actual code, so that we can help you solve your problem, instead of solving it for you. – asymmetric Dec 08 '15 at 23:56

2 Answers2

0

Well, I assume you know HTML/JavaScript/CSS, websockets, etc to use chart.js in your apps.

Here is a related post that might be of help to get you started.... Chart.js number Y-AXIS label format for many decimal places

You just have to get started somewhere, sometime!!!

Good luck.

Community
  • 1
  • 1
bislinks
  • 84
  • 10
0

Use the addData method.

From the documentation at http://www.chartjs.org/docs/#advanced-usage-prototype-methods

.addData( valuesArray, label )

Calling addData(valuesArray, label) on your Chart instance passing an array of values for each dataset, along with a label for those points.

// The values array passed into addData should be one for each dataset in the chart
myLineChart.addData([40, 60], "August");
// This new data will now animate at the end of the chart.
potatopeelings
  • 40,709
  • 7
  • 95
  • 119