Implemented diff chart

This commit is contained in:
Dennis Eichhorn 2017-01-10 21:43:59 +01:00
parent 276410dc97
commit f5ce290cff
2 changed files with 19 additions and 1 deletions

View File

@ -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 ()

View File

@ -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)
{