highcharts - Highcharts 列改变颜色,但标记/点不改变
问题描述
我正在创建 highchart 列我正在更改颜色条,但标记/点没有改变。
我希望标记/点与彩条相同
进度:橙色
完成:绿色
目标:蓝色
不知道怎么解决,看这张图
查看我的演示Jsfiddle
这是我的代码
$(function () {
$('#sales').highcharts({
chart: {
type: 'column'
},
title: {
text: 'Performance Sales'
},
xAxis: {
categories: ['Yulia','UUM','Sinta']
},
yAxis: {
min: 0,
title: {
text: 'Values'
}
},
credits: {
enabled: false
},
plotOptions: {
column: {
dataLabels: {
enabled: true,
formatter: function () {
return this.point.custom;
}
},
},
},
series: [
{
name: 'Progress',
data: [
{
color:'orange',
custom:17,
y:16150000
},
{
color:'orange',
custom:4,
y:195449100
},
{
color:'orange',
custom:16,
y:128000000
}
]
},
{
name: 'Done',
data: [
{
color:'#90ED7D',
custom:16,
y:9000000
},{
color:'#90ED7D',
custom:0,
y:0
},
{
color:'#90ED7D',
custom:8,
y:128000000
}
]
},
{
name: 'Target',
data: [
{
color:'#7CB5EC',
custom:'',
y:50000000
},
{
color:'#7CB5EC',
custom:'',
y:30000000
},
{
color:'#7CB5EC',
custom:'',
y:70000000
}
]
}
]
});
});
解决方案
您需要为整个系列设置此颜色,而不仅仅是针对特定点。图例颜色继承自系列颜色。
演示:https ://jsfiddle.net/BlackLabel/vsud1nky/
series: [{
color: 'orange',
name: 'Progress',
data: [{
custom: 17,
y: 16150000
},
{
custom: 4,
y: 195449100
},
{
custom: 16,
y: 128000000
}
]
}....
]
API:https ://api.highcharts.com/highcharts/series.column.color
推荐阅读
- angular - 在模板驱动的表单中验证单选按钮的问题
- matlab - 使用 sendmail 发送时,发件人名称中的 UTF8 符号的黑色菱形
- python - 如何在不改变卷积层权重的情况下更新分类层
- javascript - 如何根据 JS 中的匹配值将两个数组与对象组合?
- mysql - 如何使用触发器插入另一个表?
- mysql - 如何从插入匹配值的行中增加值?
- java - 调用存储过程比简单的准备语句慢
- css - 如何使用 csstree 获得完整的选择器?
- python - 为什么 google colab 可以从桌面读取我导入的文件?
- git - 从 Git 存储库中删除文件的正确方法是什么?