Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getHistoryData() {
- this.generatePayload()
- this.historyDataService
- .getHistoryData(this.payload)
- .subscribe(
- (data: any) => {
- const responeData: any = data.dataPoints;
- this.timestampArray = responeData.map(e => e.date.slice(5, 10) + ' ' + e.timestamp.slice(0, 5));
- console.log('temp array' + this.temperatureArray)
- this.temperatureArray = responeData.map(e => e.parameter1 / 100);
- this.dateArray = responeData.map(e => e.date);
- },
- )
- }
- other function is :
- updateChartData(){
- console.log('in update chart data')
- console.log('temp values' + this.temperatureArray)
- this.chartData[0].data = this.temperatureArray
- this.labels = this.timestampArray
- }
- getHistoryData() {
- this.generatePayload()
- this.historyDataService
- .getHistoryData(this.payload)
- .subscribe(
- (data: any) => {
- updateChartData();
- },
- )
- }
- getHistoryData() {
- this.generatePayload()
- this.historyDataService
- .getHistoryData(this.payload)
- .subscribe(
- (data: any) => {}
- .switchMap((data) => {
- updateChartData();
- })
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement