dskzpt/typo3-ux-chartjs
在PHP和Fluid中轻松构建和渲染Chart.js图表
1.0.0
2024-03-07 08:59 UTC
Requires
- ssch/typo3-encore: ^5.0.5
- symfony/ux-chartjs: ^2.16
Requires (Dev)
- ergebnis/composer-normalize: ^2.24
- friendsoftypo3/phpstan-typo3: ^0.9.0
- phpstan/extension-installer: ^1.2
- typo3/coding-standards: ^0.6.1
This package is auto-updated.
Last update: 2024-09-07 10:20:58 UTC
README
TYPO3扩展 "typo3-ux-chartjs"
它做什么?
在PHP和Fluid模板中轻松构建Chart.js并渲染它们。
它作为symfony/ux-chartjs软件包的包装器。
安装
推荐使用Composer安装扩展。在基于Composer的TYPO3项目根目录中,只需运行
composer require dskzpt/typo3-ux-chartjs
设置
在开始之前,请确保您已安装EXT:typo3_encore。此扩展将Webpack Encore集成到TYPO3中。
此外
# Add this line to your package.json dependencies:
"@symfony/ux-chartjs": "file:vendor/symfony/ux-chartjs/assets",
# Install Chart.js
$ npm i chartjs
# or
$ yarn add chartjs
# Add these lines to your controllers.json:
"@symfony/ux-chartjs": {
"chart": {
"enabled": true,
"fetch": "eager"
}
},
# run
$ npm install --force
$ npm run watch
# or
$ yarn install --force
$ yarn watch
使用方法
在任何Fluid模板中:只需注册命名空间,然后使用提供的ViewHelper来渲染您的图表
<html xmlns:ux="http://typo3.org/ns/DSKZPT/UX/Chartjs/ViewHelpers">
<ux:renderChart chart="{chart}" />
</html>
请参阅symfony/ux-chartjs文档以获取更多信息。
贡献
请参阅此存储库中包含的贡献文档。