You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried researching trying to figure out how to add a gradient to my bar chart. However I am not able to to implement it. Many people have done something similar to :
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
yourDataSetName.fill = Fill.fillWithLinearGradient(gradient!, angle: 90.0) // Set the Gradient
set.drawFilledEnabled = true // Draw the Gradient
However it seems like this only works for line graphs since .drawFilledEnabled and .fill does not work with BarChartDataSet.
I get the error: Value of type 'BarChartDataSet' has no member 'drawFilledEnabled' and Value of type 'BarChartDataSet' has no member 'fill'
Would really appreciate if I can get some help on this! Thank you!!
The text was updated successfully, but these errors were encountered:
I have tried researching trying to figure out how to add a gradient to my bar chart. However I am not able to to implement it. Many people have done something similar to :
However it seems like this only works for line graphs since
.drawFilledEnabled
and.fill
does not work withBarChartDataSet
.I get the error:
Value of type 'BarChartDataSet' has no member 'drawFilledEnabled'
andValue of type 'BarChartDataSet' has no member 'fill'
Would really appreciate if I can get some help on this! Thank you!!
The text was updated successfully, but these errors were encountered: