I'm trying out a few things with the iOS Charts library with Swift 3.0. I have a question about formatting of the lineChartDataset values (displayed above each value point). Right now these values are 'double' and are displayed as 2.0 and 3.0 instead of just 2 and 3 etc. Is it possible to round these values? I tried with numberFormatter but nothing works. Any help would be appreciated.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- Mercurial Commit Charts / Graphs [closed]
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
ios-charts have been upgraded to protocol base approach for rendering the various kind of labels like xAxis, yAxis etc. So you have to implement protocol
IValueFormatter
in order to achieve the required results. I have created the class for the same, so directly use this as below & you would be able to achieve desired results.Create a class named as
DigitValueFormatter
& assign that toLineChartData
object aslineChartData.setValueFormatter(DigitValueFormatter())