如何删除线从标签一旦点击图例和只显示标签文本
xe55xuns1#
我使用labelformatter进行了尝试
{ "xAxis": { "categories": ["abcd", "efgh"], }, "legend": { enabled: true, symbolRadius: 2, margin: 0, itemHoverStyle: { color: '#000' }, itemHiddenStyle: { color: '#cccccc' }, labelFormatter: function () { return `<div><div style=" height:18px; width: 18px; border-radius: 2px;"></div><div style="display:inline-block;margin:0px 0px 0px 20px;font-size:small;">${this.name}</div></div>`; } }, "series": [{ "minPointLength": 3, "type": "column", "pointPlacement": 0.2, "name": "Series1", "turboThreshold": 4, "data": [{ "name": "abcd", "y": 12765433.5 }, { "name": "efgh", "y": 0 }], }, { "minPointLength": 3, "type": "column", "pointPlacement": 0.2, "name": "Series2", "turboThreshold": 1, "data": [{ "name": "abcd", "y": 15.2 }], }]}
{
"xAxis": {
"categories": ["abcd", "efgh"],
},
"legend": {
enabled: true,
symbolRadius: 2,
margin: 0,
itemHoverStyle: {
color: '#000'
}, itemHiddenStyle: {
color: '#cccccc'
labelFormatter: function () {
return `<div><div style=" height:18px; width: 18px; border-radius: 2px;"></div><div style="display:inline-block;margin:0px 0px 0px 20px;font-size:small;">${this.name}</div></div>`;
}
"series": [{
"minPointLength": 3,
"type": "column",
"pointPlacement": 0.2,
"name": "Series1",
"turboThreshold": 4,
"data": [{
"name": "abcd",
"y": 12765433.5
}, {
"name": "efgh",
"y": 0
}],
"name": "Series2",
"turboThreshold": 1,
"y": 15.2
}]
字符串
1条答案
按热度按时间xe55xuns1#
我使用labelformatter进行了尝试
字符串