Commit a3c1b7dd authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix parent width - #241

parent efa89499
......@@ -541,9 +541,19 @@
if (axisId === 'y2' && !__axis_y2_show) { return rotated_padding_top; }
return (getAxisLabelPositionById(axisId).isInner ? 30 : 40) + (axisId === 'y2' ? -10 : 0);
}
function getParentRectValue(key) {
var parent = selectChart.node(), v;
while (parent && parent.tagName !== 'BODY') {
v = parent.getBoundingClientRect()[key];
if (v) {
break;
}
parent = parent.parentNode;
}
return v;
}
function getParentWidth() {
var w = selectChart.style("width");
return w.indexOf('px') > 0 ? +w.replace('px', '') : 0;
return getParentRectValue('width');
}
function getParentHeight() {
var h = selectChart.style('height');
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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