Disable drawing line for area charts

parent d062d0a9
...@@ -206,7 +206,7 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) { ...@@ -206,7 +206,7 @@ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
c3_chart_internal_fn.updateArea = function (durationForExit) { c3_chart_internal_fn.updateArea = function (durationForExit) {
var $$ = this, d3 = $$.d3; var $$ = this, d3 = $$.d3;
$$.mainArea = $$.main.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area) $$.mainArea = $$.main.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area)
.data($$.lineData.bind($$)); .data($$.areaData.bind($$));
$$.mainArea.enter().append('path') $$.mainArea.enter().append('path')
.attr("class", $$.classArea.bind($$)) .attr("class", $$.classArea.bind($$))
.style("fill", $$.color) .style("fill", $$.color)
......
...@@ -32,7 +32,7 @@ c3_chart_internal_fn.hasArcType = function (targets) { ...@@ -32,7 +32,7 @@ c3_chart_internal_fn.hasArcType = function (targets) {
}; };
c3_chart_internal_fn.isLineType = function (d) { c3_chart_internal_fn.isLineType = function (d) {
var config = this.config, id = isString(d) ? d : d.id; var config = this.config, id = isString(d) ? d : d.id;
var is = !config.data_types[id] || ['line', 'spline', 'area', 'area-spline', 'step', 'area-step'].indexOf(config.data_types[id]) >= 0; var is = !config.data_types[id] || ['line', 'spline', 'area-spline', 'step', 'area-step'].indexOf(config.data_types[id]) >= 0;
return is; return is;
}; };
c3_chart_internal_fn.isStepType = function (d) { c3_chart_internal_fn.isStepType = function (d) {
...@@ -70,6 +70,9 @@ c3_chart_internal_fn.isDonutType = function (d) { ...@@ -70,6 +70,9 @@ c3_chart_internal_fn.isDonutType = function (d) {
c3_chart_internal_fn.isArcType = function (d) { c3_chart_internal_fn.isArcType = function (d) {
return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d); return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d);
}; };
c3_chart_internal_fn.areaData = function (d) {
return this.isAreaType(d) ? [d] : [];
};
c3_chart_internal_fn.lineData = function (d) { c3_chart_internal_fn.lineData = function (d) {
return this.isLineType(d) ? [d] : []; return this.isLineType(d) ? [d] : [];
}; };
......
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