Commit 9ab4969a authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix padding when data label show - #45

parent d5899c93
...@@ -687,7 +687,7 @@ ...@@ -687,7 +687,7 @@
yMax = axisId === 'y2' ? __axis_y2_max : __axis_y_max, yMax = axisId === 'y2' ? __axis_y2_max : __axis_y_max,
yDomainMin = isValue(yMin) ? yMin : getYDomainMin(yTargets), yDomainMin = isValue(yMin) ? yMin : getYDomainMin(yTargets),
yDomainMax = isValue(yMax) ? yMax : getYDomainMax(yTargets), yDomainMax = isValue(yMax) ? yMax : getYDomainMax(yTargets),
padding = Math.abs(yDomainMax - yDomainMin) * 0.22, //0.1 -> 0.22 - 23.2.2014 - fiery- padding = Math.abs(yDomainMax - yDomainMin) * (hasDataLabel() && __axis_rotated ? 0.125 : 0.1),
padding_top = padding, padding_bottom = padding, padding_top = padding, padding_bottom = padding,
center = axisId === 'y2' ? __axis_y2_center : __axis_y_center; center = axisId === 'y2' ? __axis_y2_center : __axis_y_center;
if (center) { if (center) {
...@@ -1004,14 +1004,18 @@ ...@@ -1004,14 +1004,18 @@
return isValue(d.value) ? isScatterType(d) ? 0.5 : 1 : 0; return isValue(d.value) ? isScatterType(d) ? 0.5 : 1 : 0;
} }
function opacityForText(d) { function opacityForText(d) {
return hasDataLabel(d) ? 1 : 0;
}
function hasDataLabel(d) {
var id = d ? d.id : null;
if (typeof __data_labels === 'boolean' && __data_labels) { if (typeof __data_labels === 'boolean' && __data_labels) {
return 1; return true;
} else if (__data_labels[d.id] === 'boolean' && __data_labels[d.id]) { } else if (__data_labels[id] === 'boolean' && __data_labels[id]) {
return 1; return true;
} else if (__data_labels[d.id] && __data_labels[d.id].show) { } else if (__data_labels[id] && __data_labels[id].show) {
return 1; return true;
} }
return 0; return false;
} }
function xx(d) { function xx(d) {
......
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