diff --git a/Chart/DiffAreaChart.js b/Chart/DiffAreaChart.js index 9a0f8af..cf989a1 100644 --- a/Chart/DiffAreaChart.js +++ b/Chart/DiffAreaChart.js @@ -5,7 +5,8 @@ jsOMS.Chart.DiffAreaChart = function (id) { this.chart = new jsOMS.Chart.LineChart(id); - this.chart.getChart().subtype = 'area'; + this.chart.getChart().dataSettings.marker.visible = false; + this.chart.getChart().subtype = 'diffarea'; }; jsOMS.Chart.DiffAreaChart.prototype.getChart = function () diff --git a/Chart/LineChart.js b/Chart/LineChart.js index 702c317..3bc4ef1 100644 --- a/Chart/LineChart.js +++ b/Chart/LineChart.js @@ -41,6 +41,11 @@ }, min: 0, max: 0 + }, + y0: { + visible: false, + min: 0, + max: 0 } }; @@ -90,6 +95,18 @@ { return y(d.y); }); + } else if (this.chart.subtype === 'diffarea') { + y.domain([this.chart.axis.y0.min - 1, this.chart.axis.y.max + 1]); + + line = d3.svg.area().interpolate(this.chart.dataSettings.interpolate).x(function (d) + { + return x(d.x); + }).y0(function (d) { + return y(d.y0); + }).y1(function (d) + { + return y(d.y); + }); } else if (this.chart.subtype === 'stacked') { line = d3.svg.area().interpolate(this.chart.dataSettings.interpolate).x(function (d) {