jonfawcett 3 lat temu
rodzic
commit
b0feb369d5
21 zmienionych plików z 1058 dodań i 218 usunięć
  1. 39 0
      Pods/Charts/Source/Charts/Components/Marker.swift
  2. 42 0
      Pods/Charts/Source/Charts/Data/Interfaces/BarChartDataSetProtocol.swift
  3. 26 0
      Pods/Charts/Source/Charts/Data/Interfaces/BarLineScatterCandleBubbleChartDataSetProtocol.swift
  4. 27 0
      Pods/Charts/Source/Charts/Data/Interfaces/BubbleChartDataSetProtocol.swift
  5. 66 0
      Pods/Charts/Source/Charts/Data/Interfaces/CandleChartDataSetProtocol.swift
  6. 270 0
      Pods/Charts/Source/Charts/Data/Interfaces/ChartDataSetProtocol.swift
  7. 86 0
      Pods/Charts/Source/Charts/Data/Interfaces/LineChartDataSetProtocol.swift
  8. 45 0
      Pods/Charts/Source/Charts/Data/Interfaces/LineRadarChartDataSetProtocol.swift
  9. 36 0
      Pods/Charts/Source/Charts/Data/Interfaces/LineScatterCandleRadarChartDataSetProtocol.swift
  10. 64 0
      Pods/Charts/Source/Charts/Data/Interfaces/PieChartDataSetProtocol.swift
  11. 40 0
      Pods/Charts/Source/Charts/Data/Interfaces/RadarChartDataSetProtocol.swift
  12. 36 0
      Pods/Charts/Source/Charts/Data/Interfaces/ScatterChartDataSetProtocol.swift
  13. 30 0
      Pods/Charts/Source/Charts/Formatters/AxisValueFormatter.swift
  14. 21 0
      Pods/Charts/Source/Charts/Formatters/FillFormatter.swift
  15. 36 0
      Pods/Charts/Source/Charts/Formatters/ValueFormatter.swift
  16. 23 0
      Pods/Charts/Source/Charts/Highlight/Highlighter.swift
  17. 45 0
      Pods/Charts/Source/Charts/Renderers/AxisRenderer.swift
  18. 0 218
      Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift
  19. 75 0
      Pods/Charts/Source/Charts/Renderers/DataRenderer.swift
  20. 32 0
      Pods/Charts/Source/Charts/Renderers/Scatter/ShapeRenderer.swift
  21. 19 0
      Pods/Charts/Source/Charts/Utils/Sequence+KeyPath.swift

+ 39 - 0
Pods/Charts/Source/Charts/Components/Marker.swift

@@ -0,0 +1,39 @@
+//
+//  ChartMarker.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc(ChartMarker)
+public protocol Marker: AnyObject
+{
+    /// - Returns: The desired (general) offset you wish the IMarker to have on the x-axis.
+    /// By returning x: -(width / 2) you will center the IMarker horizontally.
+    /// By returning y: -(height / 2) you will center the IMarker vertically.
+    var offset: CGPoint { get }
+    
+    /// - Parameters:
+    ///   - point: This is the point at which the marker wants to be drawn. You can adjust the offset conditionally based on this argument.
+    /// - Returns: The offset for drawing at the specific `point`.
+    ///            This allows conditional adjusting of the Marker position.
+    ///            If you have no adjustments to make, return self.offset().
+    func offsetForDrawing(atPoint: CGPoint) -> CGPoint
+    
+    /// This method enables a custom Marker to update it's content every time the Marker is redrawn according to the data entry it points to.
+    ///
+    /// - Parameters:
+    ///   - entry: The Entry the IMarker belongs to. This can also be any subclass of Entry, like BarEntry or CandleEntry, simply cast it at runtime.
+    ///   - highlight: The highlight object contains information about the highlighted value such as it's dataset-index, the selected range or stack-index (only stacked bar entries).
+    func refreshContent(entry: ChartDataEntry, highlight: Highlight)
+    
+    /// Draws the Marker on the given position on the given context
+    func draw(context: CGContext, point: CGPoint)
+}

+ 42 - 0
Pods/Charts/Source/Charts/Data/Interfaces/BarChartDataSetProtocol.swift

@@ -0,0 +1,42 @@
+//
+//  BarChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol BarChartDataSetProtocol: BarLineScatterCandleBubbleChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    /// `true` if this DataSet is stacked (stacksize > 1) or not.
+    var isStacked: Bool { get }
+    
+    /// The maximum number of bars that can be stacked upon another in this DataSet.
+    var stackSize: Int { get }
+    
+    /// the color used for drawing the bar-shadows. The bar shadows is a surface behind the bar that indicates the maximum value
+    var barShadowColor: NSUIColor { get set }
+    
+    /// the width used for drawing borders around the bars. If borderWidth == 0, no border will be drawn.
+    var barBorderWidth : CGFloat { get set }
+
+    /// the color drawing borders around the bars.
+    var barBorderColor: NSUIColor { get set }
+
+    /// the alpha value (transparency) that is used for drawing the highlight indicator bar. min = 0.0 (fully transparent), max = 1.0 (fully opaque)
+    var highlightAlpha: CGFloat { get set }
+    
+    /// array of labels used to describe the different values of the stacked bars
+    var stackLabels: [String] { get set }
+}

+ 26 - 0
Pods/Charts/Source/Charts/Data/Interfaces/BarLineScatterCandleBubbleChartDataSetProtocol.swift

