Skip to content

Instantly share code, notes, and snippets.

@kylelix7
Last active November 4, 2019 06:28
Show Gist options
  • Save kylelix7/91c6ccfcce6b6b8ae2f5cd62ccae8236 to your computer and use it in GitHub Desktop.
Save kylelix7/91c6ccfcce6b6b8ae2f5cd62ccae8236 to your computer and use it in GitHub Desktop.
chart.component.ts
import { Component } from '@angular/core';
import { StockDataService } from '../stock-data.service';
import { HistoricalData } from '../models';
import { Observable} from 'rxjs';
@Component({
selector: 'app-chart',
templateUrl: './chart.component.html',
styleUrls: ['./chart.component.css']
})
export class ChartComponent {
historicalData: Observable<HistoricalData[]> = this.stockDataService.historicalData;
single: any[];
multi: any[];
view: any[] = [800, 360];
// options
showXAxis = true;
showYAxis = true;
gradient = false;
showLegend = true;
showXAxisLabel = true;
xAxisLabel = 'Time';
showYAxisLabel = true;
yAxisLabel = 'Population';
colorScheme = {
domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA']
};
constructor(private stockDataService: StockDataService) {
this.single = this.stockDataService.getStaticData();
}
public onSelect(event): void {
}
public onRefresh(): void {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment