php Chart 图表

<script src="Chart.min.js"></script>
<div style="width:1200px;">
<canvas id="myChart" style="width:90%"></canvas>
</div>
 
<script>
//https://www.chartjs.org/docs/latest/
var ctx = document.getElementById('myChart').getContext('2d');
var chart = new Chart(ctx, {
    // The type of chart we want to create
    type: 'line',
 
    // The data for our dataset
    data: {
        labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
        datasets: [{
            label: 'My First dataset',
           // backgroundColor: 'rgb(255, 99, 132)',
            //borderColor: 'rgb(255, 99, 132)',
            data: [0, 10, 5, 2, 20, 30, 45]
        },{
            label: 'My First2 dataset',
            data: [90, 10, 5, 20, 40, 60, 90]
        }]
    },
 
    // Configuration options go here
    options: {}
});
</script>


This entry was posted in PHP. Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/php-chart-start/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力.
2020.03.24 评论已经全局关闭,有事加QQ聊天