|
|
@@ -5,7 +5,8 @@ import {SdmDihService} from '../sdm-dih.service';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'year-graph',
|
|
|
- templateUrl: 'year-graph.component.html',
|
|
|
+ templateUrl: './year-graph.component.html',
|
|
|
+ styleUrls: ['./year-graph.component.scss'],
|
|
|
})
|
|
|
export class YearGraphComponent {
|
|
|
firstYear: string;
|
|
|
@@ -36,7 +37,10 @@ export class YearGraphComponent {
|
|
|
}
|
|
|
|
|
|
drawGraph(region: string) {
|
|
|
- const regionData = this.sdmDihService.sdmData[this.selectedYear].find(
|
|
|
+ const year = this.selectedYear.toString().includes('.')
|
|
|
+ ? this.selectedYear
|
|
|
+ : this.selectedYear + '.0';
|
|
|
+ const regionData = this.sdmDihService.sdmData[year].find(
|
|
|
(row) => row['MODEL'] === region
|
|
|
);
|
|
|
const width = 100 / this.regions.length;
|