gpt4 book ai didi

css - 系列值的基本图表切片颜色?

转载 作者:太空宇宙 更新时间:2023-11-04 14:01:23 25 4
gpt4 key购买 nike

现在我正在使用自定义调色板在饼图中显示警告级别计数。然而,偶尔会出现意想不到的严重程度的警报,这会弄乱颜色。我想设置一些 CSS 类,例如分别使用橙色、红色和黄色的 warningPie、criticalPie 或 minorPie。然后,我想使用系列标签文本来应用类。

我在 dxchart 文档中没有看到任何使这成为可能的内容。任何人有什么想法吗?

如果有人好奇的话,这是我的完整图表代码。

dxPieChart: {
dataSource: fieldValueCount(['severity']),
palette: ['#CC3300', '#FF9900', '#FFFF00', '#33CC33', '#0066FF'],
animation: true,
legend: {
backgroundColor: '#FCFCFC',
border: {
color: 'black',
width: .5,
visible: true,
cornerRadius: 10
},
visible: false
},
series: [{
type: 'doughnut',
argumentField: 'severity',
valueField: 'count',
label: {
visible: false,
font: {
size: 12,
color: 'black'
},
radialOffset: -15,
backgroundColor: 'rgba(0,0,0,0)',
connector: {
visible: false,
width: 0.5
},
position: 'inside',
customizeText: function(arg) {
globalTest = arg;
return arg.value + ' (' + arg.percentText + ')';
}
},
border: {
color: 'black',
width: .5,
visible: true
},
hoverStyle: {
border: {
color: 'black',
width: .5,
visible: true
}
}
}],
tooltip: {
enabled: true,
color: 'cornflowerblue',
font: {
size: 14
},
customizeText: function(arg) {
globalTest = arg;
var content = arg.argumentText + '<br>' + arg.value + ' (' + Math.round(arg.percent * 100) + '%)';
return content
}
},
title: {
text: ' ',
font: { size: 14 },
horizontalAlignment: 'center'
}
}

最佳答案

您可以使用 customizePointcustomizeLabel饼图中的选项。

关于css - 系列值的基本图表切片颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21484596/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com