Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

new feature support: stream chart #162

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

new feature support: stream chart #162

wants to merge 5 commits into from

Conversation

yuqkevin
Copy link

@yuqkevin yuqkevin commented Nov 23, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant