RadarMarkerView.swift 740 B

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // RadarMarkerView.swift
  3. // ChartsDemo
  4. //
  5. // Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
  6. // A port of MPAndroidChart for iOS
  7. // Licensed under Apache License 2.0
  8. //
  9. // https://github.com/danielgindi/Charts
  10. //
  11. import Foundation
  12. import Charts
  13. #if canImport(UIKit)
  14. import UIKit
  15. #endif
  16. open class RadarMarkerView: MarkerView
  17. {
  18. @IBOutlet var label: UILabel?
  19. open override func awakeFromNib()
  20. {
  21. self.offset.x = -self.frame.size.width / 2.0
  22. self.offset.y = -self.frame.size.height - 7.0
  23. }
  24. open override func refreshContent(entry: ChartDataEntry, highlight: Highlight)
  25. {
  26. label?.text = String.init(format: "%d %%", Int(round(entry.y)))
  27. layoutIfNeeded()
  28. }
  29. }