是否删除折线图图例符号上的删除线



我正在为折线图上的高线图使用预定义的符号,并且希望只显示符号。我不希望线路也显示在那里。我看到气泡图是可能的,但当我将图表类型从气泡图更改为线条时,会出现删除线:https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/plotoptions/bubble-symbol/.有没有想过我该如何应对?提前感谢!


chart: {
type: 'bubble'
},
title: {
text: 'Highcharts Bubbles with symbols'
},
series: [{
data: [
[97, 36, 79],
[94, 74, 60],
[68, 76, 58],
[64, 87, 56],
[68, 27, 73],
[74, 99, 42],
[7, 93, 87],
[51, 69, 40],
[38, 23, 33],
{
x: 57,
y: 0,
z: 31,
marker: {
symbol: 'triangle',
lineColor: 'red',
fillColor: 'rgba(255,0,0,0.5)'
},
dataLabels: {
enabled: true,
format: 'Individual marker'
}
}
],
marker: {
symbol: 'square'
},
name: 'Square'
}, {
data: [
[25, 10, 87],
[2, 75, 59],
[11, 54, 8],
[86, 55, 93],
[5, 3, 58],
[90, 63, 44],
[91, 33, 17],
[97, 3, 56],
[15, 67, 48],
[54, 25, 81]
],
marker: {
symbol: 'diamond'
},
name: 'Diamond'
}, {
data: [
[47, 47, 21],
[20, 12, 4],
[6, 76, 91],
[38, 30, 40],
[57, 98, 64],
[61, 17, 10],
[83, 60, 13],
[67, 78, 75],
[64, 12, 10],
[30, 77, 82]
],
marker: {
symbol: 'url(https://www.highcharts.com/samples/graphics/earth.svg)'
},
name: 'Earth'
}]
});

我认为可以使用散点级数类型来实现它。

演示:https://jsfiddle.net/BlackLabel/8gpnx90v/

chart: {
type: 'scatter'
},

API:https://www.highcharts.com/docs/chart-and-series-types/scatter-chart

答案有点晚,但如果将symbolWidth设置为与符号半径相同的值,则会隐藏图例中的行:

legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom',
symbolWidth: 6
},  
plotOptions: {
line: {
marker: {
symbol: 'circle',
radius: 6
}
}
},
legend: {
useHTML: true,
enabled: true,
itemStyle: {
font: '9pt Helvetica, Arial, sans-serif',
activecolor: '#CCC',
'font-weight': 'bold',
'text-decoration': 'none'          /** <---  **/
}
}

最新更新