Browse Source

Fix data.names API - #150

pull/213/merge
Masayuki Tanaka 11 years ago
parent
commit
85a57161b9
  1. 8
      c3.js
  2. 4
      c3.min.js

8
c3.js

@ -4130,9 +4130,7 @@
.attr("class", CLASS.legendItemEvent) .attr("class", CLASS.legendItemEvent)
.style('fill-opacity', 0) .style('fill-opacity', 0)
.attr('x', isLegendRight ? xForLegendRect : -200) .attr('x', isLegendRight ? xForLegendRect : -200)
.attr('y', isLegendRight ? -200 : yForLegendRect) .attr('y', isLegendRight ? -200 : yForLegendRect);
.attr('width', function (id) { return widths[id]; })
.attr('height', function (id) { return heights[id]; });
l.append('rect') l.append('rect')
.attr("class", CLASS.legendItemTile) .attr("class", CLASS.legendItemTile)
.style("pointer-events", "none") .style("pointer-events", "none")
@ -4153,6 +4151,8 @@
legend.selectAll('rect.' + CLASS.legendItemEvent) legend.selectAll('rect.' + CLASS.legendItemEvent)
.data(targetIds) .data(targetIds)
.transition().duration(withTransition ? 250 : 0) .transition().duration(withTransition ? 250 : 0)
.attr('width', function (id) { return widths[id]; })
.attr('height', function (id) { return heights[id]; })
.attr('x', xForLegendRect) .attr('x', xForLegendRect)
.attr('y', yForLegendRect); .attr('y', yForLegendRect);
@ -4490,7 +4490,7 @@
Object.keys(names).forEach(function (id) { Object.keys(names).forEach(function (id) {
__data_names[id] = names[id]; __data_names[id] = names[id];
}); });
updateLegend(mapToIds(c3.data.targets), {withTransition: true}); redraw({withLegend: true});
return __data_names; return __data_names;
}; };
c3.data.colors = function (colors) { c3.data.colors = function (colors) {

4
c3.min.js vendored

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