With Symfony UX, in order to assure that a custom chart could be rendered, I started with the sample from documentation. The rendered page is effectively blank. In the browser's console is this string:
<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>
I interpreted that string to mean that the rendering process got as far as chart.js
. But what later step(s) could prevent the chart from being fully rendered? Earlier step(s)?
assets\controllers.json
:
{
"controllers": {
"@symfony/ux-chartjs": {
"chart": {
"enabled": true,
"fetch": "eager"
}
}
},
"entrypoints": []
}
package.json
includes:
"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
CodePudding user response:
Thankfully(?), there are no discussions of Chart.js at the Mozilla forums. Applying the principle of pressing buttons until things change, I learned that the ad blocker I use was preventing the chart from being rendered. Why That, Firefox?