Giter Site home page Giter Site logo

pygal's Introduction

Pygal

Build Status Coverage Status Documentation Status

Description

pygal is a dynamic SVG charting library written in python. All the documentation is on www.pygal.org

Installation

As simple as:

    $ pip install pygal

Test

Pygal is tested with py.test:

    $ pip install pytest
    $ py.test

Contribute

You are welcomed to fork the project and make pull requests. Be sure to create a branch for each feature, write tests if needed and run the current tests !

You can also support the project:

Flattr gittip

License

Copyright Β© 2012-2016 Kozea LGPLv3:

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

pygal's People

Contributors

akx avatar cclauss avatar cleder avatar djt avatar dzejar avatar fayizk1 avatar felixonmars avatar gentooboontoo avatar hektorinho avatar jaraco avatar jeffreystarr avatar le-stagiaire avatar leplatrem avatar lize avatar mmrose avatar necrote avatar nfriedli avatar paradoxxxzero avatar piotrmaslanka avatar ralphbean avatar rcarmo avatar signed0 avatar simonsapin avatar simplyarjen avatar sirlark avatar sjourdois avatar smalawi avatar snarkturne avatar wiktorn avatar yossisal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygal's Issues

BoundingBox and smoothing algorithm

Hi team,

I would like to raised a problem encountered in a source code.
After several tests, Pygal seems do not support a graph with a width equals to zero on X axis.

Ex: some points (0,1),(0,2),(0,3),(0,4),(0,5)

When the bounding box dimension on X of the cloud point is equal to zero, the graph automaticly targets the area [0;1][0;1], and the smoothing algorithm like "quadratic" raises an "divide by zero" exception..

Have you got any issue to avoid this behavior?

Thanks

Diff

Adding the possibility to diff variables would avoid the need to export the variables result in files and thus will improve productivity :)

Titles in Axis (feature request)

Hi!

Great job with the library.

I would like to propose a new feature: add titles to the axis X and Y.

I dont know the complexity of development but I hope it can be done.

Thanks in advance!

Duplicate/extra quantity in label

The value is duplicated in the tooltip when including a label. For example, if a value is 5, it will show "55". In a pie chart it displays the value and percent together. For example, f a value is 5 out of a total 10, it will show "550.00%". See examples of this on http://pygal.org/metadata/

This fix removes the first instance of the value, leaving "5" or "50.00%" in the examples. It has only been tested on line and pie graphs.

util.py Line 326

# CURRENT CODE
value = dict(raw_value).pop('value')

# FIXED CODE
value = raw_value.pop('value')

render_to_png creates all black pictures

Hi,

whenever i use render_to_png everything is black. If i output the svg and load it in inkscape, everything is black, too. The objects are all there, but it seems like no styles are applied. (pygal via pip, tested with pycairo 1.8.8 and py2cairo 1.10.0 on python 2.7)

Thanks!

bug tooltip

I've a bug when rendering more than one graph in my html page. The svg is embed directly into HTML.

Opening in Inkscape shows all-black image

Opening an SVG files created by pygal shows an completely black image.
I've figured out why: Inkscape only supports one "style" section; by editing the svg file by handing and merging the 3 style sections by hand, Inkscape shows a diagram when it opens it.

But the diagram still does not look the same as in the browser. I'm using a Bar chart, and every bar is "dimmed" such as only happens when the mouse is "over" the bar in the browser, and for each bar, the actual value (a long number with many decimal digits) is superimposed on the bar.

graphs with 'min/max range' on them

Im a sysadmin and we like to measure things.

Id like to be able to plot a value with an additional min/max range (range bars I guess)..

for example: http://www.coderholic.com/files/munin-graphs1.png

You can see the actual value for 'day' (because it is one sample per pixel) but as the day data is squished into 'week' the value becomes a range (with the average plotted in solid green and the range behind it in light green).

Can one do that with pygal?

Graphs do not render correctly over https due to hard-coded javascript paths

The svg file will attempt to load the following two resources via script tags in the defs section:

http://kozea.github.com/pygal.js/javascripts/svg.jquery.js
http://kozea.github.com/pygal.js/javascripts/pygal-tooltips.js

