-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render_to_png creates all black pictures #2
Comments
Is the SVG also black if you open it a web browser? Admittedly this should be better documented. |
Installed tinycss and cssselect and now everything is just fine. |
Same kind of trouble... all is black :( svg and i can't create png |
In the SVG also black when opened in a web browser?
pycairo for python 3 is a thing. But so is cairocffi, which might be easier to install: http://pythonhosted.org/cairocffi/ CairoSVG (that Pygal uses to render PNG) supports either. Also don’t forget to install tinycss and cssselect, as mentioned above. |
Hi, Traceback (most recent call last): File
File
File
File
File
File
OSError: cannot load library libcairo.2.dylib: dlopen(libcairo.2.dylib, 2): Seb 2014-12-12 13:49 GMT+04:00 Simon Sapin notifications@github.com:
|
Try installing cairo with HomeBrew, MacPorts, or whatever your favorite package manager is. |
cairo installed via MacPorts, successfully... indeed my png is black :( |
Hi, But black pictures are all there!
|
Hi I installed tinycss and cssselect but I am still getting black images. I can view the svg in the browser but the resulting png is black and the svg if seen outside a browser is also black. Please help. |
Just a quick update. I am using ipython notebook generally. Apparently when trying to run the code through the notebook the png appears black. When I transfer the python code to an external file and run it it works fine. Any ideas as to why? |
Are you sure both tinycss and cssselect are installed in your notebook environment ? |
Same story here. Ubuntu, all libraries listed in comments to this issues were installed. And still black picture instead of the chart. SVG is OK |
Getting black PNG when the SVG file is OK means that the CSS is not correctly applied. With CairoSVG (used by Some other SVG renderers are known to fail at rendering Pygal graphs. So:
|
pip install lxml |
solved my problem |
solved my problem - Centos 6, Python 2.7.14 |
I had the same problem and none of the above solutions worked for me. I wanted to embed the svgs directly into html code via a cgi-script, so I generated the svg in a folder where a style.css for this website was stored. I could solve my problem by renaming that file, because apparently pygal detects and uses files named "style.css" in the same directory automatically. In my case, this broke the svg, which was the reason for the all black picture. I don't know if this is unexpected behaviour but at least I can't find anything about this automatic detection in the documentation and if it is desired it seems to produce corrupted svg-files. |
oooo same problem here. I had it working just fine in python3 virtualenv. But the boss/server requires python2. So now with a new virtualenv and everything reinstalled (including lxml, cairosvg, cssselect, and tinycss) there is nothing but black. It doesn't matter if it's a .svg, .png, or browser render. Any ideas? |
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!
The text was updated successfully, but these errors were encountered: