mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-02-13 07:58:41 +00:00
Implemented diff chart
This commit is contained in:
parent
276410dc97
commit
f5ce290cff
|
|
@ -5,7 +5,8 @@
|
||||||
jsOMS.Chart.DiffAreaChart = function (id)
|
jsOMS.Chart.DiffAreaChart = function (id)
|
||||||
{
|
{
|
||||||
this.chart = new jsOMS.Chart.LineChart(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 ()
|
jsOMS.Chart.DiffAreaChart.prototype.getChart = function ()
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,11 @@
|
||||||
},
|
},
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 0
|
max: 0
|
||||||
|
},
|
||||||
|
y0: {
|
||||||
|
visible: false,
|
||||||
|
min: 0,
|
||||||
|
max: 0
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -90,6 +95,18 @@
|
||||||
{
|
{
|
||||||
return y(d.y);
|
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') {
|
} else if (this.chart.subtype === 'stacked') {
|
||||||
line = d3.svg.area().interpolate(this.chart.dataSettings.interpolate).x(function (d)
|
line = d3.svg.area().interpolate(this.chart.dataSettings.interpolate).x(function (d)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user