From 2ad6646b805c00d979f2fd2d8988c7fee0657c1e Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Wed, 22 May 2013 00:02:38 +0900 Subject: [PATCH] Fix region when rotated --- c3.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/c3.js b/c3.js index 4644a9d..870f778 100644 --- a/c3.js +++ b/c3.js @@ -803,10 +803,6 @@ .data(__regions) .enter().append('rect') .attr('class', function(d,i){ return 'region region-' + i }) - .attr("x", regionStart) - .attr("y", margin.top) - .attr("width", regionWidth) - .attr("height", height) } // Define g for chart area @@ -1253,8 +1249,10 @@ .attr("width", __axis_rotated ? width : rectW) .attr("height", __axis_rotated ? rectW : height) main.selectAll('rect.region') - .attr("x", regionStart) - .attr("width", regionWidth) + .attr("x", __axis_rotated ? 0 : regionStart) + .attr("y", __axis_rotated ? regionStart : margin.top) + .attr("width", __axis_rotated ? width : regionWidth) + .attr("height", __axis_rotated ? regionWidth : height) // TODO: enter/exti section for data add/remove }