ios - 在 iOS 图表中使用自定义颜色 labelTextColor

标签 ios swift ios-charts

有谁知道如何在 iOS 图表中使用自定义颜色来使用 labelTextColor?当我尝试插入自定义颜色时,标签就消失了。例如:

这个有效:

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

但是像这样的东西不会:

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

最佳答案

替换

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

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

关于ios - 在 iOS 图表中使用自定义颜色 labelTextColor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38422505/

相关文章:

iPhone:viewWillAppear 仅在从其他 View 返回时出现

ios - iOS 中的简单计时器

macos - 在 Swift 中创建像这样的普通框窗口吗?

swift - 更改组合图表中的 yValue 标签垂直间距(ios-charts)

ios - 如何在 MPAndroidChart 中缩小时隐藏值标签?

ios - 如何将数据从一个 WKInterfaceController 推送到另一个?

ios - 许多教程介绍了在 Storyboard 中添加多个 subview Controller 的方法,为什么不直接添加多个容器 View 呢?

ios - 变换使尺寸不同

ios - 在单元格之间的 UICollectionView 中设置/覆盖填充

ios - 可滚动折线图