- remove d3.js and add chart.js
- add extra chartjs.module - add extra diagram-view component for binding properties to chartjs chart
This commit is contained in:
parent
92d0e94582
commit
5f657dc9e4
18 changed files with 265 additions and 1330 deletions
61
src/app/views/diagram-view/diagram-view.component.ts
Normal file
61
src/app/views/diagram-view/diagram-view.component.ts
Normal file
|
@ -0,0 +1,61 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
// import * as d3 from 'd3';
|
||||
|
||||
import { DatasetService } from '../../services/dataset.service';
|
||||
import { AppRouterService } from '../../services/app-router.service';
|
||||
import { GeomonTimeseries, GeomonDataset } from '../../../shared/models/dataset';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bar',
|
||||
templateUrl: './diagram-view.component.html',
|
||||
styleUrls: ['./diagram-view.component.css']
|
||||
})
|
||||
export class DiagramViewComponent implements OnInit {
|
||||
|
||||
public datasetIds: string[] = [];
|
||||
|
||||
public selectedIds: string[] = [];
|
||||
|
||||
public datasetOptions: Map<string, GeomonTimeseries> = new Map();
|
||||
|
||||
public diagramLoading: boolean;
|
||||
public overviewLoading: boolean;
|
||||
|
||||
// public diagramConfig: DiagramConfig = {
|
||||
// overviewVisible: true,
|
||||
// yaxisVisible: this.d3diagramOptions.yaxis,
|
||||
// yaxisModifier: true,
|
||||
// hoverstyle: this.d3diagramOptions.hoverStyle
|
||||
// };
|
||||
|
||||
constructor(
|
||||
public datasetService: DatasetService<GeomonTimeseries>,
|
||||
public appRouter: AppRouterService,) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
// this.createSvg();
|
||||
// this.drawBars(this.data);
|
||||
|
||||
this.setDatasets();
|
||||
}
|
||||
|
||||
private setDatasets() {
|
||||
this.datasetIds = this.datasetService.datasetIds;
|
||||
this.datasetOptions = this.datasetService.datasetService;
|
||||
}
|
||||
|
||||
public clearSelection() {
|
||||
this.selectedIds = [];
|
||||
}
|
||||
|
||||
public removeAllTimeseries() {
|
||||
this.datasetService.removeAllDatasets();
|
||||
}
|
||||
|
||||
public deleteTimeseries(internalId: string) {
|
||||
this.datasetService.removeDataset(internalId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue