✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Drag and Drop from Database

Good evening,
I have a question concerning the drag and drop function: I have read in a database table as dataframe and would like to select and plot the individual columns by drag and drop. How can I do that? Drag and drop via CSV as the Dash Tutorial I have done, but not. Can one then somehow show it as a button and pull it in or how can I imagine that? Thank you in advance!

Are you saying that you want to drag and drop each column separately and then plot it? If you just want to plot everything at once you’re already halfway there. Use the dataframe from the drag and drop and add a dcc.Graph that uses the dataframe to construct a plot.

I really want to be able to select each column individually since, for example, in one column disease A and in the other disease are b or in database 1 disease A and in database 2 blood value

If I understand you correctly, i think one way you can do it is to use the columns of the read-in dataframe to populate a dropdown which then filters a graph. The second example on here: https://dash.plot.ly/interactive-graphing should help

With dropdown i can do this :slight_smile: Or is there a way to give a button an value and drag this button into the drag and drop? I’m really grateful for you help!

Any solution yet on this? I have the same requirement where the user should be able to drag and drop needed columns from an existing(already loaded) dataframe and it creates the graph dynamically. I am looking for a solution with drag and drop rather than drop down.

No, I’m sorry. We had a diffrent Solution at the end.