|
|
@ -96,6 +96,8 @@ c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) { |
|
|
|
var $$ = this, config = $$.config, |
|
|
|
var $$ = this, config = $$.config, |
|
|
|
ids = $$.d3.keys(data[0]).filter($$.isNotX, $$), |
|
|
|
ids = $$.d3.keys(data[0]).filter($$.isNotX, $$), |
|
|
|
xs = $$.d3.keys(data[0]).filter($$.isX, $$), |
|
|
|
xs = $$.d3.keys(data[0]).filter($$.isX, $$), |
|
|
|
|
|
|
|
zeroUnderYAxis = true, |
|
|
|
|
|
|
|
allZero = true, |
|
|
|
targets; |
|
|
|
targets; |
|
|
|
|
|
|
|
|
|
|
|
$$.allDataIsNegative = true; |
|
|
|
$$.allDataIsNegative = true; |
|
|
@ -155,8 +157,12 @@ c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) { |
|
|
|
x = undefined; |
|
|
|
x = undefined; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(value !== null && value !== 0) { |
|
|
|
|
|
|
|
allZero = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(value > 0) { |
|
|
|
if(value > 0) { |
|
|
|
$$.allDataIsNegative = false; |
|
|
|
zeroUnderYAxis = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return {x: x, value: value, id: convertedId}; |
|
|
|
return {x: x, value: value, id: convertedId}; |
|
|
@ -186,6 +192,12 @@ c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(allZero) { |
|
|
|
|
|
|
|
zeroUnderYAxis = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$$.zeroUnderYAxis = zeroUnderYAxis; |
|
|
|
|
|
|
|
|
|
|
|
// set target types
|
|
|
|
// set target types
|
|
|
|
if (config.data_type) { |
|
|
|
if (config.data_type) { |
|
|
|
$$.setTargetType($$.mapToIds(targets).filter(function (id) { return ! (id in config.data_types); }), config.data_type); |
|
|
|
$$.setTargetType($$.mapToIds(targets).filter(function (id) { return ! (id in config.data_types); }), config.data_type); |
|
|
|