在Symfony UX中,为了确保可以呈现自定义图表,我从文档中的示例开始。呈现的页面实际上是空白的。在浏览器的控制台中是这样的字符串:
<canvas data-controller="symfony--ux-chartjs--chart" data-symfony--ux-chartjs--chart-view-value="{"type":"line","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]}]},"options":{"scales":{"y":{"suggestedMin":0,"suggestedMax":10}}}}"></canvas>
我将该字符串解释为表示呈现过程已经进行到chart.js
,但是后面的哪些步骤可能会阻止图表完全呈现?前面的步骤?assets\controllers.json
:
{
"controllers": {
"@symfony/ux-chartjs": {
"chart": {
"enabled": true,
"fetch": "eager"
}
}
},
"entrypoints": []
}
package.json
包括:
"devDependencies": {
...
"@symfony/ux-chartjs": "file:vendor/symfony/ux-chartjs/assets",
...
"chart.js": "^3.4.1",
...
}
../node_modules/chart.js/dist/chart.js
:Chart.js v3.9.1
1条答案
按热度按时间vhmi4jdf1#
谢天谢地(?),Mozilla论坛上没有关于Chart.js的讨论。应用按钮直到事情发生变化的原则,我了解到我使用的广告拦截器阻止了图表的呈现。