From 187ab19e726f6739ff88123d5d40c5a331bb5363 Mon Sep 17 00:00:00 2001 From: Masayuki Tanaka Date: Thu, 6 Jun 2013 15:55:02 +0900 Subject: [PATCH] Fix selected circles position when updated --- c3.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/c3.js b/c3.js index 0aaa131..bcc4a60 100644 --- a/c3.js +++ b/c3.js @@ -1233,6 +1233,7 @@ .selectAll('circle') .remove() main.selectAll('.selected-circle') + .transition().duration(withTransition ? 250 : 0) .attr("cx", __axis_rotated ? circleY : circleX) .attr("cy", __axis_rotated ? circleX : circleY) @@ -1301,6 +1302,12 @@ .attr("class", classCircles) .style("fill", function(d){ return color(d.id) }) .style("cursor", function(d){ return __data_selection_isselectable(d) ? "pointer" : null }) + // Update date for selected circles + targets.forEach(function(t){ + main.selectAll('.selected-circles-'+t.id).selectAll('.selected-circle').each(function(d){ + d.value = t.values[d.x].value + }) + }) /*-- Context --*/