I created a simple candlestick chart using go.Candlestick
. I want to hide data when I hover the candlestick chart. I set hoverinfo='none'
but it still show an icon on hovering like the screenshot below. How can I hide it?
This is my entire code:
def online_chart_1(sym_1):
data_for_chart = pd.read_csv('C:\\Users\\AF\\Desktop\\python\\results\\csv\\data_for_chart.csv')
historical_ha_vo = pd.read_csv('C:\\Users\\AF\\Desktop\\python\\results\\csv\\historical_ha_vo.csv')
historical_ha_vo = historical_ha_vo.loc[historical_ha_vo.sym == sym_1].tail(59)
data_for_chart = data_for_chart.loc[data_for_chart.sym == sym_1]
df_appended = historical_ha_vo.append(data_for_chart, ignore_index=True)
fig = make_subplots(rows=2, cols=1, row_heights=[0.8, 0.2], vertical_spacing=0)
fig.add_trace(go.Candlestick(open=df_appended['o'], high=df_appended['h'], low=df_appended['l'],
close=df_appended['c'],
increasing_line_color='#0384fc', decreasing_line_color='#e8482c', name=sym_1,
hoverinfo='none',
), row=1, col=1)
fig.add_trace(go.Scatter(y=df_appended['vo'], marker_color='#fae823', name='VO', hovertemplate=[]), row=2, col=1)
fig.update_layout({'plot_bgcolor': "#21201f", 'paper_bgcolor': "#21201f", 'legend_orientation': "h"},
legend=dict(y=1, x=0),
font=dict(color='#dedddc'), dragmode='pan', hovermode='x unified',
margin=dict(b=20, t=0, l=0, r=40))
fig.update_xaxes(showgrid=False, zeroline=False, rangeslider_visible=False, showticklabels=False,
showspikes=True, spikemode='across', spikesnap='data', showline=False, spikedash='solid'
)
fig.update_yaxes(showgrid=False, zeroline=False)
fig.update_traces(xaxis='x')
return fig
And for dash:
app = dash.Dash(__name__)
app.layout = html.Div([html.Div(dcc.Graph(id='chart', figure=online_chart_1('zob'),
config={'displayModeBar': False}))])
if __name__ == '__main__':
app.run_server(debug=True, dev_tools_ui=False, dev_tools_props_check=False)