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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Why the line of splinearea chart not initialize in 0 point

Thread ID:

Created:

Updated:

Platform:

Replies:

126214 Sep 30,2016 09:48 PM UTC Oct 5,2016 06:54 AM UTC ASP.NET Web Forms 6
loading
Tags: Chart
Roimer Machacón Otero
Asked On September 30, 2016 09:48 PM UTC

Hi, we're using splinearea chart and can observe that in the example this chart initialize in the 0 point. Now when testing this with words values in x axis the chart not initialize as you can be seen in the graph. This happen only because that the values in the x axis are words and not numbers?

Attached to this forum a example code with this case.

Example

Attachment: Test_b000d971.zip

Dharanidharan Dharmasivam [Syncfusion]
Replied On October 3, 2016 09:31 AM UTC

Hi Roimer, 

Thanks for using Syncfusion product.  
We have analyzed your query. In the category axis by default the labelPlacement property will be betweenTicks. In your case you have to specify labelPlacement property as onTicks, so that chart will render from the origin. Kindly find the code snippet below, 

Code snippet: 
Code snippet: 

primaryXAxis: 
                { 
                    //... 
                    labelPlacement:"onTicks" 
                }, 



Screenshot: 
 
For your reference we have attached the sample. Kindly find the sample from below link, 
  
Thanks, 
Dharani. 


Roimer Machacón Otero
Replied On October 3, 2016 02:20 PM UTC

Hi!

Thanks, this solution work correctly!

Saravana Kumar Kanagavel [Syncfusion]
Replied On October 4, 2016 07:17 AM UTC

Hi Roimer, 
 
Thanks for your update. 
 
Please let us know if you need any other assistance on this. 
 
Regards, 
Saravana Kumar K 


Roimer Machacón Otero
Replied On October 4, 2016 03:01 PM UTC

Hi, we follow using the splinearea chart but have a problem. Are using a dropdown for change the datasource of three charts (splinearea, column and pie). Of the three charts works correctly the column and pie chart, the splinearea changing the datasource for the series not change being that we can observe in the console in the browser that the datasource change correctly.

Exist a form of clean the series in the splinearea chart and after load the new data?

Attached to this forum two images where can observe the change of id and data but the splinechart not is modified

Attachment: Splinearea_chart_d96ebda8.zip

Roimer Machacón Otero
Replied On October 4, 2016 04:38 PM UTC

Update:

The three types of charts when change the datasource value using the dropdown also not working correctly.

Anandaraj T [Syncfusion]
Replied On October 5, 2016 06:54 AM UTC

Hi Roimer, 

Thanks for the update. 

We have analyzed the screenshot and found that points are changed instead of data source. We have modified the previous sample to dynamically change the points in series and it can be downloaded from the following link 

We can change the points or data of a series through any of the following methods 

1) Using option method: 
 
If we use option method, we should remove the existing points and then add the new points or data to series. Please refer the following code snippet to achieve this 
 
[JS] 
 
        function updateDatasource(element) { 
            //Get drop-down value 
            var selection = element.options[element.selectedIndex].value; 
 
            //Create chart object or instance 
            var chart = $("#container").ejChart("instance"); 
 
            //Remove existing points before adding new points 
            for (var i = 0, length = chart.model.series.length; i < length; i++) 
                chart.model.series[i].points = []; 
 
            //Redraw chart with new points 
            $("#container").ejChart('option', { series: selection == 10 ? data10 : data3 }); 
        } 
 
Note: Option method adds new property or modify the values of existing properties in Chart. It will not remove existing properties. 

For example, consider there are 12 points present in chart. Now, we are changing the values of first 3 points without removing existing points. In this case, option method will modify the values only for first 3 points. There will not be any change in remaining 9 points. So chart will be drawn with 12 points and we can see the updated values for first 3 points. 

2) Using redraw method: 
 
If redraw method is used, we can replace the existing points with new values. Please refer the following code snippet to achieve this 

[JS] 
 
        function updateDatasourceRedraw(element) { 
            //Get drop-down value 
            var selection = element.options[element.selectedIndex].value; 
 
            //Create chart object or instance 
            var chart = $("#container").ejChart("instance"); 
 
            //Replace existing points with new points or data 
            for (var i = 0, length = chart.model.series.length; i < length; i++) 
                chart.model.series[i].points = selection == 10 ? data10[i].points : data3[i].points; 
 
            //Redraw the chart widget 
            chart.redraw(); 
        } 

Please refer our online documentation for redraw method in the following link 

Please let us know if we misunderstood your query. 

Regards, 
Anandaraj

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.

Warning Icon 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.Close Icon

;