ScatterChartData.swift 926 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // ScatterChartData.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. open class ScatterChartData: BarLineScatterCandleBubbleChartData
  14. {
  15. public required init()
  16. {
  17. super.init()
  18. }
  19. public override init(dataSets: [ChartDataSetProtocol])
  20. {
  21. super.init(dataSets: dataSets)
  22. }
  23. public required init(arrayLiteral elements: ChartDataSetProtocol...)
  24. {
  25. super.init(dataSets: elements)
  26. }
  27. /// - Returns: The maximum shape-size across all DataSets.
  28. @objc open func getGreatestShapeSize() -> CGFloat
  29. {
  30. return (_dataSets as? [ScatterChartDataSetProtocol])?
  31. .max { $0.scatterShapeSize < $1.scatterShapeSize }?
  32. .scatterShapeSize ?? 0
  33. }
  34. }