Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, experts. I am a new user having trouble to connect bar plot and line chart to drop down menu , searched various sites and answers in the community as well but it is not working for me . I created 4 variables for 4 drop down menu's but it is still not working , also is there some way I can combine all 4 drop downs in one box? Also I am having problem in the measure box of variable input , when I select the field it keeps changing(the field attribute in the second picture).Thanks
@LearningLad9floridablue wrote:
Hello, experts. I am a new user having trouble to connect bar plot and line chart to drop down menu , searched various sites and answers in the community as well but it is not working for me . I created 4 variables for 4 drop down menu's but it is still not working , also is there some way I can combine all 4 drop downs in one box? Also I am having problem in the measure box of variable input , when I select the field it keeps changing(the field attribute in the second picture).Thanks
Hello, @LearningLad9
To connect a dropdown menu to a bar plot and line chart, you can use the updatemenu attribute in Plotly. This attribute allows you to update chart attributes dynamically based on the dropdown selection. Here’s a basic example of how to set it up:
import plotly.graph_objects as go
# Create figure
fig = go.Figure()
# Add traces for bar plot and line chart
fig.add_trace(go.Bar(x=[...], y=[...]))
fig.add_trace(go.Scatter(x=[...], y=[...]))
# Define dropdown options and their corresponding actions
dropdown_buttons = [
{'label': 'Bar Plot', 'method': 'update', 'args': [{'visible': [True, False]}]},
{'label': 'Line Chart', 'method': 'update', 'args': [{'visible': [False, True]}]}
]
# Add dropdown to the figure
fig.update_layout(
updatemenus=[
{'buttons': dropdown_buttons}
]
)
# Show plot
fig.show()
Replace [...] with your data. The visible array in args determines which traces are visible. For example, [True, False] makes only the bar plot visible, while [False, True] makes only the line chart visible.
I hope this information is helpful to you.
Best Regard,
diana658h
hi, thank you for helping out , one question tho , how will I link plotly to qlik then?
also is there any other way to do this?