Lau*_*ent 3 chart.js chart.js2
我使用以下选项通过 ChartJS 2 获取点样式图例:
options: {
legend: {
labels: {
usePointStyle: true
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,如下图所示,每个点都包含边框和阴影:
使用ChartJS 2.7.2。
是否有控制边框和阴影的选项?我怎样才能删除它们?
查看实现后,我注意到边框和阴影是由borderWidth每个数据集定义的属性控制的。这是去除边框和阴影的示例。
const dataset = [
{
borderWidth: 0,
data: ...,
label: ...,
backgroundColor: ...,
hoverBackgroundColor: ...,
}
];
Run Code Online (Sandbox Code Playgroud)
请注意,点直径与标签字体大小相关。
| 归档时间: |
|
| 查看次数: |
3021 次 |
| 最近记录: |