Questions tagged [pygal]

A python SVG Charts Creator

pygal is a dynamic SVG charting library.

It features various graph types:

  • Bar charts;
  • Line charts;
  • XY charts;
  • Pie charts;
  • Radar charts;
  • Dot charts;
  • Pyramid charts;
  • Funnel charts;
  • Gauge charts;
176 questions
20
votes
4 answers

pygal rendering png/svg black pictures

I am using python (with a virtual env in LinuxMint), I installed pygal. Everything works fine (rendering to html) but not rendering to svg or png . The result : Nothing but a black background. I installed cssselect and tinycss like mentioned here…
4m1nh4j1
  • 4,289
  • 16
  • 62
  • 104
16
votes
4 answers

Why can't I import COUNTRIES from pygal.i18n

I'm trying to import COUNTRIES from pygal.i18n by using the piece of code below. from pygal.i18n import COUNTRIES After I run this, I get the following error. ImportError: No module named 'pygal.i18n'. Can anyone tell me what the problem…
RandomCoder
  • 2,071
  • 4
  • 12
  • 17
10
votes
1 answer

How to plot multiple graphs in one chart using pygal?

I'm trying to plot multiple series with two measurements (so it's actually num_of_time_series x 2 graphs) in one figure using pygal. For instance, suppose mt data is: from collections import defaultdict measurement_1=defaultdict(None,[ …
Idan Azuri
  • 623
  • 4
  • 17
8
votes
2 answers

Create a combined chart in pygal?

Is it possible to create a single chart with a line series and a bar series? chart = pygal.Line() chart.x_labels = 'Red', 'Blue', 'Green' chart.y_labels = .0001, .0003, .0004, .00045, .0005 chart.add('line', [.0002, .0005, .00035])
user_78361084
  • 3,538
  • 22
  • 85
  • 147
6
votes
1 answer

How can I add a perpendicular x axis line in pygal?

I'd like to put in an axspan similar to the following provided in matplotlib so that I have a vertical line in my graph to point out a location. This is for a line chart using pygal plt.axvspan(fin_loc, fin_loc+1, color='red', alpha=0.5)
tsar2512
  • 2,826
  • 3
  • 33
  • 61
6
votes
3 answers

Can't import pygal_maps_world.World

I am trying to create a simple program so as to display the map of Central America with its population using Pygal_maps_world. Here's the code for the same: import pygal_maps_world as pa wm=pa.World() wm.title="Map of Central…
Dhruv Marwha
  • 1,064
  • 2
  • 14
  • 26
6
votes
1 answer

Embedding pygal in web2py

pygal, renders an svg and returns in the graphs dictionary. I try to embed it into a web2py page. That works. But I can't figure out how to reduce the size of the graphs on the page. the view: {{extend 'layout.html'}}

Hello…

Davoud Taghawi-Nejad
  • 16,142
  • 12
  • 62
  • 82
5
votes
1 answer

AttributeError: module 'pygal' has no attribute 'Worldmap'

I'm trying to: import pygal wm = pygal.Worldmap() but it raises: AttributeError: module 'pygal' has no attribute 'Worldmap' Can anyone tell me what the problem is?
Bruin
  • 125
  • 1
  • 2
  • 5
5
votes
4 answers

Pygal render SVG in Jupyter Notebooks

Im currently using Jupyter Notebooks and I would like to render SVG's via HTML without saving them as a local SVG and display them afterwards. Im using this code: %matplotlib inline from IPython.display import SVG, HTML html_pygal = """
MBUser
  • 415
  • 2
  • 6
  • 15
5
votes
1 answer

Pygal subplot (several figures)

I want to create a dashboard using Pygal on python 2.7 (Several plots in the same window) but the later doesn't have the subplot function, Is there a solution, without using bokeh or plotly? Example on Matplotlib: fig, axes = plt.subplots(ncols=4,…
belkacem mekakleb
  • 584
  • 2
  • 7
  • 22
5
votes
4 answers

How I can embed pygal charts in django templates

I use pyGal for making charts, but I can't insert them in django templates. It works great, if I try like this in views.py return HttpResponse(chart.render()) But when I make something like this in my template in doesn't work at all …
vZ10
  • 2,468
  • 2
  • 23
  • 33
4
votes
3 answers

AttributeError: 'NoneType' object has no attribute 'decode'

names, plot_dicts = [], [] for repo_dict in repo_dicts: names.append(repo_dict['name']) plot_dict = { 'value': repo_dict['stargazers_count'], 'label': repo_dict['description'], 'xlink':…
C.Kang
  • 71
  • 1
  • 2
  • 6
4
votes
3 answers

Can a PyQt Embedded MatPlotLib Graph Be Interactive?

I have a stacked bar plot of analytics data embedded in my GUI which I would like to be more interactive. When the user hovers or clicks on a bar the plotted value should appear. Can this be done? I haven't been able to find anything about it in the…
Sadie LaBounty
  • 379
  • 1
  • 5
  • 23
4
votes
1 answer

Using PyGal, how can I embed a label on the pie chart itself on hover?

Using the code below, I can generate a pie chart. When I hover over a slice of the pie, it shows the percentage that slice occupies. import pygal results = [ (15232,'Value 1'), (947,'Value 2'), (246,'Value 3'), (117,'Value 4'), …
Andy
  • 49,085
  • 60
  • 166
  • 233
4
votes
1 answer

How to define points' labels using Pygal Scatterplot, pygal.XY?

I have a list of tuples (x,y) of a MDS projection result and I need to show the points names/labels. So I also have a list of labels. For instance: labels = ['a','b','c','d'] points = [(1,2),(1,3),(1,4),(4,5)] xy_chart =…
Henry
  • 411
  • 4
  • 14
1
2 3
11 12