Commit 8532d2ed authored by Evgeny's avatar Evgeny

Add more width if running in node

parent 1d722724
...@@ -4078,7 +4078,7 @@ ...@@ -4078,7 +4078,7 @@
this.legendStep = step; this.legendStep = step;
}; };
c3_chart_internal_fn.updateLegendItemWidth = function (w) { c3_chart_internal_fn.updateLegendItemWidth = function (w) {
this.legendItemWidth = w; this.legendItemWidth = w + (isNode() ? 10 : 0);
}; };
c3_chart_internal_fn.updateLegendItemHeight = function (h) { c3_chart_internal_fn.updateLegendItemHeight = function (h) {
this.legendItemHeight = h; this.legendItemHeight = h;
...@@ -4166,7 +4166,7 @@ ...@@ -4166,7 +4166,7 @@
var hasFocused = $$.legend.selectAll('.' + CLASS.legendItemFocused).size(); var hasFocused = $$.legend.selectAll('.' + CLASS.legendItemFocused).size();
var texts, rects, tiles, background; var texts, rects, tiles, background;
var nodeOffset = typeof process === 'undefined' ? 1 : 5; var nodeOffset = typeof process === 'undefined' ? 1 : 3;
options = options || {}; options = options || {};
withTransition = getOption(options, "withTransition", true); withTransition = getOption(options, "withTransition", true);
...@@ -6491,6 +6491,9 @@ ...@@ -6491,6 +6491,9 @@
temp.__clonedFrom = cloneObj; temp.__clonedFrom = cloneObj;
return temp; return temp;
},
isNode = function(){
return typeof process === 'undefined';
}; };
......
...@@ -37,7 +37,7 @@ c3_chart_internal_fn.updateLegendStep = function (step) { ...@@ -37,7 +37,7 @@ c3_chart_internal_fn.updateLegendStep = function (step) {
this.legendStep = step; this.legendStep = step;
}; };
c3_chart_internal_fn.updateLegendItemWidth = function (w) { c3_chart_internal_fn.updateLegendItemWidth = function (w) {
this.legendItemWidth = w; this.legendItemWidth = w + (isNode() ? 10 : 0);
}; };
c3_chart_internal_fn.updateLegendItemHeight = function (h) { c3_chart_internal_fn.updateLegendItemHeight = function (h) {
this.legendItemHeight = h; this.legendItemHeight = h;
...@@ -125,7 +125,7 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) { ...@@ -125,7 +125,7 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
var hasFocused = $$.legend.selectAll('.' + CLASS.legendItemFocused).size(); var hasFocused = $$.legend.selectAll('.' + CLASS.legendItemFocused).size();
var texts, rects, tiles, background; var texts, rects, tiles, background;
var nodeOffset = typeof process === 'undefined' ? 1 : 5; var nodeOffset = typeof process === 'undefined' ? 1 : 3;
options = options || {}; options = options || {};
withTransition = getOption(options, "withTransition", true); withTransition = getOption(options, "withTransition", true);
......
...@@ -110,5 +110,8 @@ var isValue = c3_chart_internal_fn.isValue = function (v) { ...@@ -110,5 +110,8 @@ var isValue = c3_chart_internal_fn.isValue = function (v) {
temp.__clonedFrom = cloneObj; temp.__clonedFrom = cloneObj;
return temp; return temp;
},
isNode = function(){
return typeof process === 'undefined';
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment