epochjs / epoch

A general purpose, real-time visualization library.
http://epochjs.github.io/epoch
MIT License
4.97k stars 278 forks source link

Question minimal number of values to initiate animation? #229

Closed nssantos closed 8 years ago

nssantos commented 8 years ago

Hello folks, I'm trying to implement the real time bar chart, but I do not have any initial data properly, I'm getting the data through ajax call to json each second, but when I use the .push method to update my chart, nothing happens.

That is my chart: $('#mem-chart').epoch({ type: 'time.bar', axes: ['top', 'right', 'bottom', 'left'], data:[{ label: "Memory", values: [{time: parseInt(new Date().getTime()/1000), y: 78}}]}] });

And here is where a call push method:

$('#mem-chart').push([{time: parseInt(new Date().getTime()/1000), y: data.freeMemory}]);

nssantos commented 8 years ago

The error was beacause I was not using push on the chart variable.