Skip to content

Instantly share code, notes, and snippets.

@jwhitley
Created September 30, 2011 06:26
Show Gist options
  • Save jwhitley/1252867 to your computer and use it in GitHub Desktop.
Save jwhitley/1252867 to your computer and use it in GitHub Desktop.
var markGroup = dataGroup.selectAll(".mark")
.data(flatData).enter()
.append("svg:g")
.attr("class","mark");
markGroup.append("svg:rect").
attr("x", function (d,i) { return x(i); }).
attr("y", 0).
attr("class", targetStyle(this.kind)).
attr("width", widthFunc(this)).
attr("height", this.height);
markGroup.append("svg:line").
filter(function(d, i) { return (targetStyle())(d) != "targetHit"; }).
attr("x1", function (d,i) { console.log("idx "+i); return barXScale(i); }).
attr("y1", 0).
attr("x2", function (d,i) { return barXScale(i+1)-1; }).
attr("y2", this.height).
attr("stroke-dasharray", "2 2");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment