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

Chart, dynamically loading the series

1 Answer 185 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 18 Dec 2015, 10:17 AM

Hi,
I want to see only one series visible on page load. I have dynamically loading the series:

.Series(series =>
    {
       foreach (var def in Model.Series)
       {
             series.Column(def.Value).Name(def.Years);

              //.Visible(just year "2014")
       }
     })

Thanks,

Victor

1 Answer, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 22 Dec 2015, 11:51 AM
Hi Victor,

For this scenario I would suggest the following approach:
- Define only one series initially by specifying series.field. For working example check this online demo;
- Dynamically add series via the chart.options.
// get a reference to the chart widget
var chart = $("#chart").data("kendoChart");
// add series
chartOptions.series.push({});
//....
// set field to a particular series
chart.options.series[1].field = "value"
//refresh the chart
chart.refresh();


Regards,
Iliana Nikolova
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Victor
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Share this question
or