Browse Source

Fix legend item width when data.names called - #775

pull/785/head
Masayuki Tanaka 10 years ago
parent
commit
b0e785357d
  1. 4
      c3.js
  2. 4
      c3.min.js
  3. 1
      src/api.data.js
  4. 3
      src/legend.js

4
c3.js

@ -3766,6 +3766,9 @@
.style('visibility', 'hidden');
};
var legendItemTextBox = {};
c3_chart_internal_fn.clearLegendItemTextBoxCache = function () {
legendItemTextBox = {};
};
c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
var $$ = this, config = $$.config;
var xForLegend, xForLegendText, xForLegendRect, yForLegend, yForLegendText, yForLegendRect;
@ -6273,6 +6276,7 @@
return values;
};
c3_chart_fn.data.names = function (names) {
this.internal.clearLegendItemTextBoxCache();
return this.internal.updateDataAttributes('names', names);
};
c3_chart_fn.data.colors = function (colors) {

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

1
src/api.data.js

@ -16,6 +16,7 @@ c3_chart_fn.data.values = function (targetId) {
return values;
};
c3_chart_fn.data.names = function (names) {
this.internal.clearLegendItemTextBoxCache();
return this.internal.updateDataAttributes('names', names);
};
c3_chart_fn.data.colors = function (colors) {

3
src/legend.js

@ -100,6 +100,9 @@ c3_chart_internal_fn.hideLegend = function (targetIds) {
.style('visibility', 'hidden');
};
var legendItemTextBox = {};
c3_chart_internal_fn.clearLegendItemTextBoxCache = function () {
legendItemTextBox = {};
};
c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
var $$ = this, config = $$.config;
var xForLegend, xForLegendText, xForLegendRect, yForLegend, yForLegendText, yForLegendRect;

Loading…
Cancel
Save