Since both are http, newer browsers will stop them from loading when the svg is viewed via https. In chrome this can be worked around by clicking the "load unsafe resources" icon in the url bar, but this is not user friendly.

Serving these via https with a valid certificate would work, but the scripts redirect to the following when you change the url to https:

http://kozea.github.io/pygal.js/javascripts/*

If you then change this url to https, it gives a certificate error.

I'd reach out to the folks at http://cdnjs.com/ and see if they'll host your js files, then change the urls in the svg to use a protocol-less url like so:

//cdnjs.cloudflare.com/ajax/libs/pygal.js/1.2.0/svg.jquery.js
//cdnjs.cloudflare.com/ajax/libs/pygal.js/1.2.0/pygal-tooltips.js

You can usually get your javascript on cdnjs by making a merge request to this repo: https://github.com/cdnjs/cdnjs

Supranational areas in worlmap

What about to have supranational areas in worldmap?
I think to EU (European Union), EUR area, OECD countries, NAFTA (North American Free Trade Agreement), etc.

btw Pygal is a great work.

Regards
Massimo

pyquery seems to be a prerequisite (python 2.6)?

pygal/ghost.py:
def render_pyquery(self):
"""Render the graph, and return a pyquery wrapped tree"""
from pyquery import PyQuery as pq
return pq(self.render_tree())

pygal/test/utils.py:
from pyquery import PyQuery as pq

[Web] Nothing happens on hover

I didn't find in the docs how to enable the hover capabilities that all the example there showcase. For example the pies here act on hover:
http://pygal.org/chart_types/#pies

However I didn't get how to enable that with my charts.
I have included svg.jquery.js and pygal-tooltips.js and they are loaded correctly. I insert the svg image inside the <figure> tag. I've also set disable_xml_declaration=True.

merge line and bar

Is it possible to merge two charts, for instance a Bar chart and an XY chart on the same svg ?

worldmap.svg missing

I'm guessing (since pygal won't import without it) that there is supposed to be a worldmap.svg file in pygal/graphs and that an overzealous .gitignore helpfully did what it was told and ignored it.

X axis Major and Minor labels

Hi,

Great chart rendering project. A little feature I'd like is the ability specify so that every nth label on the x-axis is a bigger font size. Or have the option of only showing every nth label.

An example is plotting time series data for every minute in the last 24 hours. The x axis ends up being filled with over lapping labels.

Thanks for the consideration of this issue.

Watcher

It would be upper cool to have a watcher for a variable.

Quick question

Is it possible to chart a line (such as a trend line) on a bar chart?

Gantt charts (plans, docs, hacks ?)

Is there any implementation of Gantt charts in Pygal ? I didn't find the docs for it. Any plans ? May I suggest a horizontal stacked bar char with an "invisible" first stack ? I'd love to use Pygal in a Project Management web app I'm working on.

Links do not work correct for Pyramid-Charts

Hi πŸ‘‹,

I observe some strange behavior with links in the meta information using Chrome. See the following code:

pyramid_chart = pygal.VerticalPyramid(human_readable=True, x_label_rotation=65, width=1500, height=500, label_font_size=12)

pyramid_chart.title = 'Test graphic'
pyramid_chart.x_labels = ['House', 'Sample']
pyramid_chart.add(terms[0], [{'value': 8, 'label': 'sometext', 'xlink': {'href': 'http://google.de/'+ 'Miau', 'target': '_blank'}},
                             {'value': 11, 'label': 'sometext', 'xlink': {'href': 'http://en.wikipedia.org/wiki/Blue'}}])
pyramid_chart.add(terms[0], [{'value': 3, 'label': 'sometext', 'xlink': {'href': 'http://google.de/'+ 'SomeOther', 'target': '_blank'}},
                             {'value': 2, 'label': 'sometext', 'xlink': {'href': 'http://en.wikipedia.org/wiki/Green', 'target': '_blank'}}])

pyramid_chart.render_to_file('SomeName.svg')

The second bars are black
blackbars

The problem exists also in the documentation of metadata.

Update:

The issue seems to be related to #57. I have these two black bars from the start. The first ones stays the same even when I click on it.

