ChartJS 我想在Y轴上显示十进制值,但图表不显示数据,如何修复?

vwhgwdsa  于 2022-11-06  发布在  Chart.js
关注(0)|答案(1)|浏览(171)

这是我的图表代码,我的X轴值正确,但Y轴值不工作

<script>

    const config = {
        type: 'line',
        data: {
            datasets: [{
                data: <%=lineData%>
            }]
        },
        options: {
            scales: {
                yAxes: [{
                    ticks: {
                        beginAtZero: true,
                        stepSize: 2
                    }
                }]
            }
        }

    };
</script>

<script>
const myChart = new Chart(
    document.getElementById('myChart'),
    config
);
</script>

and this is my chart,
debugged value is correct but they does not on my chart

o0lyfsai

o0lyfsai1#

问题是y轴值上的“,”,请将其更改为“.”

data: [{x: 17.05.2022 19:44:47, y: 28.28}]

相关问题