我将chart.js与django一起使用,并收到一个错误,因为我没有导入chart.js助手函数getRelativePosition和getValueForPixel
initialize:178 Uncaught TypeError: Cannot read properties of undefined (reading 'getValueForPixel')
at tn.onClick (initialize:178:56)
at tn.handleEvent (Chart.min.js:7:111837)
at tn.eventHandler (Chart.min.js:7:111253)
at n (Chart.min.js:7:110528)
at HTMLCanvasElement.Se.<computed> (Chart.min.js:7:87040)chart.js文档说要用下面的代码导入,但我不认为这在Django中是可以做到的
import { getRelativePosition } from 'chart.js/helpers';https://www.chartjs.org/docs/master/getting-started/integration.html
https://stackoverflow.com/questions/70842448
复制相似问题