@@ -0,0 +1,26 @@
+//
+//  BarLineScatterCandleBubbleChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol BarLineScatterCandleBubbleChartDataSetProtocol: ChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    var highlightColor: NSUIColor { get set }
+    var highlightLineWidth: CGFloat { get set }
+    var highlightLineDashPhase: CGFloat { get set }
+    var highlightLineDashLengths: [CGFloat]? { get set }
+}

+ 27 - 0
Pods/Charts/Source/Charts/Data/Interfaces/BubbleChartDataSetProtocol.swift

@@ -0,0 +1,27 @@
+//
+//  BubbleChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol BubbleChartDataSetProtocol: BarLineScatterCandleBubbleChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    var maxSize: CGFloat { get }
+    var isNormalizeSizeEnabled: Bool { get }
+    
+    // MARK: - Styling functions and accessors
+    
+    /// Sets/gets the width of the circle that surrounds the bubble when highlighted
+    var highlightCircleWidth: CGFloat { get set }
+}

+ 66 - 0
Pods/Charts/Source/Charts/Data/Interfaces/CandleChartDataSetProtocol.swift

@@ -0,0 +1,66 @@
+//
+//  CandleChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol CandleChartDataSetProtocol: LineScatterCandleRadarChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    /// the space that is left out on the left and right side of each candle,
+    /// **default**: 0.1 (10%), max 0.45, min 0.0
+    var barSpace: CGFloat { get set }
+    
+    /// should the candle bars show?
+    /// when false, only "ticks" will show
+    ///
+    /// **default**: true
+    var showCandleBar: Bool { get set }
+    
+    /// the width of the candle-shadow-line in pixels.
+    ///
+    /// **default**: 3.0
+    var shadowWidth: CGFloat { get set }
+    
+    /// the color of the shadow line
+    var shadowColor: NSUIColor? { get set }
+    
+    /// use candle color for the shadow
+    var shadowColorSameAsCandle: Bool { get set }
+    
+    /// Is the shadow color same as the candle color?
+    var isShadowColorSameAsCandle: Bool { get }
+    
+    /// color for open == close
+    var neutralColor: NSUIColor? { get set }
+    
+    /// color for open > close
+    var increasingColor: NSUIColor? { get set }
+    
+    /// color for open < close
+    var decreasingColor: NSUIColor? { get set }
+    
+    /// Are increasing values drawn as filled?
+    var increasingFilled: Bool { get set }
+    
+    /// Are increasing values drawn as filled?
+    var isIncreasingFilled: Bool { get }
+    
+    /// Are decreasing values drawn as filled?
+    var decreasingFilled: Bool { get set }
+    
+    /// Are decreasing values drawn as filled?
+    var isDecreasingFilled: Bool { get }
+}

+ 270 - 0
Pods/Charts/Source/Charts/Data/Interfaces/ChartDataSetProtocol.swift

@@ -0,0 +1,270 @@
+//
+//  ChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol ChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    /// Use this method to tell the data set that the underlying data has changed
+    func notifyDataSetChanged()
+    
+    /// Calculates the minimum and maximum x and y values (xMin, xMax, yMin, yMax).
+    func calcMinMax()
+    
+    /// Calculates the min and max y-values from the Entry closest to the given fromX to the Entry closest to the given toX value.
+    /// This is only needed for the autoScaleMinMax feature.
+    func calcMinMaxY(fromX: Double, toX: Double)
+    
+    /// The minimum y-value this DataSet holds
+    var yMin: Double { get }
+    
+    /// The maximum y-value this DataSet holds
+    var yMax: Double { get }
+    
+    /// The minimum x-value this DataSet holds
+    var xMin: Double { get }
+    
+    /// The maximum x-value this DataSet holds
+    var xMax: Double { get }
+    
+    /// The number of y-values this DataSet represents
+    var entryCount: Int { get }
+    
+    /// - Throws: out of bounds
+    /// if `i` is out of bounds, it may throw an out-of-bounds exception
+    /// - Returns: The entry object found at the given index (not x-value!)
+    func entryForIndex(_ i: Int) -> ChartDataEntry?
+    
+    /// - Parameters:
+    ///   - xValue: the x-value
+    ///   - closestToY: If there are multiple y-values for the specified x-value,
+    ///   - rounding: determine whether to round up/down/closest if there is no Entry matching the provided x-value
+    /// - Returns: The first Entry object found at the given x-value with binary search.
+    /// If the no Entry at the specified x-value is found, this method returns the Entry at the closest x-value according to the rounding.
+    /// nil if no Entry object at that x-value.
+    func entryForXValue(
+        _ xValue: Double,
+        closestToY yValue: Double,
+        rounding: ChartDataSetRounding) -> ChartDataEntry?
+    
+    /// - Parameters:
+    ///   - xValue: the x-value
+    ///   - closestToY: If there are multiple y-values for the specified x-value,
+    /// - Returns: The first Entry object found at the given x-value with binary search.
+    /// If the no Entry at the specified x-value is found, this method returns the Entry at the closest x-value.
+    /// nil if no Entry object at that x-value.
+    func entryForXValue(
+        _ xValue: Double,
+        closestToY yValue: Double) -> ChartDataEntry?
+    
+    /// - Returns: All Entry objects found at the given x-value with binary search.
+    /// An empty array if no Entry object at that x-value.
+    func entriesForXValue(_ xValue: Double) -> [ChartDataEntry]
+    
+    /// - Parameters:
+    ///   - xValue: x-value of the entry to search for
+    ///   - closestToY: If there are multiple y-values for the specified x-value,
+    ///   - rounding: Rounding method if exact value was not found
+    /// - Returns: The array-index of the specified entry.
+    /// If the no Entry at the specified x-value is found, this method returns the index of the Entry at the closest x-value according to the rounding.
+    func entryIndex(
+        x xValue: Double,
+        closestToY yValue: Double,
+        rounding: ChartDataSetRounding) -> Int
+    
+    /// - Parameters:
+    ///   - e: the entry to search for
+    /// - Returns: The array-index of the specified entry
+    func entryIndex(entry e: ChartDataEntry) -> Int
+    
+    /// Adds an Entry to the DataSet dynamically.
+    ///
+    /// *optional feature, can return `false` ifnot implemented*
+    ///
+    /// Entries are added to the end of the list.
+    ///
+    /// - Parameters:
+    ///   - e: the entry to add
+    /// - Returns: `true` if the entry was added successfully, `false` ifthis feature is not supported
+    func addEntry(_ e: ChartDataEntry) -> Bool
+    
+    /// Adds an Entry to the DataSet dynamically.
+    /// Entries are added to their appropriate index in the values array respective to their x-position.
+    /// This will also recalculate the current minimum and maximum values of the DataSet and the value-sum.
+    ///
+    /// *optional feature, can return `false` ifnot implemented*
+    ///
+    /// Entries are added to the end of the list.
+    ///
+    /// - Parameters:
+    ///   - e: the entry to add
+    /// - Returns: `true` if the entry was added successfully, `false` ifthis feature is not supported
+    func addEntryOrdered(_ e: ChartDataEntry) -> Bool
+    
+    /// Removes an Entry from the DataSet dynamically.
+    ///
+    /// *optional feature, can return `false` ifnot implemented*
+    ///
+    /// - Parameters:
+    ///   - entry: the entry to remove
+    /// - Returns: `true` if the entry was removed successfully, `false` ifthe entry does not exist or if this feature is not supported
+    func removeEntry(_ entry: ChartDataEntry) -> Bool
+    
+    /// Removes the Entry object at the given index in the values array from the DataSet.
+    ///
+    /// *optional feature, can return `false` ifnot implemented*
+    ///
+    /// - Parameters:
+    ///   - index: the index of the entry to remove
+    /// - Returns: `true` if the entry was removed successfully, `false` ifthe entry does not exist or if this feature is not supported
+    func removeEntry(index: Int) -> Bool
+    
+    /// Removes the Entry object closest to the given x-value from the DataSet.
+    ///
+    /// *optional feature, can return `false` ifnot implemented*
+    ///
+    /// - Parameters:
+    ///   - x: the x-value to remove
+    /// - Returns: `true` if the entry was removed successfully, `false` ifthe entry does not exist or if this feature is not supported
+    func removeEntry(x: Double) -> Bool
+    
+    /// Removes the first Entry (at index 0) of this DataSet from the entries array.
+    ///
+    /// *optional feature, can return `false` ifnot implemented*
+    ///
+    /// - Returns: `true` if the entry was removed successfully, `false` ifthe entry does not exist or if this feature is not supported
+    func removeFirst() -> Bool
+    
+    /// Removes the last Entry (at index 0) of this DataSet from the entries array.
+    ///
+    /// *optional feature, can return `false` ifnot implemented*
+    ///
+    /// - Returns: `true` if the entry was removed successfully, `false` ifthe entry does not exist or if this feature is not supported
+    func removeLast() -> Bool
+    
+    /// Checks if this DataSet contains the specified Entry.
+    ///
+    /// - Returns: `true` if contains the entry, `false` ifnot.
+    func contains(_ e: ChartDataEntry) -> Bool
+    
+    /// Removes all values from this DataSet and does all necessary recalculations.
+    ///
+    /// *optional feature, could throw if not implemented*
+    func clear()
+    
+    // MARK: - Styling functions and accessors
+    
+    /// The label string that describes the DataSet.
+    var label: String? { get }
+    
+    /// The axis this DataSet should be plotted against.
+    var axisDependency: YAxis.AxisDependency { get }
+    
+    /// List representing all colors that are used for drawing the actual values for this DataSet
+    var valueColors: [NSUIColor] { get }
+    
+    /// All the colors that are used for this DataSet.
+    /// Colors are reused as soon as the number of Entries the DataSet represents is higher than the size of the colors array.
+    var colors: [NSUIColor] { get }
+    
+    /// - Returns: The color at the given index of the DataSet's color array.
+    /// This prevents out-of-bounds by performing a modulus on the color index, so colours will repeat themselves.
+    func color(atIndex: Int) -> NSUIColor
+    
+    func resetColors()
+    
+    func addColor(_ color: NSUIColor)
+    
+    func setColor(_ color: NSUIColor)
+    
+    /// if true, value highlighting is enabled
+    var highlightEnabled: Bool { get set }
+    
+    /// `true` if value highlighting is enabled for this dataset
+    var isHighlightEnabled: Bool { get }
+    
+    /// Custom formatter that is used instead of the auto-formatter if set
+    var valueFormatter: ValueFormatter { get set }
+    
+    /// Sets/get a single color for value text.
+    /// Setting the color clears the colors array and adds a single color.
+    /// Getting will return the first color in the array.
+    var valueTextColor: NSUIColor { get set }
+    
+    /// - Returns: The color at the specified index that is used for drawing the values inside the chart. Uses modulus internally.
+    func valueTextColorAt(_ index: Int) -> NSUIColor
+    
+    /// the font for the value-text labels
+    var valueFont: NSUIFont { get set }
+    
+    /// The rotation angle (in degrees) for value-text labels
+    var valueLabelAngle: CGFloat { get set }
+    
+    /// The form to draw for this dataset in the legend.
+    ///
+    /// Return `.Default` to use the default legend form.
+    var form: Legend.Form { get }
+    
+    /// The form size to draw for this dataset in the legend.
+    ///
+    /// Return `NaN` to use the default legend form size.
+    var formSize: CGFloat { get }
+    
+    /// The line width for drawing the form of this dataset in the legend
+    ///
+    /// Return `NaN` to use the default legend form line width.
+    var formLineWidth: CGFloat { get }
+    
+    /// Line dash configuration for legend shapes that consist of lines.
+    ///
+    /// This is how much (in pixels) into the dash pattern are we starting from.
+    var formLineDashPhase: CGFloat { get }
+    
+    /// Line dash configuration for legend shapes that consist of lines.
+    ///
+    /// This is the actual dash pattern.
+    /// I.e. [2, 3] will paint [--   --   ]
+    /// [1, 3, 4, 2] will paint [-   ----  -   ----  ]
+    var formLineDashLengths: [CGFloat]? { get }
+    
+    /// Set this to true to draw y-values on the chart.
+    ///
+    /// - Note: For bar and line charts: if `maxVisibleCount` is reached, no values will be drawn even if this is enabled.
+    var drawValuesEnabled: Bool { get set }
+    
+    /// `true` if y-value drawing is enabled, `false` ifnot
+    var isDrawValuesEnabled: Bool { get }
+    
+    /// Set this to true to draw y-icons on the chart
+    ///
+    /// - Note: For bar and line charts: if `maxVisibleCount` is reached, no icons will be drawn even if this is enabled.
+    var drawIconsEnabled: Bool { get set }
+    
+    /// Returns true if y-icon drawing is enabled, false if not
+    var isDrawIconsEnabled: Bool { get }
+    
+    /// Offset of icons drawn on the chart.
+    ///
+    /// For all charts except Pie and Radar it will be ordinary (x offset, y offset).
+    ///
+    /// For Pie and Radar chart it will be (y offset, distance from center offset); so if you want icon to be rendered under value, you should increase X component of CGPoint, and if you want icon to be rendered closet to center, you should decrease height component of CGPoint.
+    var iconsOffset: CGPoint { get set }
+    
+    /// Set the visibility of this DataSet. If not visible, the DataSet will not be drawn to the chart upon refreshing it.
+    var visible: Bool { get set }
+    
+    /// `true` if this DataSet is visible inside the chart, or `false` ifit is currently hidden.
+    var isVisible: Bool { get }
+}

+ 86 - 0
Pods/Charts/Source/Charts/Data/Interfaces/LineChartDataSetProtocol.swift

@@ -0,0 +1,86 @@
+//
+//  LineChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+
+@objc
+public protocol LineChartDataSetProtocol: LineRadarChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    /// The drawing mode for this line dataset
+    ///
+    /// **default**: Linear
+    var mode: LineChartDataSet.Mode { get set }
+    
+    /// Intensity for cubic lines (min = 0.05, max = 1)
+    ///
+    /// **default**: 0.2
+    var cubicIntensity: CGFloat { get set }
+
+    /// If true, gradient lines are drawn instead of solid
+    var isDrawLineWithGradientEnabled: Bool { get set }
+
+    /// The points where gradient should change color
+    var gradientPositions: [CGFloat]? { get set }
+
+    /// The radius of the drawn circles.
+    var circleRadius: CGFloat { get set }
+    
+    /// The hole radius of the drawn circles.
+    var circleHoleRadius: CGFloat { get set }
+    
+    var circleColors: [NSUIColor] { get set }
+    
+    /// - Returns: The color at the given index of the DataSet's circle-color array.
+    /// Performs a IndexOutOfBounds check by modulus.
+    func getCircleColor(atIndex: Int) -> NSUIColor?
+    
+    /// Sets the one and ONLY color that should be used for this DataSet.
+    /// Internally, this recreates the colors array and adds the specified color.
+    func setCircleColor(_ color: NSUIColor)
+    
+    /// Resets the circle-colors array and creates a new one
+    func resetCircleColors(_ index: Int)
+    
+    /// If true, drawing circles is enabled
+    var drawCirclesEnabled: Bool { get set }
+    
+    /// `true` if drawing circles for this DataSet is enabled, `false` ifnot
+    var isDrawCirclesEnabled: Bool { get }
+    
+    /// The color of the inner circle (the circle-hole).
+    var circleHoleColor: NSUIColor? { get set }
+    
+    /// `true` if drawing circles for this DataSet is enabled, `false` ifnot
+    var drawCircleHoleEnabled: Bool { get set }
+    
+    /// `true` if drawing the circle-holes is enabled, `false` ifnot.
+    var isDrawCircleHoleEnabled: Bool { get }
+    
+    /// This is how much (in pixels) into the dash pattern are we starting from.
+    var lineDashPhase: CGFloat { get }
+    
+    /// This is the actual dash pattern.
+    /// I.e. [2, 3] will paint [--   --   ]
+    /// [1, 3, 4, 2] will paint [-   ----  -   ----  ]
+    var lineDashLengths: [CGFloat]? { get set }
+    
+    /// Line cap type, default is CGLineCap.Butt
+    var lineCapType: CGLineCap { get set }
+    
+    /// Sets a custom FillFormatterProtocol to the chart that handles the position of the filled-line for each DataSet. Set this to null to use the default logic.
+    var fillFormatter: FillFormatter? { get set }
+}

+ 45 - 0
Pods/Charts/Source/Charts/Data/Interfaces/LineRadarChartDataSetProtocol.swift

@@ -0,0 +1,45 @@
+//
+//  LineRadarChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol LineRadarChartDataSetProtocol: LineScatterCandleRadarChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    /// The color that is used for filling the line surface area.
+    var fillColor: NSUIColor { get set }
+
+    /// - Returns: The object that is used for filling the area below the line.
+    /// **default**: nil
+    var fill: Fill? { get set }
+    
+    /// The alpha value that is used for filling the line surface.
+    /// **default**: 0.33
+    var fillAlpha: CGFloat { get set }
+    
+    /// line width of the chart (min = 0.0, max = 10)
+    ///
+    /// **default**: 1
+    var lineWidth: CGFloat { get set }
+    
+    /// Set to `true` if the DataSet should be drawn filled (surface), and not just as a line.
+    /// Disabling this will give great performance boost.
+    /// Please note that this method uses the path clipping for drawing the filled area (with images, gradients and layers).
+    var drawFilledEnabled: Bool { get set }
+    
+    /// `true` if filled drawing is enabled, `false` if not
+    var isDrawFilledEnabled: Bool { get }
+}

+ 36 - 0
Pods/Charts/Source/Charts/Data/Interfaces/LineScatterCandleRadarChartDataSetProtocol.swift

@@ -0,0 +1,36 @@
+//
+//  LineScatterCandleRadarChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+
+@objc
+public protocol LineScatterCandleRadarChartDataSetProtocol: BarLineScatterCandleBubbleChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    /// Enables / disables the horizontal highlight-indicator. If disabled, the indicator is not drawn.
+    var drawHorizontalHighlightIndicatorEnabled: Bool { get set }
+    
+    /// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn.
+    var drawVerticalHighlightIndicatorEnabled: Bool { get set }
+    
+    /// `true` if horizontal highlight indicator lines are enabled (drawn)
+    var isHorizontalHighlightIndicatorEnabled: Bool { get }
+    
+    /// `true` if vertical highlight indicator lines are enabled (drawn)
+    var isVerticalHighlightIndicatorEnabled: Bool { get }
+    
+    /// Enables / disables both vertical and horizontal highlight-indicators.
+    /// :param: enabled
+    func setDrawHighlightIndicators(_ enabled: Bool)
+}

+ 64 - 0
Pods/Charts/Source/Charts/Data/Interfaces/PieChartDataSetProtocol.swift

@@ -0,0 +1,64 @@
+//
+//  PieChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol PieChartDataSetProtocol: ChartDataSetProtocol
+{
+    // MARK: - Styling functions and accessors
+
+    /// the space in pixels between the pie-slices
+    /// **default**: 0
+    /// **maximum**: 20
+    var sliceSpace: CGFloat { get set }
+
+    /// When enabled, slice spacing will be 0.0 when the smallest value is going to be smaller than the slice spacing itself.
+    var automaticallyDisableSliceSpacing: Bool { get set }
+
+    /// indicates the selection distance of a pie slice
+    var selectionShift: CGFloat { get set }
+
+    var xValuePosition: PieChartDataSet.ValuePosition { get set }
+    var yValuePosition: PieChartDataSet.ValuePosition { get set }
+
+    /// When valuePosition is OutsideSlice, indicates line color
+    var valueLineColor: NSUIColor? { get set }
+
+    /// When valuePosition is OutsideSlice and enabled, line will have the same color as the slice
+    var useValueColorForLine: Bool { get set }
+
+    /// When valuePosition is OutsideSlice, indicates line width
+    var valueLineWidth: CGFloat { get set }
+
+    /// When valuePosition is OutsideSlice, indicates offset as percentage out of the slice size
+    var valueLinePart1OffsetPercentage: CGFloat { get set }
+
+    /// When valuePosition is OutsideSlice, indicates length of first half of the line
+    var valueLinePart1Length: CGFloat { get set }
+
+    /// When valuePosition is OutsideSlice, indicates length of second half of the line
+    var valueLinePart2Length: CGFloat { get set }
+
+    /// When valuePosition is OutsideSlice, this allows variable line length
+    var valueLineVariableLength: Bool { get set }
+
+    /// the font for the slice-text labels
+    var entryLabelFont: NSUIFont? { get set }
+
+    /// the color for the slice-text labels
+    var entryLabelColor: NSUIColor? { get set }
+
+    /// get/sets the color for the highlighted sector
+    var highlightColor: NSUIColor? { get set }
+
+}

+ 40 - 0
Pods/Charts/Source/Charts/Data/Interfaces/RadarChartDataSetProtocol.swift

@@ -0,0 +1,40 @@
+//
+//  RadarChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol RadarChartDataSetProtocol: LineRadarChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    /// flag indicating whether highlight circle should be drawn or not
+    var drawHighlightCircleEnabled: Bool { get set }
+    
+    var isDrawHighlightCircleEnabled: Bool { get }
+    
+    var highlightCircleFillColor: NSUIColor? { get set }
+    
+    /// The stroke color for highlight circle.
+    /// If `nil`, the color of the dataset is taken.
+    var highlightCircleStrokeColor: NSUIColor? { get set }
+    
+    var highlightCircleStrokeAlpha: CGFloat { get set }
+    
+    var highlightCircleInnerRadius: CGFloat { get set }
+    
+    var highlightCircleOuterRadius: CGFloat { get set }
+    
+    var highlightCircleStrokeWidth: CGFloat { get set }
+}

+ 36 - 0
Pods/Charts/Source/Charts/Data/Interfaces/ScatterChartDataSetProtocol.swift

@@ -0,0 +1,36 @@
+//
+//  ScatterChartDataSetProtocol.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol ScatterChartDataSetProtocol: LineScatterCandleRadarChartDataSetProtocol
+{
+    // MARK: - Data functions and accessors
+    
+    // MARK: - Styling functions and accessors
+    
+    /// - Returns: The size the scatter shape will have
+    var scatterShapeSize: CGFloat { get }
+    
+    /// - Returns: The radius of the hole in the shape (applies to Square, Circle and Triangle)
+    /// Set this to <= 0 to remove holes.
+    /// **default**: 0.0
+    var scatterShapeHoleRadius: CGFloat { get }
+    
+    /// - Returns: Color for the hole in the shape. Setting to `nil` will behave as transparent.
+    /// **default**: nil
+    var scatterShapeHoleColor: NSUIColor? { get }
+    
+    /// - Returns: The ShapeRenderer responsible for rendering this DataSet.
+    var shapeRenderer: ShapeRenderer? { get }
+}

+ 30 - 0
Pods/Charts/Source/Charts/Formatters/AxisValueFormatter.swift

@@ -0,0 +1,30 @@
+//
+//  AxisValueFormatter.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+
+/// An interface for providing custom axis Strings.
+@objc(ChartAxisValueFormatter)
+public protocol AxisValueFormatter: AnyObject
+{
+    
+    /// Called when a value from an axis is formatted before being drawn.
+    ///
+    /// For performance reasons, avoid excessive calculations and memory allocations inside this method.
+    ///
+    /// - Parameters:
+    ///   - value:           the value that is currently being drawn
+    ///   - axis:            the axis that the value belongs to
+    /// - Returns: The customized label that is drawn on the x-axis.
+    func stringForValue(_ value: Double,
+                        axis: AxisBase?) -> String
+    
+}

+ 21 - 0
Pods/Charts/Source/Charts/Formatters/FillFormatter.swift

@@ -0,0 +1,21 @@
+//
+//  FillFormatter.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+/// Protocol for providing a custom logic to where the filling line of a LineDataSet should end. This of course only works if setFillEnabled(...) is set to true.
+@objc(ChartFillFormatter)
+public protocol FillFormatter
+{
+    /// - Returns: The vertical (y-axis) position where the filled-line of the LineDataSet should end.
+    func getFillLinePosition(dataSet: LineChartDataSetProtocol, dataProvider: LineChartDataProvider) -> CGFloat
+}

+ 36 - 0
Pods/Charts/Source/Charts/Formatters/ValueFormatter.swift

@@ -0,0 +1,36 @@
+//
+//  ValueFormatter.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+
+/// Interface that allows custom formatting of all values inside the chart before they are drawn to the screen.
+///
+/// Simply create your own formatting class and let it implement ValueFormatter. Then override the stringForValue()
+/// method and return whatever you want.
+
+@objc(ChartValueFormatter)
+public protocol ValueFormatter: AnyObject
+{
+    
+    /// Called when a value (from labels inside the chart) is formatted before being drawn.
+    ///
+    /// For performance reasons, avoid excessive calculations and memory allocations inside this method.
+    ///
+    /// - Parameters:
+    ///   - value:           The value to be formatted
+    ///   - dataSetIndex:    The index of the DataSet the entry in focus belongs to
+    ///   - viewPortHandler: provides information about the current chart state (scale, translation, ...)
+    /// - Returns:                   The formatted label ready to be drawn
+    func stringForValue(_ value: Double,
+                        entry: ChartDataEntry,
+                        dataSetIndex: Int,
+                        viewPortHandler: ViewPortHandler?) -> String
+}

+ 23 - 0
Pods/Charts/Source/Charts/Highlight/Highlighter.swift

@@ -0,0 +1,23 @@
+//
+//  Highlighter.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc(ChartHighlighter)
+public protocol Highlighter: AnyObject
+{
+    /// - Parameters:
+    ///   - x:
+    ///   - y:
+    /// - Returns: A Highlight object corresponding to the given x- and y- touch positions in pixels.
+    func getHighlight(x: CGFloat, y: CGFloat) -> Highlight?
+}

+ 45 - 0
Pods/Charts/Source/Charts/Renderers/AxisRenderer.swift

@@ -0,0 +1,45 @@
+//
+//  AxisRenderer.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+
+public protocol AxisRenderer: Renderer {
+
+    associatedtype Axis: AxisBase
+
+    /// base axis this axis renderer works with
+    var axis: Axis { get }
+
+    /// transformer to transform values to screen pixels and return
+    var transformer: Transformer? { get }
+
+    /// Draws the axis labels on the specified context
+    func renderAxisLabels(context: CGContext)
+
+    /// Draws the grid lines belonging to the axis.
+    func renderGridLines(context: CGContext)
+
+    /// Draws the line that goes alongside the axis.
+    func renderAxisLine(context: CGContext)
+
+    /// Draws the LimitLines associated with this axis to the screen.
+    func renderLimitLines(context: CGContext)
+
+    /// Computes the axis values.
+    /// - parameter min: the minimum value in the data object for this axis
+    /// - parameter max: the maximum value in the data object for this axis
+    func computeAxis(min: Double, max: Double, inverted: Bool)
+
+    /// Sets up the axis values. Computes the desired number of labels between the two given extremes.
+    func computeAxisValues(min: Double, max: Double)
+}

+ 0 - 218
Pods/Charts/Source/Charts/Renderers/AxisRendererBase.swift

