chart.js - 半甜甜圈,带有指向进度 Chart.js 的箭头
问题描述
我想要一个带有显示当前进度的简单指针的半圆环图。
是否有可能实现以下目标:(忽略糟糕的重叠边界)
我目前有这个:
目前我已经通过 PHP 使用选项数组设置它,因为我正在使用 quickchart.io 在 PDF 中呈现图像。您可以在下面找到我当前使用的配置。
$options = [
'type' => 'doughnut',
'data' => [
'labels' => ["Red", "Orange", "Green"],
'datasets' => [
[
'label' => 'Doel',
'data' => ['120', '60'],
'backgroundColor' => [
'rgba(255,99,132,1)',
'rgba(0,0,0,0.1)'
],
'borderWidth' => 0
]]
],
'options' => [
'rotation' => M_PI,
'circumference' => M_PI,
'cutoutPercentage' => 75,
'legend' => [
'display' => false
],
'tooltip' => [
'enabled' => false
],
'plugins' => [
'datalabels' => ['display' => false],
'doughnutlabel' => [
'labels' => [
['text' => ''],
['text' => ''],
['text' => ''],
[
'text' => '80%',
'color' => '#000',
'font' => [
'size' => '30'
]
]
]
]
],
]
];
解决方案
推荐阅读
- python - 为什么 python3 在 PyCharm 中抛出异常时没有命中断点并停止
- javascript - 为什么我的切换按钮无法使用 Javascript 打开我的响应式菜单?
- haskell - 如何使用 llvm 命令从 GHC llvm 后端生成的 llvm ir (*.ll) 文件创建可执行文件?
- proxy - 有没有办法在使用 CNTLM 代理时指定多个域?
- laravel - 推送提交到 gitlab 时出错,管道错误无法读取用户名
- php - 文件上传问题 Android WebView
- input - 将 GitHub Actions 工作流程中的输入值绕过到 terraform 变量文件
- java - WSL 2 中的 JavaFX 错误:无法打开显示
- sql - 每天访问我的商店 4 次或超过 4 次的 user_id 的每日计数
- python - 部署 gcloud python 应用程序时出错 - 它是什么?