Commit ae7bc0c4 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix updateSize

parent 24e06dd4
...@@ -323,36 +323,39 @@ ...@@ -323,36 +323,39 @@
$$.currentWidth = $$.getCurrentWidth(); $$.currentWidth = $$.getCurrentWidth();
$$.currentHeight = $$.getCurrentHeight(); $$.currentHeight = $$.getCurrentHeight();
// for main, context // for main
if (config[__axis_rotated]) { $$.margin = config[__axis_rotated] ? {
$$.margin = { top: $$.getHorizontalAxisHeight('y2') + $$.getCurrentPaddingTop(),
top: $$.getHorizontalAxisHeight('y2') + $$.getCurrentPaddingTop(), right: hasArc ? 0 : $$.getCurrentPaddingRight(),
right: hasArc ? 0 : $$.getCurrentPaddingRight(), bottom: $$.getHorizontalAxisHeight('y') + legendHeightForBottom + $$.getCurrentPaddingBottom(),
bottom: $$.getHorizontalAxisHeight('y') + legendHeightForBottom + $$.getCurrentPaddingBottom(), left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft())
left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft()) } : {
}; top: 4 + $$.getCurrentPaddingTop(), // for top tick text
$$.margin2 = { right: hasArc ? 0 : $$.getCurrentPaddingRight(),
top: $$.margin.top, bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
right: NaN, left: hasArc ? 0 : $$.getCurrentPaddingLeft()
bottom: 20 + legendHeightForBottom, };
left: $$.rotated_padding_left
}; // for subchart
} else { $$.margin2 = config[__axis_rotated] ? {
$$.margin = { top: $$.margin.top,
top: 4 + $$.getCurrentPaddingTop(), // for top tick text right: NaN,
right: hasArc ? 0 : $$.getCurrentPaddingRight(), bottom: 20 + legendHeightForBottom,
bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(), left: $$.rotated_padding_left
left: hasArc ? 0 : $$.getCurrentPaddingLeft() } : {
}; top: $$.currentHeight - subchartHeight - legendHeightForBottom,
$$.margin2 = { right: NaN,
top: $$.currentHeight - subchartHeight - legendHeightForBottom, bottom: xAxisHeight + legendHeightForBottom,
right: NaN, left: $$.margin.left
bottom: xAxisHeight + legendHeightForBottom, };
left: $$.margin.left
};
}
// for legend // for legend
$$.margin3 = {
top: 0,
right: NaN,
bottom: 0,
left: 0
};
if ($$.updateSizeForLegend) { $$.updateSizeForLegend(legendHeight, legendWidth); } if ($$.updateSizeForLegend) { $$.updateSizeForLegend(legendHeight, legendWidth); }
$$.width = $$.currentWidth - $$.margin.left - $$.margin.right; $$.width = $$.currentWidth - $$.margin.left - $$.margin.right;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -318,36 +318,39 @@ c3_chart_internal_fn.updateSizes = function () { ...@@ -318,36 +318,39 @@ c3_chart_internal_fn.updateSizes = function () {
$$.currentWidth = $$.getCurrentWidth(); $$.currentWidth = $$.getCurrentWidth();
$$.currentHeight = $$.getCurrentHeight(); $$.currentHeight = $$.getCurrentHeight();
// for main, context // for main
if (config[__axis_rotated]) { $$.margin = config[__axis_rotated] ? {
$$.margin = { top: $$.getHorizontalAxisHeight('y2') + $$.getCurrentPaddingTop(),
top: $$.getHorizontalAxisHeight('y2') + $$.getCurrentPaddingTop(), right: hasArc ? 0 : $$.getCurrentPaddingRight(),
right: hasArc ? 0 : $$.getCurrentPaddingRight(), bottom: $$.getHorizontalAxisHeight('y') + legendHeightForBottom + $$.getCurrentPaddingBottom(),
bottom: $$.getHorizontalAxisHeight('y') + legendHeightForBottom + $$.getCurrentPaddingBottom(), left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft())
left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft()) } : {
}; top: 4 + $$.getCurrentPaddingTop(), // for top tick text
$$.margin2 = { right: hasArc ? 0 : $$.getCurrentPaddingRight(),
top: $$.margin.top, bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
right: NaN, left: hasArc ? 0 : $$.getCurrentPaddingLeft()
bottom: 20 + legendHeightForBottom, };
left: $$.rotated_padding_left
}; // for subchart
} else { $$.margin2 = config[__axis_rotated] ? {
$$.margin = { top: $$.margin.top,
top: 4 + $$.getCurrentPaddingTop(), // for top tick text right: NaN,
right: hasArc ? 0 : $$.getCurrentPaddingRight(), bottom: 20 + legendHeightForBottom,
bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(), left: $$.rotated_padding_left
left: hasArc ? 0 : $$.getCurrentPaddingLeft() } : {
}; top: $$.currentHeight - subchartHeight - legendHeightForBottom,
$$.margin2 = { right: NaN,
top: $$.currentHeight - subchartHeight - legendHeightForBottom, bottom: xAxisHeight + legendHeightForBottom,
right: NaN, left: $$.margin.left
bottom: xAxisHeight + legendHeightForBottom, };
left: $$.margin.left
};
}
// for legend // for legend
$$.margin3 = {
top: 0,
right: NaN,
bottom: 0,
left: 0
};
if ($$.updateSizeForLegend) { $$.updateSizeForLegend(legendHeight, legendWidth); } if ($$.updateSizeForLegend) { $$.updateSizeForLegend(legendHeight, legendWidth); }
$$.width = $$.currentWidth - $$.margin.left - $$.margin.right; $$.width = $$.currentWidth - $$.margin.left - $$.margin.right;
......
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