Modify hover(location,text) in Python? Zoom a candlestick chart?

I’ve plot a candlestick chart with moving averages shows as follows

I hope if I could put all the texts in one text box, and fix the location of the hover to upper-right corner of the chart.

I’ve read the Hover events guide but it’s in Javascript. Apparently Python code doesn’t call on.hover() function so it won’t modify the hover or show the picture.

Another question is that how to zoom a candelstick chart? I can only choose time(x axis) but I can’t zoom y axis, even in dash.

Hi @arthurire,

I don’t think you’ll be able to customize the built-in hover tooltip to do this. If you’re using Dash, you could add a callback on the figure’s Hover Data (https://dash.plot.ly/interactive-graphing) and use that to display the data you want in a separate table trace (https://plot.ly/python/table/) or data table (https://dash.plot.ly/datatable).

When the range slider is active (the long preview plot below the main plot), you can only zoom in the x-direction. To be able to zoom in both x and y, disable the range slider by setting layout.xaxis.rangeslider.visible to False.

Hope that helps,
-Jon

Hi arthurire,

can you, please, share how you plot the candlestick plow with the SMA?

Thanks,
Arthur