Forráskód Böngészése

💄 show percentages

jmacura 3 éve
szülő
commit
84c5f559cd
1 módosított fájl, 7 hozzáadás és 1 törlés
  1. 7 1
      src/app/graphs/year-graph/year-graph.component.ts

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

@@ -65,7 +65,6 @@ export class YearGraphComponent {
       .attr('r', 50)
       .attr('stroke', 'black')
       .attr('fill', (d) => {
-        console.log(d);
         return this.sdmDihService.perc2color(d['aggregated']);
       });
     svg
@@ -75,6 +74,13 @@ export class YearGraphComponent {
       .attr('dy', '.35em')
       .text((d) => d['MODEL'])
       .style('text-anchor', 'middle');
+    svg
+      .append('text')
+      .attr('x', 0)
+      .attr('y', 60)
+      .attr('dy', '.35em')
+      .text((d) => `${(Number.parseFloat(d['aggregated']) * 100).toFixed(2)} %`)
+      .style('text-anchor', 'middle');
   }
 
   drawLegend() {