Open AtifJaved1 opened 6 years ago
i try use chartjs-plugin-streaming with this, but it Failed. i think you can imitate background chart on examples, look this code. if you are using a server to push data to the chart like websocket, careful the update interval!
I have used the chartjs-plugin-streaming and its working fine now. Let me know if you need nay help as well
On Wed, 7 Mar 2018 at 12:43 PM, xiaoyao9184 notifications@github.com wrote:
i try use chartjs-plugin-streaming https://github.com/nagix/chartjs-plugin-streaming with this, but it Failed. i think you can imitate background chart on examples http://jtblin.github.io/angular-chart.js/, look this code https://github.com/jtblin/angular-chart.js/blob/fc4e9a278e99fb1b6e605cdcfb037f47947e538e/examples/app.js#L253 . if you are using a server to push data to the chart like websocket, careful the update interval!
— You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/jtblin/angular-chart.js/issues/685#issuecomment-371051677, or mute the thread https://github.com/notifications/unsubscribe-auth/AZXafAOs5U45x49blh1DAN_OS7ezvfvFks5tb4-wgaJpZM4SSCwf .
-- Regards By Atif Javed
@AtifJaved1 yes, i need help.
i use 'chart-data' binding streaming data, and i push streaming data to this, the chart is completely redrawn, then it throw
Uncaught TypeError: Cannot read property 'clearRect' of null
if i dont use 'chart-data', the chart not be generated.
so, i just use chart.js and chartjs-plugin-streaming without angular-chart.js
@xiaoyao9184 This is a sample of angular-chart.js + chartjs-plugin-streaming with chart-data
:
https://jsfiddle.net/nagix/an1zpcsa/
If you have any question, please let me know.
@AtifJaved1 I am using chartjs-plugin-streaming in angular 6, but steaming is not happening. Can you please help me here. Do we need to import chartjs-plugin-streaming in .ts file?
@ramyakchina, yes you need to import. Let me send you the code of the component.
Import them like this in the component
/ Chart-js With Streaming Settings/ import * as Chart from "chart.js"; import moment = require("moment"); import realTimeScale from "chartjs-plugin-streaming/src/scales/scale.realtime.js"; import streamingPlugin from 'chartjs-plugin-streaming/src/plugins/plugin.streaming';
realTimeScale(Chart, moment); var plugin = streamingPlugin(Chart); Chart.plugins.register(plugin); export default plugin;
/**/
Let me know if you still need help.
Sorry, I will try to setup to jfiddle as soon as I get free from work.
Meanwhile, Can you please share the error you are facing?
On Thu, Jun 7, 2018 at 6:58 AM Ramya notifications@github.com wrote:
I am still facing the same issue. Can you please share working jfiddle/ codepen?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jtblin/angular-chart.js/issues/685#issuecomment-395268442, or mute the thread https://github.com/notifications/unsubscribe-auth/AZXafDe_WXPoD5qBimmKnKbO9_LDHKzEks5t6IjbgaJpZM4SSCwf .
-- Regards By Atif Javed
@AtifJaved1 I am not getting errors in the console. But, Streaming is not happening.
@ramyakchina , Please the code of your component.
Does it support the real-time chart updates as well? What if I want to update the chart in real time by the values received by the server after every time interval.