Changing font size of percent numbers within a pie-chart

Hi,

when creating a pie-chart using pygal is there any option to modify the font size of the percentage counts within the pie-chart. I tried modifying the label_font_size variable but nothing changed?

Thanks in advance

Andy

XY chart gets bounding box wrong for incomplete data

If you do an XY chart and you supply multiple datasets, the bounding box for the y-axis may be wrong if some datasets define a value with a certain x-value, but other datasets don't.

line_chart = pygal.XY(width=1024, height=800)
line_chart.title = 'Bounding Box Issue'
line_chart.add("x1", [(10,10), (11,11), (12,12)])
line_chart.add("x1", [(10,11),          (12,13)])

The line chart will now include y=0

The issue appears to be at this section:

        if rng:
            self._box.xmin, self._box.xmax = min(xvals), max(xvals)
            self._box.ymin, self._box.ymax = min(yvals), max(yvals)

yvals will have 0 values for any dataset where an x-value exists in another dataset, but not that dataset.

Remove alt title for chart

In Firefox (only in firefox) when I hover on chart I see alt. title "Pygal". Is there any way to remove or change it?

Highlight some labels with color

Hi πŸ‘‹,

is it possible to color individual labels? For example:

pyramid_chart.x_labels = ['label1', ('blue', 'label2'), ... ]

I may propose a pull request if it is not possible.

Horizontal bar diagram legend

in the Horizontal bar diagram the legend is the other way round than the actual bars, which leads to confusion.

should the order of the legend be reversed for this chart type?

in pygal.Dot it looks better.

Xlink attributes not applied to links in all cases

Create a simple pie chart and embed into an HTML page as an IFRAME:

graph = pygal.Pie()
graph.add("Low", [{'value': 10, 'xlink': {'href': '/foo/', 'target': '_top'}}])
graph.add("Medium", [{'value': 5, 'xlink': {'href': '/bar/', 'target': '_top'}}])
graph.add("High", [{'value': 15, 'xlink': {'href': '/baz/', 'target': '_top'}}])

The links will open in the parent window, but only if you click the part of the pie slice that is not covered by the tooltip.
missing_link_attributes

Pie Chart with links does not display properly in IE after you visit the links

Create a simple pie chart and embed into an HTML page as an IFRAME:

graph = pygal.Pie()
graph.add("Low", [{'value': 10, 'xlink': {'href': '/foo/', 'target': '_top'}}])
graph.add("Medium", [{'value': 5, 'xlink': {'href': '/bar/', 'target': '_top'}}])
graph.add("High", [{'value': 15, 'xlink': {'href': '/baz/', 'target': '_top'}}])

In IE (seems to be an issue at least with IE9 and IE10), click the link, so that the page is added to your history, then go back to the page with the iframe on it. You will observe that the fill is gone from the pie that you clicked on.

In this example, I clicked on the "low" part of the pie chart:
pygal_ie_fill

Legend Positioning

In the past Legends were placed right of the chart, now they are placed left.
Legends can be placed below the chart also.

To make this more flexible I suggest a 'legend_position' with the values 'right' 'bottom' 'left' and maybe 'top' (defaults to 'left'). 'legend_position' == None will not display the legend. If a graph has secondary legends 'left' and 'right' are ignored (or maybe 'right' could be used to to invert the primary and secondary legends)

instead of the 'show_legend' and 'legend_at_bottom'

Warnings on Install

I installed pygal using easy_install and received several warnings. Once the install completed, I did a quick test and pygal worked correctly. Below are the warnings I received.

