我使用图表库找到here。iOS图表Double to Int Swift
我有一个图表显示每个酒吧标签为15.0而不是15的双。我听说你必须使用valueFormatter来更改值,但不知道如何实现它。到目前为止,我有:
let format = NumberFormatter()
format.numberStyle = .none
let formatter = DefaultValueFormatter(formatter: format)
BarChartData.setValueFormatter(formatter) // error here
我越来越:
实例成员setValueFormatter不能在类型ChartData使用
BarChartData似乎是一个类而不是实例。 – Larme
尝试[在错误上搜索](https://stackoverflow.com/search?q=%5Bswift%5D+instance+member+can+not+be+used+on+type) – rmaddy
你知道如何更改数据图表标签的格式? – Martheli