Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:16:39+00:00 2026-06-11T17:16:39+00:00

I have a Kendo Chart defined on my cshtml page as below: @(Html.Kendo().Chart<MyModel>() .Name(chart)

  • 0

I have a Kendo Chart defined on my cshtml page as below:

@(Html.Kendo().Chart<MyModel>()
        .Name("chart")
        .Title("")
        .Legend(legend => legend
            .Visible(false)
        )
        .Series(series =>
         {
                    series.Scatter(model => model.X, model => model.Y);
                    series.Scatter(model => model.X, model => model.Y);
        })
        )

I need to set the data of each of these series using a JQuery call.
My JQuery call and returning data works fine, and the below will populate the first series data:

 function GetChartData(ex,ten) {
            var str = "{'arg': '" + ex + "', 'arg2': '" + ten ' }";
            $.ajax({
                type: 'POST',
                url: '/Controller/CreateChartData',
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                data: str ,
                success: function (data) {

                    var grid = $("#chart").data("kendoChart");
                    grid.dataSource.data(data.ChartData);
                    grid.refresh();

                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(thrownError);
                }
            });

I am however, unable to set the second series data.
I have tried the following which rendered nothing on the chart:

 function GetChartData(ex,ten) {
            var str = "{'arg': '" + ex + "', 'arg2': '" + ten ' }";
            $.ajax({
                type: 'POST',
                url: '/Controller/CreateChartData',
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                data: str ,
                success: function (data) {

                    var grid = $("#chart").data("kendoChart");
            grid.options.series[0].data = data.ChartData;
           grid.options.series[1].data = data.ChartDataSeries2; 

                    grid.refresh();

                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(thrownError);
                }
            });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:16:40+00:00Added an answer on June 11, 2026 at 5:16 pm

    Something you might try, is to not initialize that chart until after you have all the data.

    That way instead of calling refresh() you can pass both series to the .kendoChart() method

    function GetChartData(ex,ten) {
            var str = "{'arg': '" + ex + "', 'arg2': '" + ten ' }";
            $.ajax({
                type: 'POST',
                url: '/Controller/CreateChartData',
                dataType: "json",
                contentType: "application/json; charset=utf-8",
                data: str ,
                success: function (data) {
    
                     $("#chart").kendoChart({
                        theme: $(document).data("kendoSkin") || "default",
                        title: {
                            text: "Example"
                        },
                        legend: {
                            visible: true
                        },
                        seriesDefaults: {
                            type: "scatterLine"
                        },
                        series: [{
                            name: "series1",
                            data: data.ChartData
                        }, {
                            name: "series2",
                            data: data.ChartDataSeries2
                        }, {
                            name: "series3",
                            data: data.ChartDataSeries3
                        }]
                    });
                }
    
                },
                error: function (xhr, ajaxOptions, thrownError) {
                    alert(xhr.status);
                    alert(thrownError);
                }
            });
    

    Working aspx example page:

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="GraphTest.aspx.cs" Inherits="GraphTest" %>
    

    <link rel="stylesheet" href="/css/kendo.common.min.css" />
    <link rel="stylesheet" href="/css/kendo.metro.min.css" />
    <link rel="stylesheet" href="/css/kendo.kendo.min.css" />
    
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script>        window.jQuery || document.write('<script src="/js/libs/jquery-1.7.1.min.js"><\/script>')</script>
    <script src="/js/libs/kendo.all.min.js" type="text/javascript"></script>
    <title></title>
    

        <div id="example" class="k-content">
            <div class="chart-wrapper">
                <div id="chart"></div>
            </div>
            <script>
                function createChart() {
    
                    var data1 = [[10, 10], [15, 20], [20, 25], [32, 40], [43, 50], [55, 60], [60, 70], [70, 80], [90, 100]];
    
                    $("#chart").kendoChart({
                        theme: $(document).data("kendoSkin") || "default",
                        title: {
                            text: "Charge current vs. charge time"
                        },
                        legend: {
                            visible: true
                        },
                        seriesDefaults: {
                            type: "scatterLine"
                        },
                        series: [{
                            name: "0.8C",
                            data: data1
                        }, {
                            name: "1.6C",
                            data: [[10, 40], [17, 50], [18, 70], [35, 90], [47, 95], [60, 100]]
                        }, {
                            name: "3.1C",
                            data: [[10, 70], [13, 90], [25, 100]]
                        }],
                        xAxis: {
                            max: 90,
                            labels: {
                                format: "{0}m"
                            },
                            title: {
                                text: "Time"
                            }
                        },
                        yAxis: {
                            max: 100,
                            labels: {
                                format: "{0}%"
                            },
                            title: {
                                text: "Charge"
                            }
                        },
                        tooltip: {
                            visible: true,
                            format: "{1}% in {0} minutes"
                        }
                    });
                }
    
                $(document).ready(function () {
                    setTimeout(function () {
                        // Initialize the chart with a delay to make sure
                        // the initial animation is visible
                        createChart();
    
                        $("#example").bind("kendo:skinChange", function (e) {
                            createChart();
                        });
                    }, 400);
                });
            </script>
        </div>
    
    
    </div>
    </form>
    

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a Kendo Chart in a razor view and have .Tooltip(tooltip => tooltip.Visible(true))
I have a problem in binding JSON data to KENDO Pie Chart. I have
I am using Ryan Niemeyer`s Knockout-Kendo.js library. I have a kendodropdown defined like this:
I have a kendo ui line chart setup with about 80 data points. These
I have 2 questions on kendo combobox change event. On change event I want
I have created a mobile application using kendo Mobile UI's trial version in asp.net
I have a problem to configure the Kendo-Ui with Combo-box with custom values. I
I'm using editor from Kendo UI, so I have big problem. I don't know
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have created a kendo.data.dataSource with success, and I am able to bind it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.