Skip to content

Commit

Permalink
Merge pull request #26 from calebthebrewer/label-z-index
Browse files Browse the repository at this point in the history
Label z index
  • Loading branch information
cazzer committed Aug 21, 2015
2 parents 9026e13 + 80c07ab commit 82452b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions ampersand-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -1164,6 +1164,16 @@
.attr('width', lineWidth * 2);
}.bind(this));

// move all the text nodes to the bottom of their groups (highest z-index)
chart.selectAll('g.ampersand-graph-line-container')
.each(function() {
// grab all of the text nodes using a remove, also strip the d3 off
var texts = d3.select(this).selectAll('text').remove()[0];
for (var i = 0, l = texts.length; i < l; i++) {
this.appendChild(texts[i]);
}
});

chart.select('line.ampersand-graph-ground')
.transition()
.attr('x2', (2 + data.length) * lineWidth + (data.length - 1) * lineGroupMargin);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ampersand-chart",
"version": "0.1.21",
"version": "0.1.22",
"description": "Ampersand module for drawing a charts.",
"main": "ampersand-chart.js",
"scripts": {
Expand Down

0 comments on commit 82452b4

Please sign in to comment.