|
|
|
@ -68,10 +68,11 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
|
|
|
|
|
yMax = axisId === 'y2' ? config.axis_y2_max : config.axis_y_max, |
|
|
|
|
yDomainMin = $$.getYDomainMin(yTargets), |
|
|
|
|
yDomainMax = $$.getYDomainMax(yTargets), |
|
|
|
|
domainLength, padding, padding_top, padding_bottom, |
|
|
|
|
domain, domainLength, padding, padding_top, padding_bottom, |
|
|
|
|
center = axisId === 'y2' ? config.axis_y2_center : config.axis_y_center, |
|
|
|
|
yDomainAbs, lengths, diff, ratio, isAllPositive, isAllNegative, |
|
|
|
|
isZeroBased = ($$.hasType('bar', yTargets) && config.bar_zerobased) || ($$.hasType('area', yTargets) && config.area_zerobased), |
|
|
|
|
isInverted = axisId === 'y2' ? config.axis_y2_inverted : config.axis_y_inverted, |
|
|
|
|
showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated, |
|
|
|
|
showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated; |
|
|
|
|
|
|
|
|
@ -138,7 +139,8 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
|
|
|
|
|
if (isAllPositive) { padding_bottom = yDomainMin; } |
|
|
|
|
if (isAllNegative) { padding_top = -yDomainMax; } |
|
|
|
|
} |
|
|
|
|
return [yDomainMin - padding_bottom, yDomainMax + padding_top]; |
|
|
|
|
domain = [yDomainMin - padding_bottom, yDomainMax + padding_top]; |
|
|
|
|
return isInverted ? domain.reverse() : domain; |
|
|
|
|
}; |
|
|
|
|
c3_chart_internal_fn.getXDomainMin = function (targets) { |
|
|
|
|
var $$ = this, config = $$.config; |
|
|
|
|