Is there any way to fill the bar in a bar chart with a gradient. I can make the gradient like this as explained in the link below:
let gradientColors = [UIColor.cyan.cgColor, UIColor.clear.cgColor] as CFArray // Colors of the gradient
let colorLocations:[CGFloat] = [1.0, 0.0] // Positioning of the gradient
let gradient = CGGradient.init(colorsSpace: CGColorSpaceCreateDeviceRGB(),
colors: gradientColors, locations: colorLocations) // Gradient Object
but how to apply it on the bars?
Previous question Gradient Fill in Swift for iOS-Charts does not answer it because .fill
is not available on BarChartDataSet