new feature support: stream chart
Hi there,
I'm working on a dashboard project and find that react-chartjs does not support stream chart which chart.js does by addData() and removeData(). So I just added couple lines into react-chartjs core.js to support this feature. I've tested changes on dev environment and it just works.
The component jsx looks like this:
<LineChart data={this.state.chartData} options={this.state.chartOptions} width={500} height={200} stream />
The nextPoints is a json object under chartData with values and label like this (2-lines in example):
chartData: {
labels: [...],
datasets: [{
...
}, {
...
}],
nextPoints: {
values: [<val1>, <val2>],
label: <newLabel>
}
}
I really appreciate it if you can take a quick review.
Thanks, Kevin