Chartjs-C# MVC5 View dynamically filled Chart.js dont show up

0๐Ÿ‘

โœ…

Iโ€™ve managed to resolve this problem on my own with the following modifications.

$.getJSON("/AdminLte/GetData", function (data) {
            $.each(data, function (i, item) {
                chartlabels[i] = item._DATE;
                cons[i] = item.CONSUMPTION;
                prod[i] = item.PRODUCTION;
            })
            var ctx = new Chart(document.getElementById("trendChart").getContext("2d")).Line(datachart, trendChartOptions);
        });
    });

Leave a comment