jplemieux66 / angular-d3-responsive

https://medium.com/@jeanphilippelemieux/creating-a-responsive-graph-with-angular-and-d3-b45bb8065588
10 stars 13 forks source link

SCSS not loading #1

Open samueldedavid opened 5 years ago

samueldedavid commented 5 years ago

Hi I am using angular8 and to use the style sheets I need to place them in the root styles.css file to work

@import '@angular/material/prebuilt-themes/deeppurple-amber.css';
body {
    margin: 0;
  }
  #chart {
    height: inherit;
    width: inherit;
}
rect.bar {
fill: steelblue;
}

.bar:hover {
        fill: brown;
    }

.axis--x path {
        display: none;
    }

It doesnot work from components style sheet . Also if you can please tell how to add :hover attrib programatically from d3 select chain methods

Yashwanthbyalla commented 5 years ago

You can have something like below:

d3.select("body").selectAll(null) .data(["one", "two", "three"]) .enter() .append("p") .text(String) .on("mouseover", (i, n) => { changeColor(n[i]) });

function changeColor(element) { d3.select(element).style("color", "blue") }