ComponentBase.swift 901 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // ComponentBase.swift
  3. // Charts
  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 CoreGraphics
  13. /// This class encapsulates everything both Axis, Legend and LimitLines have in common
  14. @objc(ChartComponentBase)
  15. open class ComponentBase: NSObject
  16. {
  17. /// flag that indicates if this component is enabled or not
  18. @objc open var enabled = true
  19. /// The offset this component has on the x-axis
  20. /// **default**: 5.0
  21. @objc open var xOffset = CGFloat(5.0)
  22. /// The offset this component has on the x-axis
  23. /// **default**: 5.0 (or 0.0 on ChartYAxis)
  24. @objc open var yOffset = CGFloat(5.0)
  25. public override init()
  26. {
  27. super.init()
  28. }
  29. @objc open var isEnabled: Bool { return enabled }
  30. }