如果你看看我 http://jsfiddle.net/WOUNDEDStevenJones/oe1vcmqj/1/,图表上的红色标签后面有微妙的白色光芒(至少在Chrome和FF中)。 如何去除白色光芒? 或者最坏的情况是至少将颜色更改为相同的蓝色,以便它融入其中?
我尝试使用他们的 API (http://api.highcharts.com/highcharts#plotOptions.column.dataLabels) 中的 shadow
、backgroundColor
和其他属性,但无法弄清楚是什么定义了红色文本背后的光芒。
plotOptions: {
columnrange: {
dataLabels: {
enabled: true,
color: 'red',
inside: false,
xHigh: -45,
xLow: -9999999,
shadow: "#ff0000",
formatter: function () {
if (this.point.high) {
var myDate = new Date(this.y);
var newDateMs = Date.UTC(myDate.getUTCFullYear(),myDate.getUTCMonth(),myDate.getUTCDate());
return '<b>' + Highcharts.dateFormat('%m/%e',newDateMs) + '</b>';
} else {
return null;
}
}
}
}
}
将dataLabels.styles.textShadow
设置为 false
。
plotOptions: {
columnrange: { // or general options: "series: { ... }"
dataLabels: {
enabled: true,
color: 'red',
style: {
textShadow: false
}
}
}
},
演示:http://jsfiddle.net/oe1vcmqj/2/
编辑:
从 Highcharts 5.0.3 开始,选项名称为 textOutline
。
plotOptions: {
columnrange: { // or general options: "series: { ... }"
dataLabels: {
enabled: true,
color: 'red',
style: {
textOutline: false
}
}
}
},
演示:http://jsfiddle.net/oe1vcmqj/49/
编辑 v2.0:
从Highcharts 5.0.13开始,textOutline
选项应该是一个string
,因此要禁用大纲,请设置textOutline: 'none'
。
plotOptions: {
columnrange: { // or general options: "series: { ... }"
dataLabels: {
enabled: true,
color: 'red',
style: {
textOutline: 'none'
}
}
}
},
演示:http://jsfiddle.net/BlackLabel/s7ejvhmu/
dataLabels: {
enabled: true,
format: '{point.y}',
style: {
textOutline: false
}
},
使用text-shadow:none !important;
作为标记tspan
.CSS
tspan{
text-decoration:none;
text-shadow:none !important;
}
小提琴演示
我工作...
dataLabels: {
enabled: true,
color: 'white',
style: {
// textShadow: false
textOutline: false
}
在 1.4.0 版中
用
dataLabels: {
dropShadow: false
}