我正在尝试在X轴上放置时间刻度。我试图在下面编写一个更简单且可复制的代码。 我可以通过删除options块使其正常运行,但它会将时间显示为对观看者来说只是表面上毫无意义的数字。如何在X轴上显示时间?我是否缺少一些外部资源?
注意1:javascript文件是一个单独的文件,画布/元素“ myChart”位于html文件中。
HTML:
<script src="https://www.chartjs.org/dist/2.8.0/Chart.min.js"></script>
<canvas id="myChart" style="position: relative; width: 100%; max-height: 500px; max-width: 1000px;" ></canvas>
Run Code Online (Sandbox Code Playgroud)
错误:(myScript.js是有问题的文件)
Chart.min.js:7 Uncaught Error: This method is not implemented: either no adapter can be found or an incomplete integration was provided.
at ri.oi (Chart.min.js:7)
at i.update (Chart.min.js:7)
at Chart.min.js:7
at Object.each (Chart.min.js:7)
at Object.update (Chart.min.js:7)
at ni.updateLayout (Chart.min.js:7)
at ni.update (Chart.min.js:7)
at ni.construct (Chart.min.js:7)
at new ni (Chart.min.js:7)
at myScript.js:191
oi @ Chart.min.js:7
update @ Chart.min.js:7
(anonymous) @ Chart.min.js:7 …Run Code Online (Sandbox Code Playgroud)