Kozea / pygal

PYthon svg GrAph plotting Library
https://www.pygal.org
GNU Lesser General Public License v3.0
2.62k stars 411 forks source link

Modify Tooltips #531

Open DrapalDragon opened 1 year ago

DrapalDragon commented 1 year ago

I am creating an interactive World Map in Python with help of Pygal. My plan is to use the tooltip to display which country you are hovering over, and then upon clicking the country, it takes you to a seperate HTML with information on it. The problem is, sometimes the Tooltips themselves block the countries I am trying to access. For example, if I try and click on a small country like Switzerland, it's tooltip itself is so big that I can't click the country and redirect to the info page.

I have searched over and under for syntaxes that use Tooltips but can find none. I just want to be able to display which country the mouse is currently hovering over, and then redirect upon click. Possible solutions I think of include:

Adding a Hyperlink to the tooltip itself, like what is possible in the charts of pygal but for some reason not possible in the maps Permanently setting the Tooltip's position to below the cursor Completely disable Tooltips and just display the name of the country on the map like a normal physical world map Below is the code that I have until now, but as a Prototype, with a model using only Continents instead of Countries. I do not yet have the HTML sites for all the countries because of this infuriating problem !