Skip to content
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

SVG rendering correctly but not PDF and EPS #22

Closed
eseifert opened this issue Mar 30, 2015 · 2 comments
Closed

SVG rendering correctly but not PDF and EPS #22

eseifert opened this issue Mar 30, 2015 · 2 comments

Comments

@eseifert
Copy link
Owner

Hi fellow charting lib developer!

I'm the main dev of XChart, and someone requested that I implement a vector graphics export function like Gral. (BTW, nice project!)

I was able to change a lot of my underlying code to get things compatible with vectorgraphics2d and the SVG export works great. The PDF and ESP are not so great though. I've attached some screenshots. Can you perhaps guess why the rendering isn't working properly?

Thanks, Tim

Imported from trac ticket #16, created by timmolter on 04-26-2014 at 17:16, last modified: 04-26-2014 at 17:16

@timmolter
Copy link

I figured this out. It's not an issue with vectorgraphics2d but with Swing. When switiching storkes from a dashed stroke to a solid stroke you need to use:

new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 10.0f, new float[] { 3.0f, 0.0f }, 0.0f);

and not:

new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);

I guess the dash doesn't get updated in the resulting Shape object, but setting the dash array to 3.0f, 0.0f is a hack to make it draw a solid line.

Feel free to close this issue.

@seifertm
Copy link
Collaborator

Thanks for letting us know. This behaviour is strange indeed.

Go ahead and reopen this issue, if anything else shows up.

@eseifert eseifert changed the title SVG rendering correctly but not PDF and ESP SVG rendering correctly but not PDF and EPS Apr 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants