Browse Source

Fix transition

pull/200/merge
Masayuki Tanaka 11 years ago
parent
commit
0121bb7ee7
  1. 7
      c3.js
  2. 4
      c3.min.js

7
c3.js

@ -3674,6 +3674,7 @@
.attr('class', classChartText); .attr('class', classChartText);
mainTextEnter = mainTextUpdate.enter().append('g') mainTextEnter = mainTextUpdate.enter().append('g')
.attr('class', classChartText) .attr('class', classChartText)
.style('opacity', 0)
.style("pointer-events", "none"); .style("pointer-events", "none");
mainTextEnter.append('g') mainTextEnter.append('g')
.attr('class', classTexts) .attr('class', classTexts)
@ -3685,6 +3686,7 @@
.attr('class', classChartBar); .attr('class', classChartBar);
mainBarEnter = mainBarUpdate.enter().append('g') mainBarEnter = mainBarUpdate.enter().append('g')
.attr('class', classChartBar) .attr('class', classChartBar)
.style('opacity', 0)
.style("pointer-events", "none"); .style("pointer-events", "none");
// Bars for each data // Bars for each data
mainBarEnter.append('g') mainBarEnter.append('g')
@ -3699,6 +3701,7 @@
.attr('class', classChartLine); .attr('class', classChartLine);
mainLineEnter = mainLineUpdate.enter().append('g') mainLineEnter = mainLineUpdate.enter().append('g')
.attr('class', classChartLine) .attr('class', classChartLine)
.style('opacity', 0)
.style("pointer-events", "none"); .style("pointer-events", "none");
// Lines for each data // Lines for each data
mainLineEnter.append("path") mainLineEnter.append("path")
@ -3789,6 +3792,7 @@
.data(targets) .data(targets)
.attr('class', classChartBar); .attr('class', classChartBar);
contextBarEnter = contextBarUpdate.enter().append('g') contextBarEnter = contextBarUpdate.enter().append('g')
.style('opacity', 0)
.attr('class', classChartBar); .attr('class', classChartBar);
// Bars for each data // Bars for each data
contextBarEnter.append('g') contextBarEnter.append('g')
@ -3800,6 +3804,7 @@
.data(targets) .data(targets)
.attr('class', classChartLine); .attr('class', classChartLine);
contextLineEnter = contextLineUpdate.enter().append('g') contextLineEnter = contextLineUpdate.enter().append('g')
.style('opacity', 0)
.attr('class', classChartLine); .attr('class', classChartLine);
// Lines for each data // Lines for each data
contextLineEnter.append("path") contextLineEnter.append("path")
@ -3812,7 +3817,7 @@
// Fade-in each chart // Fade-in each chart
svg.selectAll('.' + CLASS.target).filter(function (d) { return isTargetToShow(d.id); }) svg.selectAll('.' + CLASS.target).filter(function (d) { return isTargetToShow(d.id); })
.transition() .transition().duration(750)
.style("opacity", 1); .style("opacity", 1);
} }

4
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save