clickData for names of stacked barcharts

Finally got it to work!

  • @monishaj93 I can’t use app.layout[plot_id]. For me app.layout is a function, app.layout() is the home page, and anyway this seems unlikely to work for dynamic layouts/plots.

  • A possible related solution is from this post, to have the figure as a State of the callback then use the same figure['data'][curve_number]['name'] trick. Someone else just stumbledon this as well, code here

  • @caiyij I didn’t get any text in my clickData events at first (dash 1.10), but then found this related post and changed from text=df.columns[col] to text=[df.columns[col]] * df.index.size which made it work :slight_smile:
    The same is possible using customdata if you need to have another use for text.