Any plans for extended Spline Area charts?
I'm thinking at Range Spline Area, Stacked Spline Area, and Stacked 100% Spline Area.
They should be easily implemented with combinations between Range or Stacked charts and the Spline Area.
In the meantime, is there any way we could emulate these charts with your current implementation?
Thanks,
-Cristian
SIGN IN To post a reply.
3 Replies
DD
Dharanidharan Dharmasivam
Syncfusion Team
April 3, 2017 09:02 AM UTC
Hi Cristian,
Thanks for contacting Syncfusion support.
As we don’t have support to render stacking spline area chart and 100% stacking spline area, we have added it to our feature request list. And for better follow up we have created branch incident under your account. Kindly follow up with the branch incident for further details.
Also as per you request, we have created workaround samples to achieve your requirement by using load event of the chart. Find the samples below.
Stacking spline area: http://jsplayground.syncfusion.com/pksmctlg
100% spline area: http://jsplayground.syncfusion.com/5cjendsp
Code snippet for Stacking spline area:
|
[JS]
$("#container").ejChart(
{
//...
load:"chartLoad",
});
function chartLoad(sender) {
for (var i = 1; i < sender.model.series.length; i++) {
for (var j = 0; j < sender.model.series[i].points.length; j++) {
var currentPoint = sender.model.series[i].points[j].y;
previousPoint = sender.model.series[i - 1].points[j].y;
sender.model.series[i].points[j].y = currentPoint + previousPoint;
}
}
sender.model.series.reverse();
}
|
Screenshot:
Code snippet for 100% stacking spline area:
|
[JS]
$("#container").ejChart(
{
//...
load:"chartLoad",
});
function chartLoad(sender) {
var series = sender.model.series;
var maxPoints = 0;
// find the maximum points count
for (var i = 0; i < series.length; i++) {
maxPoints = (series[i].points.length > maxPoints) ? series[i].points.length : maxPoints;
}
for (var j = 0; j < maxPoints; j++) {
currentPointIndex = j;
// total of all points
var maxValue = 0;
for (var l = 0; l < series.length; l++) {
maxValue += series[l].points[currentPointIndex].y;
}
// getting percentage value
var value = 0;
for (var m = 0; m < series.length; m++) {
if (!ej.util.isNullOrUndefined(series[m].points[currentPointIndex]))
value += (series[m].points[currentPointIndex].y / maxValue) * 100;
series[m].points[currentPointIndex].y = value;
}
}
sender.model.series.reverse();
} |
Screenshot:
Thanks,
Dharani.
CS
Cristian Scutaru
April 4, 2017 03:07 PM UTC
Thanks a lot, Dharani, it looks great.
The only thing left to do was to adjust a bit the series line and back colors, because of the reversal.
Cheers,
Cristian
DD
Dharanidharan Dharmasivam
Syncfusion Team
April 5, 2017 05:50 AM UTC
Hi Cristian,
Thanks for your revert.
Kindly revert us, if you need further assistance.
Dharani.
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
CS Cristian Scutaru
- Apr 1, 2017 09:38 PM UTC
- Apr 5, 2017 05:50 AM UTC