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

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

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

  1. <script>
  2. const config = {
  3. type: 'line',
  4. data: {
  5. datasets: [{
  6. data: <%=lineData%>
  7. }]
  8. },
  9. options: {
  10. scales: {
  11. yAxes: [{
  12. ticks: {
  13. beginAtZero: true,
  14. stepSize: 2
  15. }
  16. }]
  17. }
  18. }
  19. };
  20. </script>
  21. <script>
  22. const myChart = new Chart(
  23. document.getElementById('myChart'),
  24. config
  25. );
  26. </script>

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

o0lyfsai

o0lyfsai1#

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

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

相关问题