0

I am updating to iOS Charts version 4. Adding the fill color below a line in a line chart seems to have changed because I get the error:

The old approach that worked for me...

userTotalEmissionsDataSet.fill = Fill(CGColor: colorLight.cgColor)

...now gives this error --> 'any Fill' cannot be constructed because it has no accessible initializers

What is the new approach? Thanks!

Context:

let userVehicleDataSet = LineChartDataSet(entries: userVehicleEmissionsChartDataArray)
    userVehicleDataSet.drawCirclesEnabled = false
    userVehicleDataSet.mode = .linear
    userVehicleDataSet.setColor(colorVehicleTravel)
    xc
    userVehicleDataSet.fillAlpha = 1.0
    userVehicleDataSet.drawFilledEnabled = true

1 Answer 1

0

Use .fillColor and not .fill

dataSet.fillColor = yourColor
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.