This is a migrated thread and some comments may be shown as answers.

Chart does not update after datasource read

8 Answers 571 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 16 Apr 2019, 08:00 PM

NetCore 3.0.0-preview3-27503-5 
Telerik.UI.for.AspNet.Core Nuget package v2019.1.412-internal
Visual Studio 2019 v16.0.1

I have a view with multiple line charts, bar charts and pie charts. I have a view model that contains the data for each graph as well as labels and colours. I am using DataSource read and passing an extra parameter which is a date from a kendo date picker control. The controller function is correctly called and the view model populated and returned. I can see from the visual studio output window that there are no errors and using the Network tab in Chrome developer tools the data is correctly returned with a status 200. However when i change the date to a month where i have no data the graph is refreshed once when the date picker is closed and once again when i think it should be populated with the updated view model returned from the read. However the graph shows the previous data. Again using the Network tab I can see that the data is nulls as expected. I have included my code below. Looking at the examples, mostly which are for the Grid control, they return a list from the controller function and use the ToDataSourceResult() function. I have tried return Json(new [] {vm}.ToDataSourceResult()); with no success. Could you explain where I am going wrong

 

The attached image shows the data returned for March but the partial graph still showing the data for April

<!-- view snippet -->
<div class="row">
    <div class="col-12 col-sm-4 col-md-3 col-md-2">
        <div id="month" class="k-content">
            <h5 style="margin-top: 2em;">Select month:</h5>
            @(Html.Kendo().DatePicker()
              .Name("monthpicker")
              .Start(CalendarView.Year)
              .Depth(CalendarView.Year)
              .Format("MMMM yyyy")
              .Events(e => e.Change("monthpickerChange"))
              .Max(DateTime.Now)
              .Value(value)
              .Footer(false)
              .HtmlAttributes(new { style = "width: 100%", title = "monthpicker" })
            )
        </div>
    </div>
</div>

<div class="row">
    <div class="col-12 col-sm-12">
        <div class="k-content wide">
            @(Html.Kendo().Chart<CustomerSurveyViewModel>()
                .Name("chartMonthlyRatings")
                .Title($"Ratings for {DateTime.Now.ToString("MMMM, yyyy")}")
                .Legend(legend => legend
                    .Position(ChartLegendPosition.Bottom)
                )
                .DataSource(datasource =>
                {
                    datasource.Read(read =>
                    {
                        read.Action("GetRatingsForMonth", "Home").Data("getMonthDate");
                    });
                })
                .ChartArea(chartArea => chartArea
                    .Background("transparent")
                )
                .SeriesDefaults(seriesDefaults =>
                    seriesDefaults.Line().Style(ChartLineStyle.Smooth)
                )
                .Series(series =>
                {
                    series.Line(Model.MonthRatings1).Name(Model.Names[0]);
                    series.Line(Model.MonthRatings2).Name(Model.Names[1]);
                    series.Line(Model.MonthRatings3).Name(Model.Names[2]);
                    series.Line(Model.MonthRatings4).Name(Model.Names[3]);
                    series.Line(Model.MonthRatings5).Name(Model.Names[4]);
                })
                .SeriesColors(Model.Colours.ToArray<string>())
                .CategoryAxis(axis => axis
                    .Categories("01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
                                "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
                                "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
                                "31")
                    .MajorGridLines(lines => lines.Visible(false))
                )
                .ValueAxis(axis => axis
                    .Numeric().Labels(labels => labels.Format("{0}"))
                    .Line(line => line.Visible(false))
                    .AxisCrossingValue(0)
                )
                .Tooltip(tooltip => tooltip
                    .Visible(true)
                    .Format("{0}")
                )
            )
        </div>
    </div>
