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:
tap_tool = plot.select(type=TapTool)
tap_tool.callback = OpenURL(url=f"https://{host}/@path")
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?