Browse Source

gh-1595 Adds config option in area hash to draw the area fill above the line instead of below

pull/1675/head
Michiel 9 years ago committed by Ændrew Rininsland
parent
commit
a45fcb1970
No known key found for this signature in database
GPG Key ID: ADBCD4C867F9B2DA
  1. 1
      src/config.js
  2. 2
      src/shape.line.js

1
src/config.js

@ -168,6 +168,7 @@ c3_chart_internal_fn.getDefaultConfig = function () {
bar_zerobased: true,
// area
area_zerobased: true,
area_above: false,
// pie
pie_label_show: true,
pie_label_format: undefined,

2
src/shape.line.js

@ -250,7 +250,7 @@ c3_chart_internal_fn.generateDrawArea = function (areaIndices, isSub) {
return config.data_groups.length > 0 ? getPoints(d, i)[1][1] : yScaleGetter.call($$, d.id)(d.value);
};
area = config.axis_rotated ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(value0).y1(value1);
area = config.axis_rotated ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(config.area_above ? 0 : value0).y1(value1);
if (!config.line_connectNull) {
area = area.defined(function (d) { return d.value !== null; });
}

Loading…
Cancel
Save