Skip to content

Commit a45fcb1

Browse files
linearzaÆndrew Rininsland
authored andcommitted
c3jsgh-1595 Adds config option in area hash to draw the area fill above the line instead of below
1 parent 7711fac commit a45fcb1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
168168
bar_zerobased: true,
169169
// area
170170
area_zerobased: true,
171+
area_above: false,
171172
// pie
172173
pie_label_show: true,
173174
pie_label_format: undefined,

src/shape.line.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ c3_chart_internal_fn.generateDrawArea = function (areaIndices, isSub) {
250250
return config.data_groups.length > 0 ? getPoints(d, i)[1][1] : yScaleGetter.call($$, d.id)(d.value);
251251
};
252252

253-
area = config.axis_rotated ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(value0).y1(value1);
253+
area = config.axis_rotated ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(config.area_above ? 0 : value0).y1(value1);
254254
if (!config.line_connectNull) {
255255
area = area.defined(function (d) { return d.value !== null; });
256256
}

0 commit comments

Comments
 (0)