@sampi it doesn't work for streaming plots yet. The streaming data is ephemeral and not saved in our database. We grab data from the database when making an image.
the data events are not recorded at this time (only the data points in the window are saved when you hit 'save' or use the stream token for another plot). Though this is something that Plotly would like to do in the future.
Thank a lot ! I got this to work on my project but I was wondering if there is a way to save the data to a specific file. can we add a filename parameter to the "config.json" file or within the code so that it write and saves the data to that file?
data: any = [this.trace1, this.trace2];
layout = {
title: 'Click Here to Edit Chart Title'};
constructor(private zone: NgZone) { }
ngAfterViewInit() {
debugger;
/**
* On the first run, plot the graph after view has been initialized('div' exists)
* After that, all subsequent plot changes should be handled by OnChanges hook
*/
this.update();
this.viewInitialized = true;
}
ngOnChanges(changes: SimpleChanges) {
if (this.viewInitialized)
this.update();
}
update() {
/**
* Plot the graph outside change detection
* TODO :: Investigate bubbling up chart events for future scaling
* TODO :: Try adding animations on update...
*/
this.zone.runOutsideAngular(() => {
Plotly.newPlot('myDiv', this.data, this.layout, { editable: true });
});
}
}
when I am running this , getting an error ERROR ReferenceError: Plotly is not defined
at eval (plot.component.ts:90)
can beaglebone black do exacly same like this?
@sampi it doesn't work for streaming plots yet. The streaming data is ephemeral and not saved in our database. We grab data from the database when making an image.
THIS IS JUST FANTASTIC!!! I hope to learn this in order to plot temperature readings!
Why doesn't download image work?
sensors|grep +|tr °C " "|awk -F+ '{print $2}'|awk '{print $1}'|plotly
the data events are not recorded at this time (only the data points in the window are saved when you hit 'save' or use the stream token for another plot). Though this is something that Plotly would like to do in the future.
I noticed that the data tab is empty/blank. Are the data points not recorded? Is only the graph plotted?
Thank a lot ! I got this to work on my project but I was wondering if there is a way to save the data to a specific file. can we add a filename parameter to the "config.json" file or within the code so that it write and saves the data to that file?
Streaming is only from Plotly servers? What if my data is held say in AWS ec2 etc?
is it dead?
Are these single data entry type or all the data can be updated at once? I m looking for refreshing data all at once
Trying to use plotly.js in angular4. My code is as mentioned below.
import { Component, Input, AfterViewInit, NgZone, ChangeDetectionStrategy, SimpleChanges } from '@angular/core'; import { Subscription } from 'rxjs/Subscription'; import { Observable } from 'rxjs/Observable';
declare var Plotly: any;
/**
@Component({ selector: 'tmh-plot', template: `
<div id="myDiv" style="width:100%;"></div>`, changeDetection: ChangeDetectionStrategy.OnPush })export class PlotlyComponent implements AfterViewInit { //@Input() name: string; //@Input() data: any[]; //@Input() layout: Partial<IPlotLayout>; //@Input() options: any;
};
trace2: any = { x: [1, 2, 3, 4, 5], y: [4, 0, 4, 6, 8], mode: 'lines+markers', type: 'scatter' };
data: any = [this.trace1, this.trace2]; layout = { title: 'Click Here to Edit Chart Title'};
}
when I am running this , getting an error ERROR ReferenceError: Plotly is not defined at eval (plot.component.ts:90)
Please help.
Trying to use plotly.js in angular4. My code is as mentioned below.
import { Component, Input, AfterViewInit, NgZone, ChangeDetectionStrategy, SimpleChanges } from '@angular/core'; import { Subscription } from 'rxjs/Subscription'; import { Observable } from 'rxjs/Observable';
declare var Plotly: any;
/**
@Component({ selector: 'tmh-plot', template: `
<div id="myDiv" style="width:100%;"></div>`, changeDetection: ChangeDetectionStrategy.OnPush })export class PlotlyComponent implements AfterViewInit { //@Input() name: string; //@Input() data: any[]; //@Input() layout: Partial<IPlotLayout>; //@Input() options: any;
//is the view initialized for plotly.js to take action viewInitialized: boolean = false;
trace1: any = { x: [0, 1, 2, 3, 4], y: [1, 5, 3, 7, 5], mode: 'lines+markers', type: 'scatter' };
trace2: any = { x: [1, 2, 3, 4, 5], y: [4, 0, 4, 6, 8], mode: 'lines+markers', type: 'scatter' };
data: any = [this.trace1, this.trace2]; layout = { title: 'Click Here to Edit Chart Title'};
constructor(private zone: NgZone) { }
ngAfterViewInit() { debugger; /**
ngOnChanges(changes: SimpleChanges) { if (this.viewInitialized) this.update(); }
update() { /**
this.zone.runOutsideAngular(() => { Plotly.newPlot('myDiv', this.data, this.layout, { editable: true }); }); } }
when I am running this , getting an error ERROR ReferenceError: Plotly is not defined at eval (plot.component.ts:90)
Please help.