Bring Drag & Drop to Dash with Dashboard Engine. 💫 Learn how at our next webinar!

Is there any way to create percentage distribution in dash in different variables?

hey guys I am new to dash.
I want to do plots about relationships between categorical variables like this.


The thing is that the actual variables show in the plot are the values of the categorical variables.
In order to achieve that I need to manually change column names and choose it in the plot using plotly. My code is like

But I am trying to do it in-dash by just choosing that variable (like checkbox or dropdown)and shows the plot in that way.
I tried several ways but still stuck in it.
Is there any way to achieve that in the dash.

Thanks guys in advance!!!

Welcome @yuxuanxuanxuanxuan
I’m not sure what you’re trying to accomplish. Do you want a dropdown where user can choose certain columns, which will render as x axis categories on the plot?

it may feel confused. Take an example that i have 4 variables abcd and all of them are categorical variables. my target is to show the relationship between abc and d. The x axis values in the plot represents the count percentage. A has option value like a1,a2 and a3.
I want to make a dropdown item to switch from a,b,c. to see each option value percentage with d.
But in order to do that in plotly, i need to type manually a1,a2 and a3. I am trying to figure out how to do that in the dash.

Not sure. Have you used the Dropdown before? If not, try to take a basic Dropdown example from dash documentation, and build on that. Maybe if you had some initial code in Dash it would be easier to help you.