react-native-svg-charts icon indicating copy to clipboard operation
react-native-svg-charts copied to clipboard

PieChart strokeLinejoin doesnt work

Open Knight704 opened this issue 7 years ago • 6 comments
trafficstars

What is the problem?

strokeLinejoin: 'round' doesnt do rounded corners to Pie slices

When does it happen?

Using PieChart component

What platform?

iOS, Android

React Native version: 0.57

Code to reproduce


const data = [
      347,
      500,
      153,
    ].map((value, index) => ({
      value,
      key: `slise-${index}`,
      svg: {
        strokeLinejoin: 'round',
        fill: COLORS[index],
      },
    }))

<PieChart
          data={data}
          startAngle={-Math.PI / 2}
          endAngle={Math.PI / 2}
          padAngle={0}
          outerRadius="100%"
          innerRadius="88%"
        />

Result: no rounded corners screen shot 2018-11-09 at 17 19 45

Knight704 avatar Nov 09 '18 13:11 Knight704

using cornerRadius as part of arc property of items provides nearly expected behavior, but it also round corners between see example screen shot 2018-11-09 at 17 55 22

Knight704 avatar Nov 09 '18 13:11 Knight704

Yeah, I bumped into this as well. I would like to only round one of the sides of the arcs, namely the left side of the first arc and the right side of the last arc. Did you find any workaround for this @Knight704 ? Or perhaps can you suggest something that would create this effect @JesperLekland? Thanks.

hitmanmcc avatar Aug 27 '19 11:08 hitmanmcc

@hitmanmcc Do you able to create the desired effect? I also needs to achieve same.

codeapp17 avatar Feb 18 '22 11:02 codeapp17

@codeapp17 No, we ended up dropping the idea and going a different route, sorry.

hitmanmcc avatar Feb 18 '22 11:02 hitmanmcc

@codeapp17 No, we ended up dropping the idea and going a different route, sorry.

No Problem, thanks anyways

codeapp17 avatar Feb 18 '22 12:02 codeapp17