ChartView icon indicating copy to clipboard operation
ChartView copied to clipboard

Line charts upside down on WidgetKit -- v2-beta

Open skg54 opened this issue 4 years ago • 4 comments

Depending on what your use-case desires: line charts out of the box will be upside down on widgets. To solve this remove all instances of rotationEffects -- and animations for good measure.

    //.rotationEffect(.degrees(180), anchor: .center)
    //.rotation3DEffect(.degrees(180), axis: (x: 0, y: 1, z: 0))

skg54 avatar Oct 04 '20 08:10 skg54

rotationEffects only need to be removed if you set the frame height .frame(height: 9) on the chart

I ended up having to fork and make some additional modifications. Great library as a starting point for my marine forecast and tides widgets

IMG_6187

skg54 avatar Oct 08 '20 09:10 skg54

@skg54 how did you get the axis labels and markings?

bcbeta avatar Oct 08 '20 13:10 bcbeta

Somehow, depending on the size of the frame, it will require the rotation... or not. Not sure why this is the case

kevinmun avatar Jan 26 '21 05:01 kevinmun

@skg54 how did you get the axis labels and markings?

They appear to be fixed values

ecr007 avatar Aug 19 '21 17:08 ecr007