Commit 4e40a413 authored by Evgeny's avatar Evgeny

Fix chart width when in node

parent d3c7502c
...@@ -1041,7 +1041,7 @@ ...@@ -1041,7 +1041,7 @@
c3_chart_internal_fn.updateSvgSize = function () { c3_chart_internal_fn.updateSvgSize = function () {
var $$ = this, var $$ = this,
brush = $$.svg.select(".c3-brush .background"); brush = $$.svg.select(".c3-brush .background");
$$.svg.attr('width', $$.currentWidth).attr('height', $$.currentHeight); $$.svg.attr('width', $$.currentWidth + (isNode ? 10 : 0)).attr('height', $$.currentHeight);
$$.svg.selectAll(['#' + $$.clipId, '#' + $$.clipIdForGrid]).select('rect') $$.svg.selectAll(['#' + $$.clipId, '#' + $$.clipIdForGrid]).select('rect')
.attr('width', $$.width) .attr('width', $$.width)
.attr('height', $$.height); .attr('height', $$.height);
...@@ -4268,6 +4268,7 @@ ...@@ -4268,6 +4268,7 @@
xForLegend = function (id) { return getMargin(steps[id]) + offsets[id]*nodeOffset; }; xForLegend = function (id) { return getMargin(steps[id]) + offsets[id]*nodeOffset; };
yForLegend = function (id) { return maxHeight * steps[id] - 2*nodeOffset; }; yForLegend = function (id) { return maxHeight * steps[id] - 2*nodeOffset; };
} }
xForLegendText = function (id, i) { return xForLegend(id, i) + 14; }; xForLegendText = function (id, i) { return xForLegend(id, i) + 14; };
yForLegendText = function (id, i) { return yForLegend(id, i) + 9; }; yForLegendText = function (id, i) { return yForLegend(id, i) + 9; };
xForLegendRect = function (id, i) { return xForLegend(id, i); }; xForLegendRect = function (id, i) { return xForLegend(id, i); };
......
...@@ -820,7 +820,7 @@ c3_chart_internal_fn.transformAll = function (withTransition, transitions) { ...@@ -820,7 +820,7 @@ c3_chart_internal_fn.transformAll = function (withTransition, transitions) {
c3_chart_internal_fn.updateSvgSize = function () { c3_chart_internal_fn.updateSvgSize = function () {
var $$ = this, var $$ = this,
brush = $$.svg.select(".c3-brush .background"); brush = $$.svg.select(".c3-brush .background");
$$.svg.attr('width', $$.currentWidth).attr('height', $$.currentHeight); $$.svg.attr('width', $$.currentWidth + (isNode ? 10 : 0)).attr('height', $$.currentHeight);
$$.svg.selectAll(['#' + $$.clipId, '#' + $$.clipIdForGrid]).select('rect') $$.svg.selectAll(['#' + $$.clipId, '#' + $$.clipIdForGrid]).select('rect')
.attr('width', $$.width) .attr('width', $$.width)
.attr('height', $$.height); .attr('height', $$.height);
......
...@@ -227,6 +227,7 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) { ...@@ -227,6 +227,7 @@ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
xForLegend = function (id) { return getMargin(steps[id]) + offsets[id]*nodeOffset; }; xForLegend = function (id) { return getMargin(steps[id]) + offsets[id]*nodeOffset; };
yForLegend = function (id) { return maxHeight * steps[id] - 2*nodeOffset; }; yForLegend = function (id) { return maxHeight * steps[id] - 2*nodeOffset; };
} }
xForLegendText = function (id, i) { return xForLegend(id, i) + 14; }; xForLegendText = function (id, i) { return xForLegend(id, i) + 14; };
yForLegendText = function (id, i) { return yForLegend(id, i) + 9; }; yForLegendText = function (id, i) { return yForLegend(id, i) + 9; };
xForLegendRect = function (id, i) { return xForLegend(id, i); }; xForLegendRect = function (id, i) { return xForLegend(id, i); };
......
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