I tried to produce a bar chart that visualizes the most-starred projects on GitHub. I added 'label'
and 'xlink'
inside tooltips, however, 'label'
contents are not very well fit in for some items, also, some links are not shown up in certain projects' tooltip. See below,
Below is the Python code using Pygal module, run it and see the .svg file yourself.
import requests, pygal
url = 'https://api.github.com/search/repositories?q=language:python&sort=star'
r = requests.get(url)
repo_list = r.json()['items']
names, stars = [], []
for k in repo_list:
names.append(k['name'])
temp = {
'value': k['stargazers_count'],
'label': k['description'],
'xlink': k['html_url'],
}
stars.append(temp)
my_config = pygal.Config()
my_config.x_label_rotation = 45
chart = pygal.Bar(my_config)
chart.title = 'GitHub, Python Most Starred Projects'
chart.x_labels = names
chart.add('', stars)
chart.render_to_file('MyFile.svg', force_uri_protocol = 'http')
How do I solve this problem, either by adjusting font size of tooltip or tooltip window size?