Downloading http://pypi.python.org/packages/source/l/lxml/lxml-3.0alpha2.tar.gz
Processing lxml-3.0alpha2.tar.gz
Running lxml-3.0alpha2/setup.py -q bdist_egg --dist-dir /var/folders/vr/mv4ltx2537d5wpy2vy0qw0_80000gn/T/easy_install-WhC1QZ/lxml-3.0alpha2/egg-dist-tmp-xBcon0
Building lxml version 3.0.alpha2.
Building without Cython.
Using build configuration of libxslt 1.1.24
warning: no files found matching '*.txt' under directory 'src/lxml/tests'
gcc-4.2 not found, using clang instead
clang: warning: argument unused during compilation: '-flat_namespace'
src/lxml/lxml.etree.c:40561:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((__pyx_v_c_ns->prefix == NULL)) {
~~~~~~~~~~~~~~~~~~~~~^~~~~~~
src/lxml/lxml.etree.c:40561:33: note: remove extraneous parentheses around the comparison to silence this warning
if ((__pyx_v_c_ns->prefix == NULL)) {
~ ^ ~
src/lxml/lxml.etree.c:40561:33: note: use '=' to turn this equality comparison into an assignment
if ((__pyx_v_c_ns->prefix == NULL)) {
^~
=
src/lxml/lxml.etree.c:40591:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((__pyx_v_c_ns->href == NULL)) {
~~~~~~~~~~~~~~~~~~~^~~~~~~
src/lxml/lxml.etree.c:40591:33: note: remove extraneous parentheses around the comparison to silence this warning
if ((__pyx_v_c_ns->href == NULL)) {
~ ^ ~
src/lxml/lxml.etree.c:40591:33: note: use '=' to turn this equality comparison into an assignment
if ((__pyx_v_c_ns->href == NULL)) {
^~
=
src/lxml/lxml.etree.c:116462:25: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((__pyx_v_c_ns_uri == NULL)) {
~~~~~~~~~~~~~~~~~^~~~~~~
src/lxml/lxml.etree.c:116462:25: note: remove extraneous parentheses around the comparison to silence this warning
if ((__pyx_v_c_ns_uri == NULL)) {
~ ^ ~
src/lxml/lxml.etree.c:116462:25: note: use '=' to turn this equality comparison into an assignment
if ((__pyx_v_c_ns_uri == NULL)) {
^~
=
src/lxml/lxml.etree.c:132276:72: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types]
__pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; ...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lxml/lxml.etree.c:130237:138: note: passing argument to parameter '__pyx_v_self' here
static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
^
src/lxml/lxml.etree.c:133665:70: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types]
__pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 680; ...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lxml/lxml.etree.c:130237:138: note: passing argument to parameter '__pyx_v_self' here
static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
^
src/lxml/lxml.etree.c:136329:3: warning: implicit declaration of function 'xsltProcessOneNode' is invalid in C99 [-Wimplicit-function-declaration]
xsltProcessOneNode(__pyx_v_context->_xsltCtxt, __pyx_v_c_context_node, NULL);
^
6 warnings generated.
src/lxml/lxml.etree.c:40561:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((__pyx_v_c_ns->prefix == NULL)) {
~~~~~~~~~~~~~~~~~~~~~^~~~~~~
src/lxml/lxml.etree.c:40561:33: note: remove extraneous parentheses around the comparison to silence this warning
if ((__pyx_v_c_ns->prefix == NULL)) {
~ ^ ~
src/lxml/lxml.etree.c:40561:33: note: use '=' to turn this equality comparison into an assignment
if ((__pyx_v_c_ns->prefix == NULL)) {
^~
=
src/lxml/lxml.etree.c:40591:33: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((__pyx_v_c_ns->href == NULL)) {
~~~~~~~~~~~~~~~~~~~^~~~~~~
src/lxml/lxml.etree.c:40591:33: note: remove extraneous parentheses around the comparison to silence this warning
if ((__pyx_v_c_ns->href == NULL)) {
~ ^ ~
src/lxml/lxml.etree.c:40591:33: note: use '=' to turn this equality comparison into an assignment
if ((__pyx_v_c_ns->href == NULL)) {
^~
=
src/lxml/lxml.etree.c:116462:25: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
if ((__pyx_v_c_ns_uri == NULL)) {
~~~~~~~~~~~~~~~~~^~~~~~~
src/lxml/lxml.etree.c:116462:25: note: remove extraneous parentheses around the comparison to silence this warning
if ((__pyx_v_c_ns_uri == NULL)) {
~ ^ ~
src/lxml/lxml.etree.c:116462:25: note: use '=' to turn this equality comparison into an assignment
if ((__pyx_v_c_ns_uri == NULL)) {
^~
=
src/lxml/lxml.etree.c:132276:72: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types]
__pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; ...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lxml/lxml.etree.c:130237:138: note: passing argument to parameter '__pyx_v_self' here
static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
^
src/lxml/lxml.etree.c:133665:70: warning: incompatible pointer types passing 'struct __pyx_obj_4lxml_5etree__BaseContext *' to parameter of type 'struct __pyx_obj_4lxml_5etree__XSLTContext *' [-Wincompatible-pointer-types]
__pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 680; ...
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lxml/lxml.etree.c:130237:138: note: passing argument to parameter '__pyx_v_self' here
static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTContext__copy(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
^
src/lxml/lxml.etree.c:136329:3: warning: implicit declaration of function 'xsltProcessOneNode' is invalid in C99 [-Wimplicit-function-declaration]
xsltProcessOneNode(__pyx_v_context->_xsltCtxt, __pyx_v_c_context_node, NULL);
^
6 warnings generated.
clang: warning: argument unused during compilation: '-flat_namespace'
Adding lxml 3.0alpha2 to easy-install.pth file

Export Bar and Horizontal in PNG picture

Hi team,

I've got a problem during exporting my charts in PNG format.
Two kind of chart display tooltip values: Bar and Horizontal

With big data structure, the charts are unreadable. I've attached a screenshot of the graph
BarHorizontalChartBug

Have you got any issues to solve that ?

Thanks a lot for your work

Bar Chart: Adding labels push data to the left.

Hi. When I plot a bar chart without applying object.x_labels, my bars plot across the screen and everything seems ok:

screen shot 2013-09-26 at 12 55 03 pm

When I try to plot with object.x_labels defined, however, the bars push to the left of the graph and the labels go across the bottom of the screen:

screen shot 2013-09-26 at 12 57 36 pm

This is the code I am using to create labels (histogram is my bar chart object):

histogram.x_labels = map(str,xaxislabels)
histogram.x_label_rotation=270

xaxislabels is a list that is equal in size to the number of bars I am plotting.

I have tried this using this as well:

histogram.xlabels = map(str,range(len(xaxislabels)))
histogram.x_label_rotation=270

Just for reference, I am using Google Chrome on Mac OSX 10.8.5 to view the SVG files. I will update this issue when I get a chance to view it with other browsers. Thanks.

python 3 compatibility

Hello,

Did you plan to make pygal py3 compatible ? since you're use a lots for map & filters, those two builtins doesn't returns list anymore.

e.g.:

File "/Users/user/Projects/my/fatastic/project/venv3/lib/python3.3/site-packages/pygal/util.py", line 309, in prepare_values
[len(config.x_labels or [])])
TypeError: object of type 'map' has no len()

Capability to invert graph

Add functionality to make 0 the top of the graph and higher numbers (1, 2, ... 100, etc) at the bottom. Would be able to show trending upwards when lower numbers are associated with a more positive outcome.

lxml required before it is installed

Pygal’s setup.py imports pygal to get the version number, which in turn imports lxml. But lxml might not be installed yet at this point, so the install fails.

Chart with two axes

As an improvment, is it possible to manage two axes on the same chart ?

Exemple:
Two axes

Thk for this awesome library :)

Sweden in worldmap

In the country list there is no Sweden (code: 'se')

Best regards.

Massimo

Support Histograms (actually do it ;-) )

The docs mention histograms, but it isn't really supported. Only bar charts. Or if you take away the padding between the bars, I guess you could call it a normalized histogram.

A real histogram would need a way to set a width too. I don't know if the computation of the "real height" should be done before, in the dataset, or by pygal. It'd probably need its own type as well, to avoid messing with Bar() which could stay simple.

http://en.wikipedia.org/wiki/File:Travel_time_histogram_total_n_Stata.png
http://en.wikipedia.org/wiki/Histogram

XY (and DateY) do not honour include_x_axis

For example, the following will use the range from the data (123,145), and not extend to the x axis as a line graph would (0,145).

xy = pygal.XY(include_x_axis=True)
chart.add('x', [(1,123),(2,145)])

datey = pygal.DateY(include_x_axis=True)
chart.add('x', [(datetime.now(),123),(datetime.now()+timedelta(1),145)])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.