I want to redirect the user to a specific URL address whenever he clicks on one of the boxes in a vbar_stack plot. The issue is that the URL is determined by the sub-categories that each bar is divided to.
For instance, consider the following stacked bar plot:
The categories are fruits and the sub-categories are days. The URL address depends on the day of the box that was clicked.
Usually I would use something like:
but in this case the @path value changes according to the fruits.
I know that the hover tool supports custom formatters, is it possible somehow to use a custom formatter with OpenURL as well? If not, any other ideas?
Your best bet is a CustomJS callback that opens a URL you construct based on the selection. For more specifics, please provide code for a minimal, reproducible example (it looks like you’ve got one, based on the image you posted) that we can modify to provide a working illustration.