@@ -1,218 +0,0 @@
-//
-//  AxisRendererBase.swift
-//  Charts
-//
-//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
-//  A port of MPAndroidChart for iOS
-//  Licensed under Apache License 2.0
-//
-//  https://github.com/danielgindi/Charts
-//
-
-import Foundation
-import CoreGraphics
-
-@objc(ChartAxisRendererBase)
-open class AxisRendererBase: Renderer
-{
-    /// base axis this axis renderer works with
-    @objc open var axis: AxisBase?
-    
-    /// transformer to transform values to screen pixels and return
-    @objc open var transformer: Transformer?
-
-    @objc public init(viewPortHandler: ViewPortHandler, transformer: Transformer?, axis: AxisBase?)
-    {
-        super.init(viewPortHandler: viewPortHandler)
-        
-        self.transformer = transformer
-        self.axis = axis
-    }
-    
-    /// Draws the axis labels on the specified context
-    @objc open func renderAxisLabels(context: CGContext)
-    {
-        fatalError("renderAxisLabels() cannot be called on AxisRendererBase")
-    }
-    
-    /// Draws the grid lines belonging to the axis.
-    @objc open func renderGridLines(context: CGContext)
-    {
-        fatalError("renderGridLines() cannot be called on AxisRendererBase")
-    }
-    
-    /// Draws the line that goes alongside the axis.
-    @objc open func renderAxisLine(context: CGContext)
-    {
-        fatalError("renderAxisLine() cannot be called on AxisRendererBase")
-    }
-    
-    /// Draws the LimitLines associated with this axis to the screen.
-    @objc open func renderLimitLines(context: CGContext)
-    {
-        fatalError("renderLimitLines() cannot be called on AxisRendererBase")
-    }
-    
-    /// Computes the axis values.
-    ///
-    /// - Parameters:
-    ///   - min: the minimum value in the data object for this axis
-    ///   - max: the maximum value in the data object for this axis
-    @objc open func computeAxis(min: Double, max: Double, inverted: Bool)
-    {
-        var min = min, max = max
-        
-        if let transformer = self.transformer
-        {
-            // calculate the starting and entry point of the y-labels (depending on zoom / contentrect bounds)
-            if viewPortHandler.contentWidth > 10.0 && !viewPortHandler.isFullyZoomedOutY
-            {
-                let p1 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentTop))
-                let p2 = transformer.valueForTouchPoint(CGPoint(x: viewPortHandler.contentLeft, y: viewPortHandler.contentBottom))
-                
-                if !inverted
-                {
-                    min = Double(p2.y)
-                    max = Double(p1.y)
-                }
-                else
-                {
-                    min = Double(p1.y)
-                    max = Double(p2.y)
-                }
-            }
-        }
-        
-        computeAxisValues(min: min, max: max)
-    }
-    
-    /// Sets up the axis values. Computes the desired number of labels between the two given extremes.
-    @objc open func computeAxisValues(min: Double, max: Double)
-    {
-        guard let axis = self.axis else { return }
-        
-        let yMin = min
-        let yMax = max
-        
-        let labelCount = axis.labelCount
-        let range = abs(yMax - yMin)
-        
-        if labelCount == 0 || range <= 0 || range.isInfinite
-        {
-            axis.entries = [Double]()
-            axis.centeredEntries = [Double]()
-            return
-        }
-        
-        // Find out how much spacing (in y value space) between axis values
-        let rawInterval = range / Double(labelCount)
-        var interval = rawInterval.roundedToNextSignficant()
-        
-        // If granularity is enabled, then do not allow the interval to go below specified granularity.
-        // This is used to avoid repeated values when rounding values for display.
-        if axis.granularityEnabled
-        {
-            interval = interval < axis.granularity ? axis.granularity : interval
-        }
-        
-        // Normalize interval
-        let intervalMagnitude = pow(10.0, Double(Int(log10(interval)))).roundedToNextSignficant()
-        let intervalSigDigit = Int(interval / intervalMagnitude)
-        if intervalSigDigit > 5
-        {
-            // Use one order of magnitude higher, to avoid intervals like 0.9 or 90
-            // if it's 0.0 after floor(), we use the old value
-            interval = floor(10.0 * intervalMagnitude) == 0.0 ? interval : floor(10.0 * intervalMagnitude)
-        }
-        
-        var n = axis.centerAxisLabelsEnabled ? 1 : 0
-        
-        // force label count
-        if axis.isForceLabelsEnabled
-        {
-            interval = Double(range) / Double(labelCount - 1)
-            
-            // Ensure stops contains at least n elements.
-            axis.entries.removeAll(keepingCapacity: true)
-            axis.entries.reserveCapacity(labelCount)
-            
-            var v = yMin
-            
-            for _ in 0 ..< labelCount
-            {
-                axis.entries.append(v)
-                v += interval
-            }
-            
-            n = labelCount
-        }
-        else
-        {
-            // no forced count
-        
-            var first = interval == 0.0 ? 0.0 : ceil(yMin / interval) * interval
-            
-            if axis.centerAxisLabelsEnabled
-            {
-                first -= interval
-            }
-            
-            let last = interval == 0.0 ? 0.0 : (floor(yMax / interval) * interval).nextUp
-            
-            if interval != 0.0 && last != first
-            {
-                for _ in stride(from: first, through: last, by: interval)
-                {
-                    n += 1
-                }
-            }
-            else if last == first && n == 0
-            {
-                n = 1
-            }
-
-            // Ensure stops contains at least n elements.
-            axis.entries.removeAll(keepingCapacity: true)
-            axis.entries.reserveCapacity(labelCount)
-            
-            var f = first
-            var i = 0
-            while i < n
-            {
-                if f == 0.0
-                {
-                    // Fix for IEEE negative zero case (Where value == -0.0, and 0.0 == -0.0)
-                    f = 0.0
-                }
-                
-                axis.entries.append(Double(f))
-                
-                f += interval
-                i += 1
-            }
-        }
-        
-        // set decimals
-        if interval < 1
-        {
-            axis.decimals = Int(ceil(-log10(interval)))
-        }
-        else
-        {
-            axis.decimals = 0
-        }
-        
-        if axis.centerAxisLabelsEnabled
-        {
-            axis.centeredEntries.reserveCapacity(n)
-            axis.centeredEntries.removeAll()
-            
-            let offset: Double = interval / 2.0
-            
-            for i in 0 ..< n
-            {
-                axis.centeredEntries.append(axis.entries[i] + offset)
-            }
-        }
-    }
-}