</div>

        [HttpPost]
        public async Task<IActionResult> GetRatingsForMonth(DateTime dateSelected)
        {
            int daysInMonth = DateTime.DaysInMonth(dateSelected.Year, dateSelected.Month);
            var existingEntries = await firebaseClient.Child("CustomerSurveys")
                                                      .OrderByKey()
                                                      .OnceAsync<CustomerSurvey>();

            var data = existingEntries.Where(x => (x.Object.TimeStamp.Month == dateSelected.Month &&
                                                   x.Object.TimeStamp.Year == dateSelected.Year))
                                      .Select(x => x.Object);

            CustomerSurveyViewModel vm = new CustomerSurveyViewModel();
            for (int i = 1; i <= daysInMonth; i++)
            {
                var count = data.Where(x => (x.Rating == 1 && (int)x.TimeStamp.Day == i)).Select(x => x).Count();
                if (count > 0)
                    vm.MonthRatings1.Add(count);
                else
                    vm.MonthRatings1.Add(null);
            }
            for (int i = 1; i <= daysInMonth; i++)
            {
                var count = data.Where(x => (x.Rating == 2 && (int)x.TimeStamp.Day == i)).Select(x => x).Count();
                if (count > 0)
                    vm.MonthRatings2.Add(count);
                else
                    vm.MonthRatings2.Add(null);
            }
            for (int i = 1; i <= daysInMonth; i++)
            {
                var count = data.Where(x => (x.Rating == 3 && (int)x.TimeStamp.Day == i)).Select(x => x).Count();
                if (count > 0)
                    vm.MonthRatings3.Add(count);
                else
                    vm.MonthRatings3.Add(null);
            }
            for (int i = 1; i <= daysInMonth; i++)
            {
                var count = data.Where(x => (x.Rating == 4 && (int)x.TimeStamp.Day == i)).Select(x => x).Count();
                if (count > 0)
                    vm.MonthRatings4.Add(count);
                else
                    vm.MonthRatings4.Add(null);
            }
            for (int i = 1; i <= daysInMonth; i++)
            {
                var count = data.Where(x => (x.Rating == 5 && (int)x.TimeStamp.Day == i)).Select(x => x).Count();
                if (count > 0)
                    vm.MonthRatings5.Add(count);
                else
                    vm.MonthRatings5.Add(null);
            }

            return Json(vm);
        }

 

// View Model
    public class CustomerSurveyViewModel
    {
        public List<int> BeginningOfTime { get; set; } = new List<int>();

        public List<int?> ThisWeeksRatings1 { get; set; } = new List<int?>();
        public List<int?> ThisWeeksRatings2 { get; set; } = new List<int?>();
        public List<int?> ThisWeeksRatings3 { get; set; } = new List<int?>();
        public List<int?> ThisWeeksRatings4 { get; set; } = new List<int?>();
        public List<int?> ThisWeeksRatings5 { get; set; } = new List<int?>();

        public List<int?> LastWeeksRatings1 { get; set; } = new List<int?>();
        public List<int?> LastWeeksRatings2 { get; set; } = new List<int?>();
        public List<int?> LastWeeksRatings3 { get; set; } = new List<int?>();
        public List<int?> LastWeeksRatings4 { get; set; } = new List<int?>();
        public List<int?> LastWeeksRatings5 { get; set; } = new List<int?>();

        public List<int?> DateRatings1 { get; set; } = new List<int?>();
        public List<int?> DateRatings2 { get; set; } = new List<int?>();
        public List<int?> DateRatings3 { get; set; } = new List<int?>();
        public List<int?> DateRatings4 { get; set; } = new List<int?>();
        public List<int?> DateRatings5 { get; set; } = new List<int?>();

        public List<int?> MonthRatings1 { get; set; } = new List<int?>();
        public List<int?> MonthRatings2 { get; set; } = new List<int?>();
        public List<int?> MonthRatings3 { get; set; } = new List<int?>();
        public List<int?> MonthRatings4 { get; set; } = new List<int?>();
        public List<int?> MonthRatings5 { get; set; } = new List<int?>();

        public List<int?> YearRatings1 { get; set; } = new List<int?>();
        public List<int?> YearRatings2 { get; set; } = new List<int?>();
        public List<int?> YearRatings3 { get; set; } = new List<int?>();
        public List<int?> YearRatings4 { get; set; } = new List<int?>();
        public List<int?> YearRatings5 { get; set; } = new List<int?>();

        public List<string> Categories { get; set; } = new List<string>();
        // colours
        public List<string> Colours { get; set; } = new List<string>();
        // names
        public List<string> Names { get; set; } = new List<string>();


        public CustomerSurveyViewModel()
        {
            Colours.Add("#E21E2B");
            Colours.Add("#F4572E");
            Colours.Add("#FCB040");
            Colours.Add("#91CA61");
            Colours.Add("#3DB449");

            Names.Add("Extremely Disatisfied");
            Names.Add("Not Happy");
            Names.Add("Neutral");
            Names.Add("Happy");
            Names.Add("Very Happy");
        }
    }

        function monthpickerChange(e) {
            var date = this.value();
            var chart = $("#chartMonthlyRatings").data("kendoChart");
            chart.setOptions({
                title: {
                    text: "Ratings for " + moment(date).format("MMMM, YYYY")
                }
            });
            chart.dataSource.read();
            chart.dataSource.refresh();     // not sure if i need refresh or if read is enough
        }

        function getMonthDate() {
            var datepicker = $("#monthpicker").data("kendoDatePicker");
            var date = datepicker.value();
            return { dateSelected: date.toISOString() };
        }

