Browse Source

Update source files too

pull/713/head
AnSavvides 10 years ago
parent
commit
c77595232c
  1. 5
      src/domain.js
  2. 7
      src/util.js

5
src/domain.js

@ -66,8 +66,8 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId, yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId,
yMin = axisId === 'y2' ? config.axis_y2_min : config.axis_y_min, yMin = axisId === 'y2' ? config.axis_y2_min : config.axis_y_min,
yMax = axisId === 'y2' ? config.axis_y2_max : config.axis_y_max, yMax = axisId === 'y2' ? config.axis_y2_max : config.axis_y_max,
yDomainMin = isValue(yMin) ? yMin : $$.getYDomainMin(yTargets), yDomainMin = isNumber(yMin) ? yMin : $$.getYDomainMin(yTargets),
yDomainMax = isValue(yMax) ? yMax : $$.getYDomainMax(yTargets), yDomainMax = isNumber(yMax) ? yMax : $$.getYDomainMax(yTargets),
domainLength, padding, padding_top, padding_bottom, domainLength, padding, padding_top, padding_bottom,
center = axisId === 'y2' ? config.axis_y2_center : config.axis_y_center, center = axisId === 'y2' ? config.axis_y2_center : config.axis_y_center,
yDomainAbs, lengths, diff, ratio, isAllPositive, isAllNegative, yDomainAbs, lengths, diff, ratio, isAllPositive, isAllNegative,
@ -142,6 +142,7 @@ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
if (isAllPositive) { padding_bottom = yDomainMin; } if (isAllPositive) { padding_bottom = yDomainMin; }
if (isAllNegative) { padding_top = -yDomainMax; } if (isAllNegative) { padding_top = -yDomainMax; }
} }
yDomainMin = yDomainMin === 0 ? yDomainMin : yDomainMin - padding_bottom;
return [yDomainMin - padding_bottom, yDomainMax + padding_top]; return [yDomainMin - padding_bottom, yDomainMax + padding_top];
}; };
c3_chart_internal_fn.getXDomainMin = function (targets) { c3_chart_internal_fn.getXDomainMin = function (targets) {

7
src/util.js

@ -1,6 +1,9 @@
var isValue = c3_chart_internal_fn.isValue = function (v) { var isValue = c3_chart_internal_fn.isValue = function (v) {
return v || v === 0; return v || v === 0;
}, },
isNumber = c3_chart_internal_fn.isNumber = function (v) {
return !isNaN(parseFloat(v)) && isFinite(v);
},
isFunction = c3_chart_internal_fn.isFunction = function (o) { isFunction = c3_chart_internal_fn.isFunction = function (o) {
return typeof o === 'function'; return typeof o === 'function';
}, },

Loading…
Cancel
Save