我的最后一栏没有显示,我使用chart.js 2.5

时间:2017-03-18 06:40:02

标签: chart.js

我的最后一栏没有显示,我使用chart.js 2.5,框架是用laravel 5.4,数据已经确认进入传入。

看看这个数字:

Look at this figure

数据已进入传入:

data has been into the incoming

var ctxBar = $('#barChart');
var data2 = {
    labels: {!!json_encode($project_names, JSON_UNESCAPED_UNICODE) !! },
    datasets: [{
        backgroundColor: [
            'rgba(255, 99, 132, 0.2)'
        ],
        borderColor: [
            'rgba(255,99,132,1)'
        ],
        borderWidth: 2,
        data: {!!json_encode(TasksCountArray($projects), JSON_UNESCAPED_UNICODE) !! }
    }]
};

var myBarChart = new Chart(ctxBar, {
    type: 'bar',
    data: data2,
    options: {
        responsive: true,
        title: {
            display: true,
            text: 'Projects Tasks'
        },
        legend: {
            display: false
        },
        fullWidth: true
    }
});

0 个答案:

没有答案