arakweker
arakweker

Reputation: 1625

LineChart not working in Xcode 11.1 and 11.2 beta

After upgrading to Xcode 11.1 and 11.2 beta, my app doesn't work as expected. I'm using zemirco/swift-linechart for drawing a linechart. In Xcode 11.0 that is working fine (see screen dump), in Xcode 11.1 and 11.2 not (see screen dump). I didn't change anything in the code.

The code for this view is:

var body: some View {

    List{

        LineChartController(lineCoordinates: eggItem!.graphWeights, lineCoordinatesMin: eggItem!.graphWeightsMin, lineCoordinatesMax: eggItem!.graphWeightsMax)
            .frame(minWidth: 0, maxWidth: .infinity, minHeight: 0, maxHeight: 250)
            .padding(.init(top: 4, leading: 4, bottom: 4, trailing: 4))
            .overlay(
                RoundedRectangle(cornerRadius: 12)
                    .stroke(Color.black, lineWidth: 1))

        ForEach(eggItem!.calcWeights) { eggDay in
            NavigationLink(destination: EggDetail(eggDay: eggDay)) {
                CellDayRow(eggDay: eggDay)
            }
         }
    }
    .listRowInsets(EdgeInsets(top: 0, leading: -10, bottom: 0, trailing: -10))
    .navigationBarItems(trailing: NavigationLink(destination: Settings()){
        Text("Add Day")})
    .navigationBarTitle(Text("Weight Egg id-"+String(self.egg.eggNumber)), displayMode: .inline)

}

Are my problems caused be changes in Xcode / SwiftUI? Or something in the LineChart Swift code? Where should I start digging...

Xcode 11.0 Xcode 11.2 beta

Upvotes: 2

Views: 234

Answers (1)

Fredy
Fredy

Reputation: 2063

Try using frame and set the dimensions of the LineGraphController Ex: .frame(height: 300)

Upvotes: 2

Related Questions