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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Rebind data in Column range chart

Thread ID:

Created:

Updated:

Platform:

Replies:

141277 Dec 4,2018 04:09 AM UTC Dec 4,2018 03:54 PM UTC ASP.NET MVC - EJ 2 1
loading
Tags: Chart
jsu
Asked On December 4, 2018 04:09 AM UTC

Hi Team,

Could you please here; I want to rebind the column range chart after successful ajax call.


Thanks

Kalaimathi Chellaiah [Syncfusion]
Replied On December 4, 2018 03:54 PM UTC

Hi Jsu, 
 
Greetings from Syncfusion. 
 
We have analyzed your requirement and we have created sample based on  that. In this sample initially we have created empty chart, then get the data from the controller to view page using ajax call in a button click event and bind to the chart. 
 
Code Snippet: 
chartController.cs 
//Getting data from this class 
public class ChartData 
        { 
         …. 
        } 
 
chartFeatures.cshtml: 
//Button click method 
function refreshChart() { 
        var chart = document.getElementById("container").ej2_instances[0]; 
        $.ajax({ 
            type: "GET", 
            url: "./GetChartData", 
            data: {}, 
            dataType: "json", 
            contentType: "application/json;charset=utf-8", 
            success: function (data) { 
                chart.series[0].type = "RangeColumn" 
                chart.series[0].dataSource = data; 
                chart.series[0].xName = "xValue"; 
                chart.series[0].low = "low"; 
                chart.series[0].high = "high"; 
                chart.refresh(); 
            }, 
            error: function (args) { 
                alert('error'); 
            } 
        }); 
    } 
 
Screenshot: 
Empty Chart: 
 
Chart with Data: 
 
 
Regards, 
kalai 
 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon