Skip to content

Python API plotly.offline: Save Plot as SVG, "rgba" not translated correctly if using Pie Chart. #1614

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

Closed
dsholes opened this issue Apr 20, 2017 · 1 comment
Assignees
Labels
bug something broken

Comments

@dsholes
Copy link

dsholes commented Apr 20, 2017

With Python API, I have been setting data.marker.color using an "rgba" string. When saving the plot as an SVG image using plotly.offline.plot(figure,image='svg',), the "rgba" is translated into "rgb" and "fill-opacity" as long as the figure is a bar chart or stacked bar chart, which is the preferred behavior.

However, when using a Pie chart, the SVG style "fill" for each Slice attempts to use "rgba" (i.e. it is not translated to "rgb" and "fill-opacity"). This is not an issue when viewing the SVG in the browser. However, Inkscape, GIMP (and I assume Illustrator) cannot interpret "rgba" values, and so opening the Pie chart SVG gives only black slices (i.e. the fill for each slice is "Unset").

This is not a huge issue, as users can manually set alpha using data.opacity and pass an "rgb" string to data.marker.color, producing an SVG that behaves correctly in Inkscape.

I just want to highlight the fact that the behavior is different for Bar Charts and Pie Charts.

This may be related to user's issue in plotly.js #707.

@alexcjohnson
Copy link
Collaborator

Thanks for the report @dsholes - #1615 should fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

2 participants