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

Set line cap to CGMutablePath #2159

Closed
Lukaz32 opened this issue Feb 13, 2017 · 2 comments
Closed

Set line cap to CGMutablePath #2159

Lukaz32 opened this issue Feb 13, 2017 · 2 comments

Comments

@Lukaz32
Copy link

Lukaz32 commented Feb 13, 2017

Hi,
I'm trying to achieve an effect like that to my pie chart:
captura de tela 2017-02-13 as 16 29 23
( I mean the rounded edges)

I've tried to add context.setLineCap(.round) to the PieChartRenderer but it makes no difference.

Does anyone know how I can achieve that?

Thanks.

@liuxuan30
Copy link
Member

I did a quick check, the pie chart is not simply an arc with rounded cap. It may contains two arc and draw the lines to connect them.

You might need to replace addLine() with arcs as the rounded effect in open func drawDataSet(context: CGContext, dataSet: IPieChartDataSet). You have to calculate your arc though.

I stroke the path so you know the edges:
image

@rbarbish
Copy link

rbarbish commented Apr 3, 2017

@Lukaz32 - Do you have any snippets of code you wouldn't mind sharing that you used to make this happen?

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