Commit b34ae681b519282e43a018bcccb6b4854c21f534

Authored by hitier
1 parent f1026243

Style bars with css now

app/main/static/css/charges.css
@@ -18,12 +18,16 @@ @@ -18,12 +18,16 @@
18 display: inline-block; 18 display: inline-block;
19 } 19 }
20 20
21 -rect.bar:hover {  
22 - fill: dimgrey; 21 +rect.bar {
  22 + stroke: white;
  23 + stroke-width: 0.5pt;
23 } 24 }
24 25
25 -rect.bar {  
26 - fill: rgb(127, 127, 159); 26 +rect.bar:hover {
  27 + -webkit-filter: brightness(0.5);
  28 + -moz-filter: brightness(0.5);
  29 + -ms-filter: brightness(0.5);
  30 + filter: brightness(0.5);
27 } 31 }
28 32
29 .tooltip { 33 .tooltip {
app/main/static/js/charges.js
@@ -137,12 +137,12 @@ function build_chart(div_selector, data_url) { @@ -137,12 +137,12 @@ function build_chart(div_selector, data_url) {
137 .data(d => d) 137 .data(d => d)
138 .enter() 138 .enter()
139 .append("rect") 139 .append("rect")
  140 + .attr("class", "bar")
140 .attr("x", d => x(d.data.period)) 141 .attr("x", d => x(d.data.period))
141 .attr("width", x.bandwidth()) 142 .attr("width", x.bandwidth())
142 // .attr("width", 5) 143 // .attr("width", 5)
143 .attr("y", d => y(d[1])) 144 .attr("y", d => y(d[1]))
144 .attr("height", d => height - y(d[1] - d[0])) 145 .attr("height", d => height - y(d[1] - d[0]))
145 - .attr("stroke", "black")  
146 .on("mouseover", mouseover) 146 .on("mouseover", mouseover)
147 .on("mousemove", mousemove) 147 .on("mousemove", mousemove)
148 .on("mouseleave", mouseleave); 148 .on("mouseleave", mouseleave);