8 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 19 Apr 2019, 12:20 PM
Hello Derek,

One thing I notice is that the series do not declare field binding. They seem to be bound to the view model directly:
.Series(series =>
{
    series.Line(Model.MonthRatings1).Name(Model.Names[0]);
    series.Line(Model.MonthRatings2).Name(Model.Names[1]);
    series.Line(Model.MonthRatings3).Name(Model.Names[2]);
    series.Line(Model.MonthRatings4).Name(Model.Names[3]);
    series.Line(Model.MonthRatings5).Name(Model.Names[4]);
})

In order for the series to be properly bound to the DataSource data, they need to be bound to the fields of the Chart model:
@(Html.Kendo().Chart<CustomerSurveyViewModel>()
    .Name("chartMonthlyRatings")
    .Title($"Ratings for {DateTime.Now.ToString("MMMM, yyyy")}")
    .Legend(legend => legend
        .Position(ChartLegendPosition.Bottom)
    )
    .DataSource(datasource =>
    {
        datasource.Read(read =>
        {
            read.Action("GetRatingsForMonth", "Home").Data("getMonthDate");
        });
    })
    .ChartArea(chartArea => chartArea
        .Background("transparent")
    )
    .SeriesDefaults(seriesDefaults =>
        seriesDefaults.Line().Style(ChartLineStyle.Smooth)
    )
    .Series(series =>
    {
        series.Line(model => model.MonthRatings1).Name(Model.Names[0]);
        series.Line(model => model.MonthRatings2).Name(Model.Names[1]);
        series.Line(model => model.MonthRatings3).Name(Model.Names[2]);
        series.Line(model => model.MonthRatings4).Name(Model.Names[3]);
        series.Line(model => model.MonthRatings5).Name(Model.Names[4]);
    })

Also, you would need to perform Step 5 from this instruction in order to keep the correct casing of field names returned by .NET Core:
ASP.NET Core Project Configuration (see the ConfigureServices snippet)

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Derek
Top achievements
Rank 1
answered on 19 Apr 2019, 10:37 PM

Thanks for your reply. 
I had previously tried your binding suggestion with no success, however i did not know about step 5. I changed my code and for net core 3 i had to use 

           services.AddMvc().AddNewtonsoftJson(options => 
                    options.SerializerSettings.ContractResolver = new DefaultContractResolver());

 

(Source: https://stackoverflow.com/questions/55666826/where-did-imvcbuilder-addjsonoptions-go-in-net-core-3-0)

However, now I get an empty chart irrespective of month selected.


0
Tsvetina
Telerik team
answered on 22 Apr 2019, 10:58 AM
Hi Derek,

Could you check the response from the GetRatingsForMonth method and show us an example of the response format? Also, while inspecting the response of the Read request, check for any JavaScript errors, while loading the Chart.
We should find out if the problem is with the format of the data, the configuration of the Chart or some other logic breaking the client script execution.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Derek
Top achievements
Rank 1
answered on 23 Apr 2019, 09:47 PM

Hi Tsvetina

I have returned my design to netcore 2.2 and kendo net core to 2019.1.220 with client side mvc 2019.1.220. I have checked the console window and there are no errors. The response sent from the controller and the contents of the Network Tab within Chrome is below. Just in case this helps, my design uses a Kendo Tab Strip within a view. A different partial view is loaded by the tabstrip when each tab is selected. The partial view contains the charts. At the top of each partial view I declare @model ExitSurvey.ViewModels.CustomerSurveyViewModel. 

 

Using Chrome Network & right click "Copy > Copy Response"

{"BeginningOfTime":[],"ThisWeeksRatings1":[],"ThisWeeksRatings2":[],"ThisWeeksRatings3":[],"ThisWeeksRatings4":[],"ThisWeeksRatings5":[],"LastWeeksRatings1":[],"LastWeeksRatings2":[],"LastWeeksRatings3":[],"LastWeeksRatings4":[],"LastWeeksRatings5":[],"DateRatings1":[],"DateRatings2":[],"DateRatings3":[],"DateRatings4":[],"DateRatings5":[],"MonthRatings1":[null,null,1,null,1,null,null,2,1,2,1,10,null,null,1,1,7,null,null,null,null,null,null,null,null,null,null,null,null,null],"MonthRatings2":[null,1,3,null,1,null,null,2,2,3,1,2,null,null,1,2,2,null,null,null,null,null,null,null,null,null,null,null,null,null],"MonthRatings3":[null,3,3,null,1,null,null,6,5,8,7,1,null,null,1,5,2,null,null,null,null,null,null,null,null,null,null,null,null,null],"MonthRatings4":[null,2,2,null,4,null,null,11,5,3,9,4,null,null,8,7,3,null,null,null,null,null,null,null,null,null,null,null,null,null],"MonthRatings5":[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"YearRatings1":[],"YearRatings2":[],"YearRatings3":[],"YearRatings4":[],"YearRatings5":[],"Categories":[],"Colours":["#E21E2B","#F4572E","#FCB040","#91CA61","#3DB449"],"Names":["Extremely Disatisfied","Not Happy","Neutral","Happy","Very Happy"]}


Watch Window - View Modal returned from GetRatingsForMonth method

-vm{ExitSurvey.ViewModels.CustomerSurveyViewModel}ExitSurvey.ViewModels.CustomerSurveyViewModel
+BeginningOfTimeCount = 0System.Collections.Generic.List<int>
+CategoriesCount = 0System.Collections.Generic.List<string>
-ColoursCount = 5System.Collections.Generic.List<string>
[0]"#E21E2B"string
[1]"#F4572E"string
[2]"#FCB040"string
[3]"#91CA61"string
[4]"#3DB449"string
+Raw View
+DateRatings1Count = 0System.Collections.Generic.List<int?>
+DateRatings2Count = 0System.Collections.Generic.List<int?>
+DateRatings3Count = 0System.Collections.Generic.List<int?>
+DateRatings4Count = 0System.Collections.Generic.List<int?>
+DateRatings5Count = 0System.Collections.Generic.List<int?>
+LastWeeksRatings1Count = 0System.Collections.Generic.List<int?>
+LastWeeksRatings2Count = 0System.Collections.Generic.List<int?>
+LastWeeksRatings3Count = 0System.Collections.Generic.List<int?>
+LastWeeksRatings4Count = 0System.Collections.Generic.List<int?>
+LastWeeksRatings5Count = 0System.Collections.Generic.List<int?>
-MonthRatings1Count = 30System.Collections.Generic.List<int?>
[0]nullint?
[1]nullint?
[2]1int?
[3]nullint?
[4]1int?
[5]nullint?
[6]nullint?
[7]2int?
[8]1int?
[9]2int?
[10]1int?
[11]10int?
[12]nullint?
[13]nullint?
[14]1int?
[15]1int?
[16]7int?
[17]nullint?
[18]nullint?
[19]nullint?
[20]nullint?
[21]nullint?
[22]nullint?
[23]nullint?
[24]nullint?
[25]nullint?
[26]nullint?
[27]nullint?
[28]nullint?
[29]nullint?
+Raw View
+MonthRatings2Count = 30System.Collections.Generic.List<int?>
+MonthRatings3Count = 30System.Collections.Generic.List<int?>
+MonthRatings4Count = 30System.Collections.Generic.List<int?>
+MonthRatings5Count = 30System.Collections.Generic.List<int?>
-NamesCount = 5System.Collections.Generic.List<string>
[0]"Extremely Disatisfied"string
[1]"Not Happy"string
[2]"Neutral"string
[3]"Happy"string
[4]"Very Happy"string
+Raw View
+ThisWeeksRatings1Count = 0System.Collections.Generic.List<int?>
+ThisWeeksRatings2Count = 0System.Collections.Generic.List<int?>
+ThisWeeksRatings3Count = 0System.Collections.Generic.List<int?>
+ThisWeeksRatings4Count = 0System.Collections.Generic.List<int?>
+ThisWeeksRatings5Count = 0System.Collections.Generic.List<int?>
+YearRatings1Count = 0System.Collections.Generic.List<int?>
+YearRatings2Count = 0System.Collections.Generic.List<int?>
+YearRatings3Count = 0System.Collections.Generic.List<int?>
+YearRatings4Count = 0System.Collections.Generic.List<int?>
+YearRatings5Count = 0System.Collections.Generic.List<int?>


0
Tsvetina
Telerik team
answered on 24 Apr 2019, 12:26 PM
Hello Derek,

I see now why the Chart cannot bind to the data. The data values are put in arrays where each array represents all values for a given series. This is a valid format when binding each series to a property in the page model. However, with a DataSource, the format needs to be different: there needs to be a single set of data items, each item having a value for each series.

So, the data that you showed me should look like this if it is bound to a DataSource:
"MonthRatings1":[null,null,1,null,1,null,...],
"MonthRatings2":[null,1,3,null,1...],
"MonthRatings3":[null,3,3,null,1...],
"MonthRatings4":[null,2,2,null,4,...],
"MonthRatings5":[null,null,null,null,null]
 // should be converted to
[
    { MonthRating1: null, MonthRating2: null, MonthRating3: null, MonthRating4: null, MonthRating5: null },
    { MonthRating1: null, MonthRating2: 1, MonthRating3: 3, MonthRating4: 2, MonthRating5: null },
    { MonthRating1: 1, MonthRating2: 3, MonthRating3: 3, MonthRating4: 2, MonthRating5: null },
    { MonthRating1: null, MonthRating2: null, MonthRating3: null, MonthRating4: null, MonthRating5: null },
    { MonthRating1: 1, MonthRating2: 1, MonthRating3: 1, MonthRating4: 4, MonthRating5: null },
    .....
]

And then the series could be bound like this:
.Series(series =>
{
    series.Line(model => model.MonthRating1);
    series.Line(model => model.MonthRating2);
    series.Line(model => model.MonthRating3);
    series.Line(model => model.MonthRating4);
    series.Line(model => model.MonthRating5);
})



Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Derek
Top achievements
Rank 1
answered on 24 Apr 2019, 10:20 PM

Hi Tsvetina

I understand what you are saying in the first part of your response but I am confused by the model => model.MonthRating1. MonthRating1 is not reachable in the view model.  Perhaps I have misunderstood something.

I updated my code as shown and have included the response from the controller

    public class Rating
    {
        private int? rating1;
        private int? rating2;
        private int? rating3;
        private int? rating4;
        private int? rating5;

        public int? Rating1
        {
            get { return rating1; }
            set {
                if (value == 0)
                    rating1 = null;
                else
                    rating1 = value;
            }
        }
        // ditto for Ratings 2 to 5
    }


    public class CustomerSurveyViewModel
    {
        ...
        public List<Rating> MonthRatings { get; set; } = new List<Rating>();
        ...

        public CustomerSurveyViewModel()
        {
             // Initialise colours and names
             ...
        }
    }

Response
{
"BeginningOfTime":[],
"ThisWeeksRatings":[],
"LastWeeksRatings":[],
"DateRatings":[],
"MonthRatings":[
{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":1,"Rating3":3,"Rating4":2,"Rating5":null},{"Rating1":1,"Rating2":3,"Rating3":3,"Rating4":2,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":1,"Rating2":1,"Rating3":1,"Rating4":4,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":2,"Rating2":2,"Rating3":6,"Rating4":11,"Rating5":null},{"Rating1":1,"Rating2":2,"Rating3":5,"Rating4":5,"Rating5":null},{"Rating1":2,"Rating2":3,"Rating3":8,"Rating4":3,"Rating5":null},{"Rating1":1,"Rating2":1,"Rating3":7,"Rating4":9,"Rating5":null},{"Rating1":10,"Rating2":2,"Rating3":1,"Rating4":4,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":1,"Rating2":1,"Rating3":1,"Rating4":8,"Rating5":null},{"Rating1":1,"Rating2":2,"Rating3":5,"Rating4":7,"Rating5":null},{"Rating1":7,"Rating2":2,"Rating3":2,"Rating4":3,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null}
],
"YearRatings":[],
"Colours":["#E21E2B","#F4572E","#FCB040","#91CA61","#3DB449"],
"Names":["Extremely Disatisfied","Not Happy","Neutral","Happy","Very Happy"]

0
Tsvetina
Telerik team
answered on 26 Apr 2019, 01:34 PM
Hello Derek,

With the current configuration, as long as I follow it correctly, I think the best way to bind the Chart would be the following:

1. Change the Chart model to Rating:
@(Html.Kendo().Chart<Rating>()

2. Bind the series to the Ratings sub fields:
.Series(series =>
{
    series.Line(model => model.Rating1);
    series.Line(model => model.Rating2);
    series.Line(model => model.Rating3);
    series.Line(model => model.Rating4);
    series.Line(model => model.Rating5);
})

3. Change the GetRatingsForMonth method to return only the Ratings data:
[
{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":1,"Rating3":3,"Rating4":2,"Rating5":null},{"Rating1":1,"Rating2":3,"Rating3":3,"Rating4":2,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":1,"Rating2":1,"Rating3":1,"Rating4":4,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":2,"Rating2":2,"Rating3":6,"Rating4":11,"Rating5":null},{"Rating1":1,"Rating2":2,"Rating3":5,"Rating4":5,"Rating5":null},{"Rating1":2,"Rating2":3,"Rating3":8,"Rating4":3,"Rating5":null},{"Rating1":1,"Rating2":1,"Rating3":7,"Rating4":9,"Rating5":null},{"Rating1":10,"Rating2":2,"Rating3":1,"Rating4":4,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":1,"Rating2":1,"Rating3":1,"Rating4":8,"Rating5":null},{"Rating1":1,"Rating2":2,"Rating3":5,"Rating4":7,"Rating5":null},{"Rating1":7,"Rating2":2,"Rating3":2,"Rating4":3,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null},{"Rating1":null,"Rating2":null,"Rating3":null,"Rating4":null,"Rating5":null}
]

If you need to use the rest of the data CustomerSurveyViewModel in the page or in the Chart, you can return the CustomerSurveyViewModel object as a View model or through ViewBag/ViewData.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Derek
Top achievements
Rank 1
answered on 28 Apr 2019, 07:33 PM

Hi Tsvetina,

That's it working now, thanks for all your help. I now understand what is happening when using the DataSource.

Derek

Tags
Chart
Asked by
Derek
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Derek
Top achievements
Rank 1
Share this question
or