Kooky_Lukey
Kooky_Lukey

Reputation: 137

Using Custom Color with iOS Charts labelTextColor

Does anyone know how to get a custom color to work with labelTextColor in iOS Charts? When I try to plug in a custom color the labels just disappear. For example:

This works:

self.chartView.leftAxis.labelTextColor = UIColor.cyanColor()

But something like this does not:

self.chartView.rightAxis.labelTextColor = UIColor(red: 150, green: 202, blue: 56, alpha: 1)

Upvotes: 1

Views: 150

Answers (1)

Igor
Igor

Reputation: 12303

replace

self.chartView.rightAxis.labelTextColor = UIColor(red: 150, green: 202, blue: 56, alpha: 1)

with

self.chartView.rightAxis.labelTextColor = UIColor(red: 150.0/255, green: 202.0/255, blue: 56.0/255, alpha: 1)

Upvotes: 5

Related Questions