Kendoui bar chart set series on click of a button
<p>I am working with KendoUI bar chart. Please check this <a href="http://dojo.telerik.com/oTeTi" rel="nofollow">fiddle</a>. In this fiddle I am setting <code>series</code> config at the design time. I want to add <code>series</code> to the chart at run time on click of a button. How can I add <code>series</code> to kendo chart on click of a button. </p>

<p><strong>Currently <code>series</code> is assigned at the design time, i want to do the same at the run time on click of a button.</strong> </p>

<p>Code:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://demos.telerik.com/kendo-ui/bar-charts/grouped-stacked-bar"&gt;
    &lt;style&gt;html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }&lt;/style&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.112/styles/kendo.common-material.min.css" /&gt;
    &lt;link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.1.112/styles/kendo.material.min.css" /&gt;

    &lt;script src="//kendo.cdn.telerik.com/2016.1.112/js/jquery.min.js"&gt;&lt;/script&gt;
    &lt;script src="//kendo.cdn.telerik.com/2016.1.112/js/kendo.all.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="example"&gt;
    &lt;div class="demo-section k-content wide"&gt;
        &lt;div id="chart"&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;script&gt;
        function createChart() {
            $("#chart").kendoChart({
                title: {
                    text: "World population by age group and sex"
                },
                legend: {
                    visible: false
                },
                seriesDefaults: {
                    type: "column"
                },
                series: [{
                    name: "0-19",
                    stack: "Female",
                    data: [854622, 925844, 984930, 1044982, 1100941, 1139797, 1172929, 1184435, 1184654]
                }, {
                    name: "20-39",
                    stack: "Female",
                    data: [490550, 555695, 627763, 718568, 810169, 883051, 942151, 1001395, 1058439]
                }, {
                    name: "40-64",
                    stack: "Female",
                    data: [379788, 411217, 447201, 484739, 395533, 435485, 499861, 569114, 655066]
                }, {
                    name: "65-79",
                    stack: "Female",
                    data: [97894, 113287, 128808, 137459, 152171, 170262, 191015, 210767, 226956]
                }, {
                    name: "80+",
                    stack: "Female",
                    data: [16358, 18576, 24586, 30352, 36724, 42939, 46413, 54984, 66029]
                }, {
                    name: "0-19",
                    stack: "Male",
                    data: [900268, 972205, 1031421, 1094547, 1155600, 1202766, 1244870, 1263637, 1268165]
                }, {
                    name: "20-39",
                    stack: "Male",
                    data: [509133, 579487, 655494, 749511, 844496, 916479, 973694, 1036548, 1099507]
                }, {
                    name: "40-64",
                    stack: "Male",
                    data: [364179, 401396, 440844, 479798, 390590, 430666, 495030, 564169, 646563]
                }, {
                    name: "65-79",
                    stack: "Male",
                    data: [74208, 86516, 98956, 107352, 120614, 138868, 158387, 177078, 192156]
                }, {
                    name: "80+",
                    stack: "Male",
                    data: [9187, 10752, 13007, 15983, 19442, 23020, 25868, 31462, 39223]
                }],
                seriesColors: ["#cd1533", "#d43851", "#dc5c71", "#e47f8f", "#eba1ad",
                               "#009bd7", "#26aadd", "#4db9e3", "#73c8e9", "#99d7ef"],
                valueAxis: {
                    labels: {
                        template: "#= kendo.format('{0:N0}', value / 1000) # M"
                    },
                    line: {
                        visible: false
                    }
                },
                categoryAxis: {
                    categories: [1970, 1975, 1980, 1985, 1990, 1995, 2000, 2005, 2010],
                    majorGridLines: {
                        visible: false
                    }
                },
                tooltip: {
                    visible: true,
                    template: "#= series.stack #s, age #= series.name #"
                }
            });
        }

        $(document).ready(createChart);
        $(document).bind("kendo:skinChange", createChart);
    &lt;/script&gt;
&lt;/div&gt;


&lt;/body&gt;
&lt;/html&gt;
</code></pre>