I’m not sure why, but either default or set hovermode doesn’t work. Hover text still not showing. I’ve tested the same plotly code on different js compiler and the hover text shows on that one.
Found that hover text doest work when the css is set to zoom:(less than 1), is there any work around?
const AI = {
x: [1,2,3,4,5,6,7,8,9,10,11],
y: tmpList,
text: ["初週","2週","3週","4週","5週","6週","7週","8週","9週","10週"],
type: 'scatter',
mode: 'lines+markers',
marker: { color: 'red' },
name: "",
hovertemplate: '%{text}' +
', %{y}<extra></extra>'
};
const config = {
displayModeBar: false
};
<Plot
data={data}
layout={{
xaxis: {
range: [0, 10],
ticktext: ["1","","","","5","","","","","10(週)"],
tickvals: [1,2,3,4,5,6,7,8,9,10],
zeroline:true,
tickangle:360
},
yaxis: {
range: [0, 50000],
ticktext: ["10000", "30000", "(玉)<br> 50000"],
tickvals: [10000, 30000, 50000],
rangemode:'tozero',
zeroline:true,
showgrid:false
},
autosize: false,
width: 420,
height: graphHeight,
margin: {
l: 60,
r: 60,
b: 25,
t: 50,
pad: 0
},
font: {
size:16
},
hoverlabel: { bgcolor: "#FFF" },
}}
config={config}
/>