+ 75 - 0
Pods/Charts/Source/Charts/Renderers/DataRenderer.swift

@@ -0,0 +1,75 @@
+//
+//  DataRenderer.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc(ChartDataRenderer)
+public protocol DataRenderer: Renderer
+{
+     /// An array of accessibility elements that are presented to the ChartViewBase accessibility methods.
+    ///
+    /// Note that the order of elements in this array determines the order in which they are presented and navigated by
+    /// Accessibility clients such as VoiceOver.
+    ///
+    /// Renderers should ensure that the order of elements makes sense to a client presenting an audio-only interface to a user.
+    /// Subclasses should populate this array in drawData() or drawDataSet() to make the chart accessible.
+    var accessibleChartElements: [NSUIAccessibilityElement] { get }
+
+    var animator: Animator { get }
+
+    func drawData(context: CGContext)
+
+    func drawValues(context: CGContext)
+
+    func drawExtras(context: CGContext)
+
+    /// Draws all highlight indicators for the values that are currently highlighted.
+    ///
+    /// - Parameters:
+    ///   - indices: the highlighted values
+    func drawHighlighted(context: CGContext, indices: [Highlight])
+
+    /// An opportunity for initializing internal buffers used for rendering with a new size.
+    /// Since this might do memory allocations, it should only be called if necessary.
+    func initBuffers()
+
+    func isDrawingValuesAllowed(dataProvider: ChartDataProvider?) -> Bool
+
+    /// Creates an ```NSUIAccessibilityElement``` that acts as the first and primary header describing a chart view.
+    ///
+    /// - Parameters:
+    ///   - chart: The chartView object being described
+    ///   - data: A non optional data source about the chart
+    ///   - defaultDescription: A simple string describing the type/design of Chart.
+    /// - Returns: A header ```NSUIAccessibilityElement``` that can be added to accessibleChartElements.
+    func createAccessibleHeader(usingChart chart: ChartViewBase,
+                                        andData data: ChartData,
+                                        withDefaultDescription defaultDescription: String) -> NSUIAccessibilityElement
+}
+
+internal struct AccessibleHeader {
+    static func create(usingChart chart: ChartViewBase,
+                                andData data: ChartData,
+                                withDefaultDescription defaultDescription: String = "Chart") -> NSUIAccessibilityElement
+    {
+        let chartDescriptionText = chart.chartDescription.text ?? defaultDescription
+        let dataSetDescriptions = data.map { $0.label ?? "" }
+        let dataSetDescriptionText = dataSetDescriptions.joined(separator: ", ")
+
+        let element = NSUIAccessibilityElement(accessibilityContainer: chart)
+        element.accessibilityLabel = chartDescriptionText + ". \(data.count) dataset\(data.count == 1 ? "" : "s"). \(dataSetDescriptionText)"
+        element.accessibilityFrame = chart.bounds
+        element.isHeader = true
+        
+        return element
+    }
+}

+ 32 - 0
Pods/Charts/Source/Charts/Renderers/Scatter/ShapeRenderer.swift

@@ -0,0 +1,32 @@
+//
+//  ShapeRenderer.swift
+//  Charts
+//
+//  Copyright 2015 Daniel Cohen Gindi & Philipp Jahoda
+//  A port of MPAndroidChart for iOS
+//  Licensed under Apache License 2.0
+//
+//  https://github.com/danielgindi/Charts
+//
+
+import Foundation
+import CoreGraphics
+
+@objc
+public protocol ShapeRenderer: AnyObject
+{
+    /// Renders the provided ScatterDataSet with a shape.
+    ///
+    /// - Parameters:
+    ///   - context:         CGContext for drawing on
+    ///   - dataSet:         The DataSet to be drawn
+    ///   - viewPortHandler: Contains information about the current state of the view
+    ///   - point:           Position to draw the shape at
+    ///   - color:           Color to draw the shape
+    func renderShape(
+        context: CGContext,
+        dataSet: ScatterChartDataSetProtocol,
+        viewPortHandler: ViewPortHandler,
+        point: CGPoint,
+        color: NSUIColor)
+}

+ 19 - 0
Pods/Charts/Source/Charts/Utils/Sequence+KeyPath.swift

@@ -0,0 +1,19 @@
+//
+//  Sequence+KeyPath.swift
+//  Charts
+//
+//  Created by Jacob Christie on 2020-12-15.
+//
+
+extension Sequence {
+    func max<T>(
+        by keyPath: KeyPath<Element, T>,
+        areInIncreasingOrder: (T, T) -> Bool
+    ) -> Element? {
+        self.max { areInIncreasingOrder($0[keyPath: keyPath], $1[keyPath: keyPath]) }
+    }
+
+    func max<T: Comparable>(by keyPath: KeyPath<Element, T>) -> Element? {
+        max(by: keyPath, areInIncreasingOrder: <)
+    }
+}