Browse Source

Fix selected/expanded bar styles

pull/1/head
Masayuki Tanaka 12 years ago committed by masayuki
parent
commit
90e682676a
  1. 8
      c3.css
  2. 7
      c3.js

8
c3.css

@ -36,14 +36,14 @@ path, line {
/*-- Bar --*/ /*-- Bar --*/
.__bar._e_ { .__bar._e_ {
stroke-width: 6px; stroke-width: 1px;
fill-opacity: 0.6;
} }
/* TODO: use this /* TODO: use this*/
.__bar._s_ { .__bar._s_ {
stroke-width: 1px; stroke-width: 1px;
fill-opacity: 0.4; fill-opacity: 0.3;
} }
*/
.selected-bar { .selected-bar {
fill: white; fill: white;
stroke-width: 2px; stroke-width: 2px;

7
c3.js

@ -585,15 +585,8 @@
} }
function selectBar (target, d, i) { function selectBar (target, d, i) {
target.transition().duration(100)
.style("fill-opacity", 0.4)
.style("stroke-width", "1px")
} }
function unselectBar (target, d, i) { function unselectBar (target, d, i) {
target.transition().duration(100)
.style("fill-opacity", 1)
.style("stroke-width", target.classed("_e_") ? "4px" : null)
.each('end', function(){ target.transition().style("stroke-width", null) })
} }
function toggleBar (selected, target, d, i) { function toggleBar (selected, target, d, i) {
(selected) ? selectBar(target, d, i) : unselectBar(target, d, i) (selected) ? selectBar(target, d, i) : unselectBar(target, d, i)

Loading…
Cancel
Save