试图在Plotly创造风玫瑰;实际的图表显示正常,但我不想要任何一个悬停工具提示。 hoverinfo:none
似乎无效;我究竟做错了什么?
var json =
{"RequestID":null,"AppCode":"0","AppMessage":"OK","Meta":null,"Data":{"Series":[{"r":[23.658536585365852,19.878048780487806,7.8048780487804876,5.8536585365853666,13.292682926829269,6.463414634146341,4.024390243902439,19.024390243902438],"t":["0","45","90","135","180","225","270","315"],"name":"\u003e 25","marker":{"color":"#FF0000"},"type":"area","hoverinfo":"none"},{"r":[23.658536585365852,19.878048780487806,7.8048780487804876,5.8536585365853666,13.292682926829269,6.463414634146341,4.024390243902439,19.024390243902438],"t":["0","45","90","135","180","225","270","315"],"name":"10 - 25","marker":{"color":"#ED850C"},"type":"area","hoverinfo":"none"},{"r":[21.707317073170728,18.414634146341463,7.0731707317073171,5.7317073170731714,12.804878048780488,5.975609756097561,3.7804878048780486,17.926829268292682],"t":["0","45","90","135","180","225","270","315"],"name":"5 - 10","marker":{"color":"#3F3F3F"},"type":"area","hoverinfo":"none"},{"r":[19.756097560975608,17.4390243902439,6.4634146341463419,5.1219512195121961,11.585365853658537,5.1219512195121952,3.4146341463414633,15.487804878048781],"t":["0","45","90","135","180","225","270","315"],"name":"2 - 5","marker":{"color":"#2A4354"},"type":"area","hoverinfo":"none"},{"r":[17.073170731707314,13.780487804878048,5.3658536585365857,4.6341463414634152,10,3.9024390243902443,3.0487804878048781,12.073170731707318],"t":["0","45","90","135","180","225","270","315"],"name":"1 - 2","marker":{"color":"#5486A9"},"type":"area","hoverinfo":"none"},{"r":[11.829268292682926,9.2682926829268286,3.2926829268292686,2.8048780487804881,7.4390243902439019,3.1707317073170733,2.1951219512195119,8.536585365853659],"t":["0","45","90","135","180","225","270","315"],"name":"\u003c 1","marker":{"color":"#68A7D3"},"type":"area","hoverinfo":"none"}]}};
var data = json.Data.Series;
var layout = {
title: 'Wind Speed Distribution in Laurel, NE',
font: {size: 11},
legend: {font: {size: 16}},
radialaxis: {ticksuffix: '%'},
orientation: 270,
hovermode: 'none',
yaxis: {
}
};
Plotly.newPlot('myDiv', data, layout);
答案 0 :(得分:4)
您必须添加hovermode: !1
才能禁用悬停。
尝试:
var layout = {
title: 'Wind Speed Distribution in Laurel, NE',
font: {size: 11},
legend: {font: {size: 16}},
radialaxis: {ticksuffix: '%'},
orientation: 270,
hovermode: false,
yaxis: {
}
};
hovermode
的可接受值为"x"
,"y"
,"closest"
,false