jmacura пре 3 година
родитељ
комит
694a3a9155
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      src/app/graphs/year-graph/year-graph.component.ts

+ 2 - 1
src/app/graphs/year-graph/year-graph.component.ts

@@ -30,6 +30,7 @@ export class YearGraphComponent implements OnInit {
   ngOnInit() {}
 
   drawGraph(region: string) {
+    const regionData = this.sdmDihService.aggregatedData[this.selectedYear].find((row) => row['MODEL'] === region);
     const width = 200;
     const height = 200;
     //select("#year-graph-place").select("svg")?.remove();
@@ -39,7 +40,7 @@ export class YearGraphComponent implements OnInit {
       .attr("width", width)
       .attr("height", height)
       .append("g")
-      .data(this.sdmDihService.aggregatedData[this.selectedYear])
+      .data([regionData])
       .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")");
     //const yearData = this.sdmDihService.aggregatedData[this.selectedYear];
     //const color = `rgba(100, 200, 100, ${yearData[0]['Natural_Capital']})`;