We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Any plans for extended Spline Area charts?

Thread ID:

Created:

Updated:

Platform:

Replies:

129754 Apr 1,2017 05:38 PM Apr 5,2017 01:50 AM JavaScript 3
loading
Tags: ejChart
Cristian Scutaru
Asked On April 1, 2017 05:38 PM

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

Dharanidharan Dharmasivam [Syncfusion]
Replied On April 3, 2017 05:02 AM

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. 



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. 


Cristian Scutaru
Replied On April 4, 2017 11:07 AM

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

Dharanidharan Dharmasivam [Syncfusion]
Replied On April 5, 2017 01:50 AM

Hi Cristian, 

Thanks for your revert. 

Kindly revert us, if you need further assistance. 

Dharani. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;