locked
Dynamic multiple graph RRS feed

  • Question

  • User861911889 posted

    Hi,

    I am working with kendo chart. I have managed to show chart with dynamic data. Now I want to show multiple charts with dynamic data.

    My code

    for (var Counter = 0; Counter < model.length; Counter++) {
    
                var grN = "Total Exposure - " + result;
                var names = [];
                var dataList = [];
                var categoryL = [];
                
                for (var i = 0; i < model[Counter].length; i++) {
                    
                    var this_row = {};
                    var name = "Total Exposure - " + result + " - " + panel;
                    var data = model[Counter][i].Value;
                    var categories = model[Counter][i].Text;
                    this_row["name"] = name;
                    this_row["data"] = data;
                    this_row["categories"] = categories;
    
                    names.push(name);
    
                    dataList.push(data);
    
                    categoryL.push(categories);
                }
    
                data["names"] = names;
                dataBigList.push(dataList);
                catBigList.push(categoryL);
            }
            
            
                $("#chart").kendoChart({
                    title: {
                        text: grN
                    },
                    dataSource: {
                        data: model
                    },
                    legend: {
                        position: "bottom"
                    },
                    chartArea: {
                        background: ""
                    },
                    seriesDefaults: {
                        type: "line",
                        style: "smooth"
                    },
                    series: [{
                        name: names[0],
                        data: dataList
                    }],
                    valueAxis: {
                        min: 0, max: 100,
                        labels: {
                            format: "{0}"
                        },
                        line: {
                            visible: false
                        },
                        axisCrossingValue: -10
                    },
                    categoryAxis: {
                        categories: categoryL,
                        majorGridLines: {
                            visible: false
                        },
                        labels: {
                            rotation: "auto"
                        }
                    },
                    tooltip: {
                        visible: true,
                        format: "{0}",
                        template: "#= series.name #: #= value #"
                    }
                });

    Now it is showing the last graph only as I put data:dataList and categories: categoryL. But when I am replacing it with dataBigList and catBigList, I am not getting any graph.

    Any help would be very much appreciated.

    Tuesday, July 18, 2017 2:12 PM

All replies