- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
>>> Radar chart labels with background color
您好,我只是想请求一个选项来为 Chartjs 中的标签(单独)添加背景颜色(带有背景颜色的圆 Angular 矩形)。我可以申请任何回调来更改此设置吗?如有任何帮助,我们将致以最诚挚的问候!
这是当前代码:
let chart = new Chart('chart-0', {
type: 'radar',
data: radarChartData,
options: {
responsive: true,
legend: {
position: 'top',
},
title: {
display: true,
text: 'Radar Chart | Chart.js',
fontSize: 16
},
scale: {
ticks: {
beginAtZero: true
},
pointLabels: {
fontSize: 14, // fontSize is ok
fontColor: presets.blue, // fontColor is accessible
backgroundColor: presets.yellow //This is not working for sure!
}
},
animation: {
animateScale: true,
animateRotate: true
}
}
});
最佳答案
您可以使用背景颜色。
data: {
labels: chart_label,
datasets: [{
label: '# of Votes',
data: chart_data,
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
borderWidth: 1
}]
},
关于javascript - Chartjs - 为标签雷达图添加背景颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47988873/
我想尝试用 Java OpenGL 构建雷达。基本上,在该方法中,您传递玩家的当前位置、玩家面对的角度以及敌人的位置。如果敌人就在正前方,那么红点(象征敌人)应该在圆圈(雷达)的顶部,可以说是0度。如
我只是对声纳设备有一个总体的思考。声纳结果如何用数据类型表示。 目前我想出的解决方案是拥有一个 360 2D array,其值表明物体被击中时的距离,最大范围意味着那里什么也没有。这样做的问题是,对于
我有一个雷达图Js。 我不知道如何在区域内放置径向渐变。放置当前代码时,默认只取1种颜色作为background-color 当前代码: let ctx = document.getElementBy
我用在线生成器实现了 amChart。这是结果: https://live.amcharts.com/ODVhY/ 如您所见,带有值的标签仅在红牛上可见。 如何将其扩展到所有 5 个项目符号? 我的配
我需要一种灵活的方法在 ggplot2 中制作雷达/蜘蛛图。从我在 github 和 ggplot2 组上找到的解决方案,我已经走到了这一步: library(ggplot2) # Define a
我想用radare2调试程序“id3v2 -c halo test.mp3”。 如何将参数“-c halo test.mp3”传递给radare2? 我只用 rarun2 找到了一些东西,但是当我这样
我在哪里可以找到适用于 iOS 的优秀蜘蛛(雷达)图表库? (如下图) 我检查了“Core Plot”和“iOSPlot”开源项目,但这些都不支持蜘蛛图。 BR,元一。 最佳答案 在 Github 上
我是一名优秀的程序员,十分优秀!