I'm currently using the plotly service to graph some water quality data. I've added some lines to represent the the various stages of water quality, with them shaded so they are green, yellow, and red.
I've been able to remove some unnecessary lines from the legend, but they still show up when hovering over the data. I've looked here text and annotations but when trying to use the "hoverinfo" parameter, I get a
"plotly.exceptions.PlotlyDictKeyError: Invalid key, 'hoverinfo', for class, 'Scatter'."
error. Is there an alternative way to doing this for the Scatter plot? So far I've looked and have found nothing too helpful.
Here is how I'm currently trying to set up the trace:
badNTULevel = Scatter(
x=[],
y=[100],
mode='lines',
line=Line(
opacity=0.5,
color='rgb(253,172,79)',
width=1,
),
stream=Stream(
token=stream_ids[3],
maxpoints=80
),
hoverinfo='none',
fill='tonexty',
name="Water Treatment Plants Can't Process over 100"
)
Any help would be appreciated.
validate=False
" to your plot call and usedict
instead ofScatter
. That'll bypass the validation error that you're seeing. See this example for more: plot.ly/python/text-and-annotations/#disabling-hover-text – ProgressionFigure
todict
(it's just a simple subclass anyway). Long story short, the validation outdates the featured keys, which causes validation errors whenever a subclasseddict
fromplotly.graph_objs
is used. – Progression