diff --git a/Source/Charts/Animation/Animator.swift b/Source/Charts/Animation/Animator.swift index 0b4d725ccf..406ab93fff 100644 --- a/Source/Charts/Animation/Animator.swift +++ b/Source/Charts/Animation/Animator.swift @@ -136,10 +136,12 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingX: an easing function for the animation on the x axis - /// - parameter easingY: an easing function for the animation on the y axis + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easingX: an easing function for the animation on the x axis + /// - easingY: an easing function for the animation on the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingX: ChartEasingFunctionBlock?, easingY: ChartEasingFunctionBlock?) { stop() @@ -169,10 +171,12 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingOptionX: the easing function for the animation on the x axis - /// - parameter easingOptionY: the easing function for the animation on the y axis + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easingOptionX: the easing function for the animation on the x axis + /// - easingOptionY: the easing function for the animation on the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingOptionX: ChartEasingOption, easingOptionY: ChartEasingOption) { animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingX: easingFunctionFromOption(easingOptionX), easingY: easingFunctionFromOption(easingOptionY)) @@ -180,9 +184,11 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easing: an easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easing: an easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingX: easing, easingY: easing) @@ -190,9 +196,11 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingOption: the easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easingOption: the easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingOption: ChartEasingOption = .easeInOutSine) { animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easing: easingFunctionFromOption(easingOption)) @@ -200,8 +208,10 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter easing: an easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - easing: an easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { _startTimeX = CACurrentMediaTime() @@ -225,8 +235,10 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter easingOption: the easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - easingOption: the easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, easingOption: ChartEasingOption = .easeInOutSine) { animate(xAxisDuration: xAxisDuration, easing: easingFunctionFromOption(easingOption)) @@ -234,8 +246,10 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easing: an easing function for the animation + /// + /// - Parameters: + /// - yAxisDuration: duration for animating the y axis + /// - easing: an easing function for the animation @objc open func animate(yAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { _startTimeY = CACurrentMediaTime() @@ -259,8 +273,10 @@ open class Animator: NSObject /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingOption: the easing function for the animation + /// + /// - Parameters: + /// - yAxisDuration: duration for animating the y axis + /// - easingOption: the easing function for the animation @objc open func animate(yAxisDuration: TimeInterval, easingOption: ChartEasingOption = .easeInOutSine) { animate(yAxisDuration: yAxisDuration, easing: easingFunctionFromOption(easingOption)) diff --git a/Source/Charts/Charts/BarChartView.swift b/Source/Charts/Charts/BarChartView.swift index ec4c019f1f..4f9aaa0bc9 100644 --- a/Source/Charts/Charts/BarChartView.swift +++ b/Source/Charts/Charts/BarChartView.swift @@ -58,7 +58,7 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider max: data.getYMax(axis: .right)) } - /// - returns: The Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the BarChart. + /// - Returns: The Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the BarChart. open override func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? { if _data === nil @@ -82,7 +82,7 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider axis: h.axis) } - /// - returns: The bounding box of the specified Entry in the specified DataSet. Returns null if the Entry could not be found in the charts data. + /// - Returns: The bounding box of the specified Entry in the specified DataSet. Returns null if the Entry could not be found in the charts data. @objc open func getBarBounds(entry e: BarChartDataEntry) -> CGRect { guard let @@ -111,9 +111,10 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider /// Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specified by the parameters. /// Calls `notifyDataSetChanged()` afterwards. /// - /// - parameter fromX: the starting point on the x-axis where the grouping should begin - /// - parameter groupSpace: the space between groups of bars in values (not pixels) e.g. 0.8f for bar width 1f - /// - parameter barSpace: the space between individual bars in values (not pixels) e.g. 0.1f for bar width 1f + /// - Parameters: + /// - fromX: the starting point on the x-axis where the grouping should begin + /// - groupSpace: the space between groups of bars in values (not pixels) e.g. 0.8f for bar width 1f + /// - barSpace: the space between individual bars in values (not pixels) e.g. 0.1f for bar width 1f @objc open func groupBars(fromX: Double, groupSpace: Double, barSpace: Double) { guard let barData = self.barData @@ -128,9 +129,11 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider } /// Highlights the value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting. - /// - parameter x: - /// - parameter dataSetIndex: - /// - parameter stackIndex: the index inside the stack - only relevant for stacked entries + /// + /// - Parameters: + /// - x: + /// - dataSetIndex: + /// - stackIndex: the index inside the stack - only relevant for stacked entries @objc open func highlightValue(x: Double, dataSetIndex: Int, stackIndex: Int) { highlightValue(Highlight(x: x, dataSetIndex: dataSetIndex, stackIndex: stackIndex)) @@ -168,16 +171,16 @@ open class BarChartView: BarLineChartViewBase, BarChartDataProvider /// If enabled, highlighting operations will highlight the whole bar, even if only a single stack entry was tapped. @objc open var highlightFullBarEnabled: Bool = false - /// - returns: `true` the highlight is be full-bar oriented, `false` ifsingle-value + /// `true` the highlight is be full-bar oriented, `false` ifsingle-value open var isHighlightFullBarEnabled: Bool { return highlightFullBarEnabled } // MARK: - BarChartDataProvider open var barData: BarChartData? { return _data as? BarChartData } - /// - returns: `true` if drawing values above bars is enabled, `false` ifnot + /// `true` if drawing values above bars is enabled, `false` ifnot open var isDrawValueAboveBarEnabled: Bool { return drawValueAboveBarEnabled } - /// - returns: `true` if drawing shadows (maxvalue) for each bar is enabled, `false` ifnot + /// `true` if drawing shadows (maxvalue) for each bar is enabled, `false` ifnot open var isDrawBarShadowEnabled: Bool { return drawBarShadowEnabled } } diff --git a/Source/Charts/Charts/BarLineChartViewBase.swift b/Source/Charts/Charts/BarLineChartViewBase.swift index f3c90279c9..2ab79068f3 100644 --- a/Source/Charts/Charts/BarLineChartViewBase.swift +++ b/Source/Charts/Charts/BarLineChartViewBase.swift @@ -1010,10 +1010,11 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms in or out by the given scale factor. x and y are the coordinates /// (in pixels) of the zoom center. /// - /// - parameter scaleX: if < 1 --> zoom out, if > 1 --> zoom in - /// - parameter scaleY: if < 1 --> zoom out, if > 1 --> zoom in - /// - parameter x: - /// - parameter y: + /// - Parameters: + /// - scaleX: if < 1 --> zoom out, if > 1 --> zoom in + /// - scaleY: if < 1 --> zoom out, if > 1 --> zoom in + /// - x: + /// - y: @objc open func zoom( scaleX: CGFloat, scaleY: CGFloat, @@ -1031,11 +1032,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms in or out by the given scale factor. /// x and y are the values (**not pixels**) of the zoom center. /// - /// - parameter scaleX: if < 1 --> zoom out, if > 1 --> zoom in - /// - parameter scaleY: if < 1 --> zoom out, if > 1 --> zoom in - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: + /// - Parameters: + /// - scaleX: if < 1 --> zoom out, if > 1 --> zoom in + /// - scaleY: if < 1 --> zoom out, if > 1 --> zoom in + /// - xValue: + /// - yValue: + /// - axis: @objc open func zoom( scaleX: CGFloat, scaleY: CGFloat, @@ -1057,11 +1059,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms to the center of the chart with the given scale factor. /// - /// - parameter scaleX: if < 1 --> zoom out, if > 1 --> zoom in - /// - parameter scaleY: if < 1 --> zoom out, if > 1 --> zoom in - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: + /// - Parameters: + /// - scaleX: if < 1 --> zoom out, if > 1 --> zoom in + /// - scaleY: if < 1 --> zoom out, if > 1 --> zoom in + /// - xValue: + /// - yValue: + /// - axis: @objc open func zoomToCenter( scaleX: CGFloat, scaleY: CGFloat) @@ -1077,13 +1080,14 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms by the specified scale factor to the specified values on the specified axis. /// - /// - parameter scaleX: - /// - parameter scaleY: - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - scaleX: + /// - scaleY: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func zoomAndCenterViewAnimated( scaleX: CGFloat, scaleY: CGFloat, @@ -1119,13 +1123,14 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms by the specified scale factor to the specified values on the specified axis. /// - /// - parameter scaleX: - /// - parameter scaleY: - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - scaleX: + /// - scaleY: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func zoomAndCenterViewAnimated( scaleX: CGFloat, scaleY: CGFloat, @@ -1140,13 +1145,14 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zooms by the specified scale factor to the specified values on the specified axis. /// - /// - parameter scaleX: - /// - parameter scaleY: - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - scaleX: + /// - scaleY: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func zoomAndCenterViewAnimated( scaleX: CGFloat, scaleY: CGFloat, @@ -1219,8 +1225,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Sets the size of the area (range on the y-axis) that should be maximum visible at once. /// - /// - parameter yRange: - /// - parameter axis: - the axis for which this limit should apply + /// - Parameters: + /// - yRange: + /// - axis: - the axis for which this limit should apply @objc open func setVisibleYRangeMaximum(_ maxYRange: Double, axis: YAxis.AxisDependency) { let yScale = getAxisRange(axis: axis) / maxYRange @@ -1229,8 +1236,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Sets the size of the area (range on the y-axis) that should be minimum visible at once, no further zooming in possible. /// - /// - parameter yRange: - /// - parameter axis: - the axis for which this limit should apply + /// - Parameters: + /// - yRange: + /// - axis: - the axis for which this limit should apply @objc open func setVisibleYRangeMinimum(_ minYRange: Double, axis: YAxis.AxisDependency) { let yScale = getAxisRange(axis: axis) / minYRange @@ -1239,9 +1247,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Limits the maximum and minimum y range that can be visible by pinching and zooming. /// - /// - parameter minYRange: - /// - parameter maxYRange: - /// - parameter axis: + /// - Parameters: + /// - minYRange: + /// - maxYRange: + /// - axis: @objc open func setVisibleYRange(minYRange: Double, maxYRange: Double, axis: YAxis.AxisDependency) { let minScale = getAxisRange(axis: axis) / minYRange @@ -1266,8 +1275,9 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Centers the viewport to the specified y-value on the y-axis. /// This also refreshes the chart by calling setNeedsDisplay(). /// - /// - parameter yValue: - /// - parameter axis: - which axis should be used as a reference for the y-axis + /// - Parameters: + /// - yValue: + /// - axis: - which axis should be used as a reference for the y-axis @objc open func moveViewToY(_ yValue: Double, axis: YAxis.AxisDependency) { let yInView = getAxisRange(axis: axis) / Double(_viewPortHandler.scaleY) @@ -1285,9 +1295,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the left side of the current viewport to the specified x-value on the x-axis, and center the viewport to the specified y-value on the y-axis. /// This also refreshes the chart by calling setNeedsDisplay(). /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: - which axis should be used as a reference for the y-axis + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: - which axis should be used as a reference for the y-axis @objc open func moveViewTo(xValue: Double, yValue: Double, axis: YAxis.AxisDependency) { let yInView = getAxisRange(axis: axis) / Double(_viewPortHandler.scaleY) @@ -1305,11 +1316,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the left side of the current viewport to the specified x-position and center the viewport to the specified y-position animated. /// This also refreshes the chart by calling setNeedsDisplay(). /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func moveViewToAnimated( xValue: Double, yValue: Double, @@ -1340,11 +1352,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the left side of the current viewport to the specified x-position and center the viewport to the specified y-position animated. /// This also refreshes the chart by calling setNeedsDisplay(). /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func moveViewToAnimated( xValue: Double, yValue: Double, @@ -1358,11 +1371,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the left side of the current viewport to the specified x-position and center the viewport to the specified y-position animated. /// This also refreshes the chart by calling setNeedsDisplay(). /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func moveViewToAnimated( xValue: Double, yValue: Double, @@ -1375,9 +1389,10 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the center of the current viewport to the specified x-value and y-value. /// This also refreshes the chart by calling setNeedsDisplay(). /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: - which axis should be used as a reference for the y-axis + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: - which axis should be used as a reference for the y-axis @objc open func centerViewTo( xValue: Double, yValue: Double, @@ -1398,11 +1413,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the center of the current viewport to the specified x-value and y-value animated. /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func centerViewToAnimated( xValue: Double, yValue: Double, @@ -1433,11 +1449,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the center of the current viewport to the specified x-value and y-value animated. /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func centerViewToAnimated( xValue: Double, yValue: Double, @@ -1450,11 +1467,12 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// This will move the center of the current viewport to the specified x-value and y-value animated. /// - /// - parameter xValue: - /// - parameter yValue: - /// - parameter axis: which axis should be used as a reference for the y-axis - /// - parameter duration: the duration of the animation in seconds - /// - parameter easing: + /// - Parameters: + /// - xValue: + /// - yValue: + /// - axis: which axis should be used as a reference for the y-axis + /// - duration: the duration of the animation in seconds + /// - easing: @objc open func centerViewToAnimated( xValue: Double, yValue: Double, @@ -1493,7 +1511,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD // MARK: - Accessors - /// - returns: The range of the specified axis. + /// - Returns: The range of the specified axis. @objc open func getAxisRange(axis: YAxis.AxisDependency) -> Double { if axis == .left @@ -1506,7 +1524,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } } - /// - returns: The position (in pixels) the provided Entry has inside the chart view + /// - Returns: The position (in pixels) the provided Entry has inside the chart view @objc open func getPosition(entry e: ChartDataEntry, axis: YAxis.AxisDependency) -> CGPoint { var vals = CGPoint(x: CGFloat(e.x), y: CGFloat(e.y)) @@ -1632,7 +1650,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } /// **default**: true - /// - returns: `true` if zooming via double-tap is enabled `false` ifnot. + /// `true` if zooming via double-tap is enabled `false` ifnot. @objc open var isDoubleTapToZoomEnabled: Bool { return doubleTapToZoomEnabled @@ -1651,20 +1669,20 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } /// **default**: true - /// - returns: `true` if drawing the grid background is enabled, `false` ifnot. + /// `true` if drawing the grid background is enabled, `false` ifnot. @objc open var isDrawGridBackgroundEnabled: Bool { return drawGridBackgroundEnabled } /// **default**: false - /// - returns: `true` if drawing the borders rectangle is enabled, `false` ifnot. + /// `true` if drawing the borders rectangle is enabled, `false` ifnot. @objc open var isDrawBordersEnabled: Bool { return drawBordersEnabled } - /// - returns: The x and y values in the chart at the given touch point + /// - Returns: The x and y values in the chart at the given touch point /// (encapsulated in a `CGPoint`). This method transforms pixel coordinates to /// coordinates / values in the chart. This is the opposite method to /// `getPixelsForValues(...)`. @@ -1680,7 +1698,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD return getTransformer(forAxis: axis).pixelForValues(x: x, y: y) } - /// - returns: The Entry object displayed at the touched position of the chart + /// - Returns: The Entry object displayed at the touched position of the chart @objc open func getEntryByTouchPoint(point pt: CGPoint) -> ChartDataEntry! { if let h = getHighlightByTouchPoint(pt) @@ -1690,7 +1708,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD return nil } - /// - returns: The DataSet object displayed at the touched position of the chart + /// - Returns: The DataSet object displayed at the touched position of the chart @objc open func getDataSetByTouchPoint(point pt: CGPoint) -> IBarLineScatterCandleBubbleChartDataSet? { let h = getHighlightByTouchPoint(pt) @@ -1701,7 +1719,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD return nil } - /// - returns: The current x-scale factor + /// The current x-scale factor @objc open var scaleX: CGFloat { if _viewPortHandler === nil @@ -1711,7 +1729,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD return _viewPortHandler.scaleX } - /// - returns: The current y-scale factor + /// The current y-scale factor @objc open var scaleY: CGFloat { if _viewPortHandler === nil @@ -1724,7 +1742,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// if the chart is fully zoomed out, return true @objc open var isFullyZoomedOut: Bool { return _viewPortHandler.isFullyZoomedOut } - /// - returns: The y-axis object to the corresponding AxisDependency. In the + /// - Returns: The y-axis object to the corresponding AxisDependency. In the /// horizontal bar-chart, LEFT == top, RIGHT == BOTTOM @objc open func getAxis(_ axis: YAxis.AxisDependency) -> YAxis { @@ -1758,7 +1776,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } /// **default**: false - /// - returns: `true` if pinch-zoom is enabled, `false` ifnot + /// `true` if pinch-zoom is enabled, `false` ifnot @objc open var isPinchZoomEnabled: Bool { return pinchZoomEnabled } /// Set an offset in dp that allows the user to drag the chart over it's @@ -1775,7 +1793,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD _viewPortHandler.setDragOffsetY(offset) } - /// - returns: `true` if both drag offsets (x and y) are zero or smaller. + /// `true` if both drag offsets (x and y) are zero or smaller. @objc open var hasNoDragOffset: Bool { return _viewPortHandler.hasNoDragOffset } open override var chartYMax: Double @@ -1788,7 +1806,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD return min(leftAxis._axisMinimum, rightAxis._axisMinimum) } - /// - returns: `true` if either the left or the right or both axes are inverted. + /// `true` if either the left or the right or both axes are inverted. @objc open var isAnyAxisInverted: Bool { return leftAxis.isInverted || rightAxis.isInverted @@ -1803,7 +1821,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } /// **default**: false - /// - returns: `true` if auto scaling on the y axis is enabled. + /// `true` if auto scaling on the y axis is enabled. @objc open var isAutoScaleMinMaxEnabled : Bool { return autoScaleMinMaxEnabled } /// Sets a minimum width to the specified y axis. @@ -1820,7 +1838,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } /// **default**: 0.0 - /// - returns: The (custom) minimum width of the specified Y axis. + /// + /// - Returns: The (custom) minimum width of the specified Y axis. @objc open func getYAxisMinWidth(_ axis: YAxis.AxisDependency) -> CGFloat { if axis == .left @@ -1849,7 +1868,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD /// Zero (0.0) means there's no maximum width /// /// **default**: 0.0 (no maximum specified) - /// - returns: The (custom) maximum width of the specified Y axis. + /// + /// - Returns: The (custom) maximum width of the specified Y axis. @objc open func getYAxisMaxWidth(_ axis: YAxis.AxisDependency) -> CGFloat { if axis == .left @@ -1862,7 +1882,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD } } - /// - returns the width of the specified y axis. + /// - Returns the width of the specified y axis. @objc open func getYAxisWidth(_ axis: YAxis.AxisDependency) -> CGFloat { if axis == .left @@ -1877,7 +1897,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD // MARK: - BarLineScatterCandleBubbleChartDataProvider - /// - returns: The Transformer class that contains all matrices and is + /// - Returns: The Transformer class that contains all matrices and is /// responsible for transforming values into pixels on the screen and /// backwards. open func getTransformer(forAxis axis: YAxis.AxisDependency) -> Transformer @@ -1910,7 +1930,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD return getAxis(axis).isInverted } - /// - returns: The lowest x-index (value on the x-axis) that is still visible on he chart. + /// The lowest x-index (value on the x-axis) that is still visible on he chart. open var lowestVisibleX: Double { var pt = CGPoint( @@ -1922,7 +1942,7 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD return max(xAxis._axisMinimum, Double(pt.x)) } - /// - returns: The highest x-index (value on the x-axis) that is still visible on the chart. + /// The highest x-index (value on the x-axis) that is still visible on the chart. open var highestVisibleX: Double { var pt = CGPoint( diff --git a/Source/Charts/Charts/ChartViewBase.swift b/Source/Charts/Charts/ChartViewBase.swift index 29ab832760..2ab5a6802e 100644 --- a/Source/Charts/Charts/ChartViewBase.swift +++ b/Source/Charts/Charts/ChartViewBase.swift @@ -21,8 +21,10 @@ import CoreGraphics public protocol ChartViewDelegate { /// Called when a value has been selected inside the chart. - /// - parameter entry: The selected Entry. - /// - parameter highlight: The corresponding highlight object that contains information about the highlighted position such as dataSetIndex etc. + /// + /// - Parameters: + /// - entry: The selected Entry. + /// - highlight: The corresponding highlight object that contains information about the highlighted position such as dataSetIndex etc. @objc optional func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) // Called when nothing has been selected or an "un-select" has been made. @@ -39,7 +41,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate { // MARK: - Properties - /// - returns: The object representing all x-labels, this method can be used to + /// - Returns: The object representing all x-labels, this method can be used to /// acquire the XAxis object and modify it (e.g. change the position of the /// labels) @objc open var xAxis: XAxis @@ -114,7 +116,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// (use the `marker` property to specify a marker) @objc open var drawMarkers = true - /// - returns: `true` if drawing the marker is enabled when tapping on values + /// - Returns: `true` if drawing the marker is enabled when tapping on values /// (use the `marker` property to specify a marker) @objc open var isDrawMarkersEnabled: Bool { return drawMarkers } @@ -239,7 +241,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate setNeedsDisplay() } - /// - returns: `true` if the chart is empty (meaning it's data object is either null or contains no entries). + /// - Returns: `true` if the chart is empty (meaning it's data object is either null or contains no entries). @objc open func isEmpty() -> Bool { guard let data = _data else { return true } @@ -375,7 +377,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate // MARK: - Highlighting - /// - returns: The array of currently highlighted values. This might an empty if nothing is highlighted. + /// The array of currently highlighted values. This might an empty if nothing is highlighted. @objc open var highlighted: [Highlight] { return _indicesToHighlight @@ -390,14 +392,15 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate set { _highlightPerTapEnabled = newValue } } - /// - returns: `true` if values can be highlighted via tap gesture, `false` ifnot. + /// `true` if values can be highlighted via tap gesture, `false` ifnot. @objc open var isHighLightPerTapEnabled: Bool { return highlightPerTapEnabled } /// Checks if the highlight array is null, has a length of zero or if the first object is null. - /// - returns: `true` if there are values to highlight, `false` ifthere are no values to highlight. + /// + /// - Returns: `true` if there are values to highlight, `false` ifthere are no values to highlight. @objc open func valuesToHighlight() -> Bool { return _indicesToHighlight.count > 0 @@ -428,9 +431,11 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Highlights any y-value at the given x-value in the given DataSet. /// Provide -1 as the dataSetIndex to undo all highlighting. /// This method will call the delegate. - /// - parameter x: The x-value to highlight - /// - parameter dataSetIndex: The dataset index to search in - /// - parameter dataIndex: The data index to search in (only used in CombinedChartView currently) + /// + /// - Parameters: + /// - x: The x-value to highlight + /// - dataSetIndex: The dataset index to search in + /// - dataIndex: The data index to search in (only used in CombinedChartView currently) @objc open func highlightValue(x: Double, dataSetIndex: Int, dataIndex: Int = -1) { highlightValue(x: x, dataSetIndex: dataSetIndex, dataIndex: dataIndex, callDelegate: true) @@ -439,10 +444,12 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Highlights the value at the given x-value and y-value in the given DataSet. /// Provide -1 as the dataSetIndex to undo all highlighting. /// This method will call the delegate. - /// - parameter x: The x-value to highlight - /// - parameter y: The y-value to highlight. Supply `NaN` for "any" - /// - parameter dataSetIndex: The dataset index to search in - /// - parameter dataIndex: The data index to search in (only used in CombinedChartView currently) + /// + /// - Parameters: + /// - x: The x-value to highlight + /// - y: The y-value to highlight. Supply `NaN` for "any" + /// - dataSetIndex: The dataset index to search in + /// - dataIndex: The data index to search in (only used in CombinedChartView currently) @objc open func highlightValue(x: Double, y: Double, dataSetIndex: Int, dataIndex: Int = -1) { highlightValue(x: x, y: y, dataSetIndex: dataSetIndex, dataIndex: dataIndex, callDelegate: true) @@ -450,10 +457,12 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Highlights any y-value at the given x-value in the given DataSet. /// Provide -1 as the dataSetIndex to undo all highlighting. - /// - parameter x: The x-value to highlight - /// - parameter dataSetIndex: The dataset index to search in - /// - parameter dataIndex: The data index to search in (only used in CombinedChartView currently) - /// - parameter callDelegate: Should the delegate be called for this change + /// + /// - Parameters: + /// - x: The x-value to highlight + /// - dataSetIndex: The dataset index to search in + /// - dataIndex: The data index to search in (only used in CombinedChartView currently) + /// - callDelegate: Should the delegate be called for this change @objc open func highlightValue(x: Double, dataSetIndex: Int, dataIndex: Int = -1, callDelegate: Bool) { highlightValue(x: x, y: .nan, dataSetIndex: dataSetIndex, dataIndex: dataIndex, callDelegate: callDelegate) @@ -461,11 +470,13 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Highlights the value at the given x-value and y-value in the given DataSet. /// Provide -1 as the dataSetIndex to undo all highlighting. - /// - parameter x: The x-value to highlight - /// - parameter y: The y-value to highlight. Supply `NaN` for "any" - /// - parameter dataSetIndex: The dataset index to search in - /// - parameter dataIndex: The data index to search in (only used in CombinedChartView currently) - /// - parameter callDelegate: Should the delegate be called for this change + /// + /// - Parameters: + /// - x: The x-value to highlight + /// - y: The y-value to highlight. Supply `NaN` for "any" + /// - dataSetIndex: The dataset index to search in + /// - dataIndex: The data index to search in (only used in CombinedChartView currently) + /// - callDelegate: Should the delegate be called for this change @objc open func highlightValue(x: Double, y: Double, dataSetIndex: Int, dataIndex: Int = -1, callDelegate: Bool) { guard let data = _data else @@ -486,7 +497,9 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Highlights the values represented by the provided Highlight object /// This method *will not* call the delegate. - /// - parameter highlight: contains information about which entry should be highlighted + /// + /// - Parameters: + /// - highlight: contains information about which entry should be highlighted @objc open func highlightValue(_ highlight: Highlight?) { highlightValue(highlight, callDelegate: false) @@ -535,7 +548,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate setNeedsDisplay() } - /// - returns: The Highlight object (contains x-index and DataSet index) of the + /// - Returns: The Highlight object (contains x-index and DataSet index) of the /// selected value at the given touch point inside the Line-, Scatter-, or /// CandleStick-Chart. @objc open func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? @@ -595,7 +608,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate } } - /// - returns: The actual position in pixels of the MarkerView for the given Entry in the given DataSet. + /// - Returns: The actual position in pixels of the MarkerView for the given Entry in the given DataSet. @objc open func getMarkerPosition(highlight: Highlight) -> CGPoint { return CGPoint(x: highlight.drawX, y: highlight.drawY) @@ -603,7 +616,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate // MARK: - Animation - /// - returns: The animator responsible for animating chart values. + /// The animator responsible for animating chart values. @objc open var chartAnimator: Animator! { return _animator @@ -611,10 +624,12 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingX: an easing function for the animation on the x axis - /// - parameter easingY: an easing function for the animation on the y axis + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easingX: an easing function for the animation on the x axis + /// - easingY: an easing function for the animation on the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingX: ChartEasingFunctionBlock?, easingY: ChartEasingFunctionBlock?) { _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingX: easingX, easingY: easingY) @@ -622,10 +637,12 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingOptionX: the easing function for the animation on the x axis - /// - parameter easingOptionY: the easing function for the animation on the y axis + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easingOptionX: the easing function for the animation on the x axis + /// - easingOptionY: the easing function for the animation on the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingOptionX: ChartEasingOption, easingOptionY: ChartEasingOption) { _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingOptionX: easingOptionX, easingOptionY: easingOptionY) @@ -633,9 +650,11 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easing: an easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easing: an easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easing: easing) @@ -643,9 +662,11 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingOption: the easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis + /// - easingOption: the easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval, easingOption: ChartEasingOption) { _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration, easingOption: easingOption) @@ -653,8 +674,10 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter yAxisDuration: duration for animating the y axis + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - yAxisDuration: duration for animating the y axis @objc open func animate(xAxisDuration: TimeInterval, yAxisDuration: TimeInterval) { _animator.animate(xAxisDuration: xAxisDuration, yAxisDuration: yAxisDuration) @@ -662,8 +685,10 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter easing: an easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - easing: an easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { _animator.animate(xAxisDuration: xAxisDuration, easing: easing) @@ -671,8 +696,10 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis - /// - parameter easingOption: the easing function for the animation + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis + /// - easingOption: the easing function for the animation @objc open func animate(xAxisDuration: TimeInterval, easingOption: ChartEasingOption) { _animator.animate(xAxisDuration: xAxisDuration, easingOption: easingOption) @@ -680,7 +707,9 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart the x-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter xAxisDuration: duration for animating the x axis + /// + /// - Parameters: + /// - xAxisDuration: duration for animating the x axis @objc open func animate(xAxisDuration: TimeInterval) { _animator.animate(xAxisDuration: xAxisDuration) @@ -688,8 +717,10 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easing: an easing function for the animation + /// + /// - Parameters: + /// - yAxisDuration: duration for animating the y axis + /// - easing: an easing function for the animation @objc open func animate(yAxisDuration: TimeInterval, easing: ChartEasingFunctionBlock?) { _animator.animate(yAxisDuration: yAxisDuration, easing: easing) @@ -697,8 +728,10 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter yAxisDuration: duration for animating the y axis - /// - parameter easingOption: the easing function for the animation + /// + /// - Parameters: + /// - yAxisDuration: duration for animating the y axis + /// - easingOption: the easing function for the animation @objc open func animate(yAxisDuration: TimeInterval, easingOption: ChartEasingOption) { _animator.animate(yAxisDuration: yAxisDuration, easingOption: easingOption) @@ -706,7 +739,9 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// Animates the drawing / rendering of the chart the y-axis with the specified animation time. /// If `animate(...)` is called, no further calling of `invalidate()` is necessary to refresh the chart. - /// - parameter yAxisDuration: duration for animating the y axis + /// + /// - Parameters: + /// - yAxisDuration: duration for animating the y axis @objc open func animate(yAxisDuration: TimeInterval) { _animator.animate(yAxisDuration: yAxisDuration) @@ -714,13 +749,13 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate // MARK: - Accessors - /// - returns: The current y-max value across all DataSets + /// The current y-max value across all DataSets open var chartYMax: Double { return _data?.yMax ?? 0.0 } - /// - returns: The current y-min value across all DataSets + /// The current y-min value across all DataSets open var chartYMin: Double { return _data?.yMin ?? 0.0 @@ -741,47 +776,46 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate return _xAxis.axisRange } - /// * - /// - note: (Equivalent of getCenter() in MPAndroidChart, as center is already a standard in iOS that returns the center point relative to superview, and MPAndroidChart returns relative to self)* - /// - returns: The center point of the chart (the whole View) in pixels. + /// - Note: (Equivalent of getCenter() in MPAndroidChart, as center is already a standard in iOS that returns the center point relative to superview, and MPAndroidChart returns relative to self)* + /// The center point of the chart (the whole View) in pixels. @objc open var midPoint: CGPoint { let bounds = self.bounds return CGPoint(x: bounds.origin.x + bounds.size.width / 2.0, y: bounds.origin.y + bounds.size.height / 2.0) } - /// - returns: The center of the chart taking offsets under consideration. (returns the center of the content rectangle) + /// The center of the chart taking offsets under consideration. (returns the center of the content rectangle) open var centerOffsets: CGPoint { return _viewPortHandler.contentCenter } - /// - returns: The Legend object of the chart. This method can be used to get an instance of the legend in order to customize the automatically generated Legend. + /// The Legend object of the chart. This method can be used to get an instance of the legend in order to customize the automatically generated Legend. @objc open var legend: Legend { return _legend } - /// - returns: The renderer object responsible for rendering / drawing the Legend. + /// The renderer object responsible for rendering / drawing the Legend. @objc open var legendRenderer: LegendRenderer! { return _legendRenderer } - /// - returns: The rectangle that defines the borders of the chart-value surface (into which the actual values are drawn). + /// The rectangle that defines the borders of the chart-value surface (into which the actual values are drawn). @objc open var contentRect: CGRect { return _viewPortHandler.contentRect } - /// - returns: The ViewPortHandler of the chart that is responsible for the + /// - Returns: The ViewPortHandler of the chart that is responsible for the /// content area of the chart and its offsets and dimensions. @objc open var viewPortHandler: ViewPortHandler! { return _viewPortHandler } - /// - returns: The bitmap that represents the chart. + /// - Returns: The bitmap that represents the chart. @objc open func getChartImage(transparent: Bool) -> NSUIImage? { NSUIGraphicsBeginImageContextWithOptions(bounds.size, isOpaque || !transparent, NSUIMainScreen()?.nsuiScale ?? 1.0) @@ -824,11 +858,11 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate /// the SD card chart is saved as a PNG image, example: /// saveToPath("myfilename", "foldername1/foldername2") /// - /// - parameter to: path to the image to save - /// - parameter format: the format to save - /// - parameter compressionQuality: compression quality for lossless formats (JPEG) - /// - /// - returns: `true` if the image was saved successfully + /// - Parameters: + /// - to: path to the image to save + /// - format: the format to save + /// - compressionQuality: compression quality for lossless formats (JPEG) + /// - Returns: `true` if the image was saved successfully open func save(to path: String, format: ImageFormat, compressionQuality: Double) -> Bool { guard let image = getChartImage(transparent: format != .jpeg) else { return false } @@ -908,7 +942,7 @@ open class ChartViewBase: NSUIView, ChartDataProvider, AnimatorDelegate } /// **default**: true - /// - returns: `true` if chart continues to scroll after touch up, `false` ifnot. + /// `true` if chart continues to scroll after touch up, `false` ifnot. @objc open var isDragDecelerationEnabled: Bool { return dragDecelerationEnabled diff --git a/Source/Charts/Charts/CombinedChartView.swift b/Source/Charts/Charts/CombinedChartView.swift index e1b13b495e..47eebd6c78 100644 --- a/Source/Charts/Charts/CombinedChartView.swift +++ b/Source/Charts/Charts/CombinedChartView.swift @@ -76,7 +76,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider } } - /// - returns: The Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the CombinedChart. + /// - Returns: The Highlight object (contains x-index and DataSet index) of the selected value at the given touch point inside the CombinedChart. open override func getHighlightByTouchPoint(_ pt: CGPoint) -> Highlight? { if _data === nil @@ -176,10 +176,10 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider set { (renderer as! CombinedChartRenderer).drawBarShadowEnabled = newValue } } - /// - returns: `true` if drawing values above bars is enabled, `false` ifnot + /// `true` if drawing values above bars is enabled, `false` ifnot open var isDrawValueAboveBarEnabled: Bool { return (renderer as! CombinedChartRenderer).drawValueAboveBarEnabled } - /// - returns: `true` if drawing shadows (maxvalue) for each bar is enabled, `false` ifnot + /// `true` if drawing shadows (maxvalue) for each bar is enabled, `false` ifnot open var isDrawBarShadowEnabled: Bool { return (renderer as! CombinedChartRenderer).drawBarShadowEnabled } /// the order in which the provided data objects should be drawn. @@ -200,7 +200,7 @@ open class CombinedChartView: BarLineChartViewBase, CombinedChartDataProvider /// Set this to `true` to make the highlight operation full-bar oriented, `false` to make it highlight single values @objc open var highlightFullBarEnabled: Bool = false - /// - returns: `true` the highlight is be full-bar oriented, `false` ifsingle-value + /// `true` the highlight is be full-bar oriented, `false` ifsingle-value open var isHighlightFullBarEnabled: Bool { return highlightFullBarEnabled } // MARK: - ChartViewBase diff --git a/Source/Charts/Charts/HorizontalBarChartView.swift b/Source/Charts/Charts/HorizontalBarChartView.swift index 380680d0d3..ceacca0567 100644 --- a/Source/Charts/Charts/HorizontalBarChartView.swift +++ b/Source/Charts/Charts/HorizontalBarChartView.swift @@ -208,7 +208,7 @@ open class HorizontalBarChartView: BarChartView return self.highlighter?.getHighlight(x: pt.y, y: pt.x) } - /// - returns: The lowest x-index (value on the x-axis) that is still visible on he chart. + /// The lowest x-index (value on the x-axis) that is still visible on he chart. open override var lowestVisibleX: Double { var pt = CGPoint( @@ -220,7 +220,7 @@ open class HorizontalBarChartView: BarChartView return max(xAxis._axisMinimum, Double(pt.y)) } - /// - returns: The highest x-index (value on the x-axis) that is still visible on the chart. + /// The highest x-index (value on the x-axis) that is still visible on the chart. open override var highestVisibleX: Double { var pt = CGPoint( diff --git a/Source/Charts/Charts/PieChartView.swift b/Source/Charts/Charts/PieChartView.swift index 58335c5b69..2a86afa40c 100644 --- a/Source/Charts/Charts/PieChartView.swift +++ b/Source/Charts/Charts/PieChartView.swift @@ -279,7 +279,7 @@ open class PieChartView: PieRadarChartViewBase return -1 // return -1 if no index found } - /// - returns: The index of the DataSet this x-index belongs to. + /// - Returns: The index of the DataSet this x-index belongs to. @objc open func dataSetIndexForIndex(_ xValue: Double) -> Int { var dataSets = _data?.dataSets ?? [] @@ -295,7 +295,7 @@ open class PieChartView: PieRadarChartViewBase return -1 } - /// - returns: An integer array of all the different angles the chart slices + /// - Returns: An integer array of all the different angles the chart slices /// have the angles in the returned array determine how much space (of 360°) /// each slice takes @objc open var drawAngles: [CGFloat] @@ -303,7 +303,7 @@ open class PieChartView: PieRadarChartViewBase return _drawAngles } - /// - returns: The absolute angles of the different chart slices (where the + /// - Returns: The absolute angles of the different chart slices (where the /// slices end) @objc open var absoluteAngles: [CGFloat] { @@ -312,7 +312,7 @@ open class PieChartView: PieRadarChartViewBase /// The color for the hole that is drawn in the center of the PieChart (if enabled). /// - /// - note: Use holeTransparent with holeColor = nil to make the hole transparent.* + /// - Note: Use holeTransparent with holeColor = nil to make the hole transparent.* @objc open var holeColor: NSUIColor? { get @@ -342,7 +342,7 @@ open class PieChartView: PieRadarChartViewBase } } - /// - returns: `true` if the inner tips of the slices are visible behind the hole, `false` if not. + /// `true` if the inner tips of the slices are visible behind the hole, `false` if not. @objc open var isDrawSlicesUnderHoleEnabled: Bool { return drawSlicesUnderHoleEnabled @@ -362,7 +362,7 @@ open class PieChartView: PieRadarChartViewBase } } - /// - returns: `true` if the hole in the center of the pie-chart is set to be visible, `false` ifnot + /// `true` if the hole in the center of the pie-chart is set to be visible, `false` ifnot @objc open var isDrawHoleEnabled: Bool { get @@ -449,7 +449,7 @@ open class PieChartView: PieRadarChartViewBase } } - /// - returns: `true` if drawing the center text is enabled + /// `true` if drawing the center text is enabled @objc open var isDrawCenterTextEnabled: Bool { get @@ -473,13 +473,13 @@ open class PieChartView: PieRadarChartViewBase return _circleBox.width / 2.0 } - /// - returns: The circlebox, the boundingbox of the pie-chart slices + /// The circlebox, the boundingbox of the pie-chart slices @objc open var circleBox: CGRect { return _circleBox } - /// - returns: The center of the circlebox + /// The center of the circlebox @objc open var centerCircleBox: CGPoint { return CGPoint(x: _circleBox.midX, y: _circleBox.midY) @@ -569,7 +569,7 @@ open class PieChartView: PieRadarChartViewBase } } - /// - returns: `true` if drawing entry labels is enabled, `false` ifnot + /// `true` if drawing entry labels is enabled, `false` ifnot @objc open var isDrawEntryLabelsEnabled: Bool { get @@ -592,7 +592,7 @@ open class PieChartView: PieRadarChartViewBase } } - /// - returns: `true` if drawing x-values is enabled, `false` ifnot + /// `true` if drawing x-values is enabled, `false` ifnot @objc open var isUsePercentValuesEnabled: Bool { get diff --git a/Source/Charts/Charts/PieRadarChartViewBase.swift b/Source/Charts/Charts/PieRadarChartViewBase.swift index c6de8ce7c7..0821603968 100755 --- a/Source/Charts/Charts/PieRadarChartViewBase.swift +++ b/Source/Charts/Charts/PieRadarChartViewBase.swift @@ -244,7 +244,7 @@ open class PieRadarChartViewBase: ChartViewBase _viewPortHandler.restrainViewPort(offsetLeft: offsetLeft, offsetTop: offsetTop, offsetRight: offsetRight, offsetBottom: offsetBottom) } - /// - returns: The angle relative to the chart center for the given point on the chart in degrees. + /// - Returns: The angle relative to the chart center for the given point on the chart in degrees. /// The angle is always between 0 and 360°, 0° is NORTH, 90° is EAST, ... @objc open func angleForPoint(x: CGFloat, y: CGFloat) -> CGFloat { @@ -282,7 +282,7 @@ open class PieRadarChartViewBase: ChartViewBase y: center.y + dist * sin(angle.DEG2RAD)) } - /// - returns: The distance of a certain point on the chart to the center of the chart. + /// - Returns: The distance of a certain point on the chart to the center of the chart. @objc open func distanceToCenter(x: CGFloat, y: CGFloat) -> CGFloat { let c = self.centerOffsets @@ -316,7 +316,7 @@ open class PieRadarChartViewBase: ChartViewBase return dist } - /// - returns: The xIndex for the given angle around the center of the chart. + /// - Returns: The xIndex for the given angle around the center of the chart. /// -1 if not found / outofbounds. @objc open func indexForAngle(_ angle: CGFloat) -> Int { @@ -326,7 +326,7 @@ open class PieRadarChartViewBase: ChartViewBase /// current rotation angle of the pie chart /// /// **default**: 270 --> top (NORTH) - /// - returns: Will always return a normalized value, which will be between 0.0 < 360.0 + /// Will always return a normalized value, which will be between 0.0 < 360.0 @objc open var rotationAngle: CGFloat { get @@ -348,7 +348,7 @@ open class PieRadarChartViewBase: ChartViewBase return _rawRotationAngle } - /// - returns: The diameter of the pie- or radar-chart + /// The diameter of the pie- or radar-chart @objc open var diameter: CGFloat { var content = _viewPortHandler.contentRect @@ -359,19 +359,19 @@ open class PieRadarChartViewBase: ChartViewBase return min(content.width, content.height) } - /// - returns: The radius of the chart in pixels. + /// The radius of the chart in pixels. @objc open var radius: CGFloat { fatalError("radius cannot be called on PieRadarChartViewBase") } - /// - returns: The required offset for the chart legend. + /// The required offset for the chart legend. internal var requiredLegendOffset: CGFloat { fatalError("requiredLegendOffset cannot be called on PieRadarChartViewBase") } - /// - returns: The base offset needed for the chart without calculating the + /// - Returns: The base offset needed for the chart without calculating the /// legend size. internal var requiredBaseOffset: CGFloat { @@ -791,7 +791,7 @@ open class PieRadarChartViewBase: ChartViewBase } } - /// - returns: The distance between two points + /// - Returns: The distance between two points private func distance(eventX: CGFloat, startX: CGFloat, eventY: CGFloat, startY: CGFloat) -> CGFloat { let dx = eventX - startX @@ -799,7 +799,7 @@ open class PieRadarChartViewBase: ChartViewBase return sqrt(dx * dx + dy * dy) } - /// - returns: The distance between two points + /// - Returns: The distance between two points private func distance(from: CGPoint, to: CGPoint) -> CGFloat { let dx = from.x - to.x diff --git a/Source/Charts/Charts/RadarChartView.swift b/Source/Charts/Charts/RadarChartView.swift index 745c933bf1..93dc72f5a1 100644 --- a/Source/Charts/Charts/RadarChartView.swift +++ b/Source/Charts/Charts/RadarChartView.swift @@ -146,7 +146,7 @@ open class RadarChartView: PieRadarChartViewBase drawMarkers(context: context) } - /// - returns: The factor that is needed to transform values into pixels. + /// The factor that is needed to transform values into pixels. @objc open var factor: CGFloat { let content = _viewPortHandler.contentRect @@ -154,7 +154,7 @@ open class RadarChartView: PieRadarChartViewBase / CGFloat(_yAxis.axisRange) } - /// - returns: The angle that each slice in the radar chart occupies. + /// The angle that each slice in the radar chart occupies. @objc open var sliceAngle: CGFloat { return 360.0 / CGFloat(_data?.maxEntryCountSet?.entryCount ?? 0) @@ -185,7 +185,7 @@ open class RadarChartView: PieRadarChartViewBase return index } - /// - returns: The object that represents all y-labels of the RadarChart. + /// The object that represents all y-labels of the RadarChart. @objc open var yAxis: YAxis { return _yAxis @@ -221,12 +221,12 @@ open class RadarChartView: PieRadarChartViewBase return min(content.width / 2.0, content.height / 2.0) } - /// - returns: The maximum value this chart can display on it's y-axis. + /// The maximum value this chart can display on it's y-axis. open override var chartYMax: Double { return _yAxis._axisMaximum } - /// - returns: The minimum value this chart can display on it's y-axis. + /// The minimum value this chart can display on it's y-axis. open override var chartYMin: Double { return _yAxis._axisMinimum } - /// - returns: The range of y-values this chart can display. + /// The range of y-values this chart can display. @objc open var yRange: Double { return _yAxis.axisRange } } diff --git a/Source/Charts/Components/AxisBase.swift b/Source/Charts/Components/AxisBase.swift index b57c59dbb3..334eaf7f24 100644 --- a/Source/Charts/Components/AxisBase.swift +++ b/Source/Charts/Components/AxisBase.swift @@ -143,7 +143,7 @@ open class AxisBase: ComponentBase return longest } - /// - returns: The formatted label at the specified index. This will either use the auto-formatter or the custom formatter (if one is set). + /// - Returns: The formatted label at the specified index. This will either use the auto-formatter or the custom formatter (if one is set). @objc open func getFormattedLabel(_ index: Int) -> String { if index < 0 || index >= entries.count @@ -249,7 +249,7 @@ open class AxisBase: ComponentBase forceLabelsEnabled = force } - /// - returns: `true` if focing the y-label count is enabled. Default: false + /// `true` if focing the y-label count is enabled. Default: false @objc open var isForceLabelsEnabled: Bool { return forceLabelsEnabled } /// Adds a new ChartLimitLine to this axis. @@ -277,7 +277,7 @@ open class AxisBase: ComponentBase _limitLines.removeAll(keepingCapacity: false) } - /// - returns: The LimitLines of this axis. + /// The LimitLines of this axis. @objc open var limitLines : [ChartLimitLine] { return _limitLines @@ -336,8 +336,10 @@ open class AxisBase: ComponentBase } /// Calculates the minimum, maximum and range values of the YAxis with the given minimum and maximum values from the chart data. - /// - parameter dataMin: the y-min value according to chart data - /// - parameter dataMax: the y-max value according to chart + /// + /// - Parameters: + /// - dataMin: the y-min value according to chart data + /// - dataMax: the y-max value according to chart @objc open func calculate(min dataMin: Double, max dataMax: Double) { // if custom, use value as is, else use data value diff --git a/Source/Charts/Components/IMarker.swift b/Source/Charts/Components/IMarker.swift index 59abfad7bb..a4b7526098 100644 --- a/Source/Charts/Components/IMarker.swift +++ b/Source/Charts/Components/IMarker.swift @@ -15,24 +15,23 @@ import CoreGraphics @objc(IChartMarker) public protocol IMarker: class { - /// - returns: The desired (general) offset you wish the IMarker to have on the x-axis. - /// + /// - 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 } - /// - returns: The offset for drawing at the specific `point`. + /// - 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(). - /// - /// - parameter point: This is the point at which the marker wants to be drawn. You can adjust the offset conditionally based on this argument. func offsetForDrawing(atPoint: CGPoint) -> CGPoint /// This method enables a custom IMarker to update it's content every time the IMarker is redrawn according to the data entry it points to. /// - /// - parameter entry: The Entry the IMarker belongs to. This can also be any subclass of Entry, like BarEntry or CandleEntry, simply cast it at runtime. - /// - parameter 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). + /// - 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 IMarker on the given position on the given context diff --git a/Source/Charts/Components/Legend.swift b/Source/Charts/Components/Legend.swift index 68e9e9e283..6386fe327d 100644 --- a/Source/Charts/Components/Legend.swift +++ b/Source/Charts/Components/Legend.swift @@ -420,7 +420,7 @@ open class Legend: ComponentBase } /// **default**: false (automatic legend) - /// - returns: `true` if a custom legend entries has been set + /// `true` if a custom legend entries has been set @objc open var isLegendCustom: Bool { return _isLegendCustom diff --git a/Source/Charts/Components/LegendEntry.swift b/Source/Charts/Components/LegendEntry.swift index 88ed2e115c..7b8c88b424 100644 --- a/Source/Charts/Components/LegendEntry.swift +++ b/Source/Charts/Components/LegendEntry.swift @@ -24,14 +24,15 @@ open class LegendEntry: NSObject super.init() } - /// - parameter label: The legend entry text. + /// - Parameters: + /// - label: The legend entry text. /// A `nil` label will start a group. - /// - parameter form: The form to draw for this entry. - /// - parameter formSize: Set to NaN to use the legend's default. - /// - parameter formLineWidth: Set to NaN to use the legend's default. - /// - parameter formLineDashPhase: Line dash configuration. - /// - parameter formLineDashLengths: Line dash configurationas NaN to use the legend's default. - /// - parameter formColor: The color for drawing the form. + /// - form: The form to draw for this entry. + /// - formSize: Set to NaN to use the legend's default. + /// - formLineWidth: Set to NaN to use the legend's default. + /// - formLineDashPhase: Line dash configuration. + /// - formLineDashLengths: Line dash configurationas NaN to use the legend's default. + /// - formColor: The color for drawing the form. @objc public init(label: String?, form: Legend.Form, formSize: CGFloat, diff --git a/Source/Charts/Components/XAxis.swift b/Source/Charts/Components/XAxis.swift index 1031bbb0e7..77dbbd6974 100644 --- a/Source/Charts/Components/XAxis.swift +++ b/Source/Charts/Components/XAxis.swift @@ -49,10 +49,10 @@ open class XAxis: AxisBase /// if set to true, word wrapping the labels will be enabled. /// word wrapping is done using `(value width * labelRotatedWidth)` /// - /// - note: currently supports all charts except pie/radar/horizontal-bar* + /// - Note: currently supports all charts except pie/radar/horizontal-bar* @objc open var wordWrapEnabled = false - /// - returns: `true` if word wrapping the labels is enabled + /// `true` if word wrapping the labels is enabled @objc open var isWordWrapEnabled: Bool { return wordWrapEnabled } /// the width for wrapping the labels, as percentage out of one value width. diff --git a/Source/Charts/Components/YAxis.swift b/Source/Charts/Components/YAxis.swift index cd50ac93e0..1d5ef671e2 100644 --- a/Source/Charts/Components/YAxis.swift +++ b/Source/Charts/Components/YAxis.swift @@ -129,7 +129,7 @@ open class YAxis: AxisBase return requiredSize().height } - /// - returns: `true` if this axis needs horizontal offset, `false` ifno offset is needed. + /// `true` if this axis needs horizontal offset, `false` ifno offset is needed. @objc open var needsOffset: Bool { if isEnabled && isDrawLabelsEnabled && labelPosition == .outsideChart diff --git a/Source/Charts/Data/Implementations/ChartBaseDataSet.swift b/Source/Charts/Data/Implementations/ChartBaseDataSet.swift index ff91f44c29..003438f206 100644 --- a/Source/Charts/Data/Implementations/ChartBaseDataSet.swift +++ b/Source/Charts/Data/Implementations/ChartBaseDataSet.swift @@ -198,7 +198,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// The axis this DataSet should be plotted against. open var axisDependency = YAxis.AxisDependency.left - /// - returns: The color at the given index of the DataSet's color array. + /// - 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. open func color(atIndex index: Int) -> NSUIColor { @@ -217,7 +217,9 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying } /// Adds a new color to the colors array of the DataSet. - /// - parameter color: the color to add + /// + /// - Parameters: + /// - color: the color to add open func addColor(_ color: NSUIColor) { colors.append(color) @@ -225,7 +227,9 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// Sets the one and **only** color that should be used for this DataSet. /// Internally, this recreates the colors array and adds the specified color. - /// - parameter color: the color to set + /// + /// - Parameters: + /// - color: the color to set open func setColor(_ color: NSUIColor) { colors.removeAll(keepingCapacity: false) @@ -233,16 +237,20 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying } /// Sets colors to a single color a specific alpha value. - /// - parameter color: the color to set - /// - parameter alpha: alpha to apply to the set `color` + /// + /// - Parameters: + /// - color: the color to set + /// - alpha: alpha to apply to the set `color` @objc open func setColor(_ color: NSUIColor, alpha: CGFloat) { setColor(color.withAlphaComponent(alpha)) } /// Sets colors with a specific alpha value. - /// - parameter colors: the colors to set - /// - parameter alpha: alpha to apply to the set `colors` + /// + /// - Parameters: + /// - colors: the colors to set + /// - alpha: alpha to apply to the set `colors` @objc open func setColors(_ colors: [NSUIColor], alpha: CGFloat) { var colorsWithAlpha = colors @@ -256,8 +264,10 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying } /// Sets colors with a specific alpha value. - /// - parameter colors: the colors to set - /// - parameter alpha: alpha to apply to the set `colors` + /// + /// - Parameters: + /// - colors: the colors to set + /// - alpha: alpha to apply to the set `colors` open func setColors(_ colors: NSUIColor...) { self.colors = colors @@ -266,7 +276,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// if true, value highlighting is enabled open var highlightEnabled = true - /// - returns: `true` if value highlighting is enabled for this dataset + /// `true` if value highlighting is enabled for this dataset open var isHighlightEnabled: Bool { return highlightEnabled } /// Custom formatter that is used instead of the auto-formatter if set @@ -313,7 +323,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying } } - /// - returns: The color at the specified index that is used for drawing the values inside the chart. Uses modulus internally. + /// - Returns: The color at the specified index that is used for drawing the values inside the chart. Uses modulus internally. open func valueTextColorAt(_ index: Int) -> NSUIColor { var index = index @@ -354,10 +364,10 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// 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. + /// - Note: For bar and line charts: if `maxVisibleCount` is reached, no values will be drawn even if this is enabled. open var drawValuesEnabled = true - /// - returns: `true` if y-value drawing is enabled, `false` ifnot + /// `true` if y-value drawing is enabled, `false` ifnot open var isDrawValuesEnabled: Bool { return drawValuesEnabled @@ -365,7 +375,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// 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. + /// - Note: For bar and line charts: if `maxVisibleCount` is reached, no icons will be drawn even if this is enabled. open var drawIconsEnabled = true /// Returns true if y-icon drawing is enabled, false if not @@ -384,7 +394,7 @@ open class ChartBaseDataSet: NSObject, IChartDataSet, NSCopying /// Set the visibility of this DataSet. If not visible, the DataSet will not be drawn to the chart upon refreshing it. open var visible = true - /// - returns: `true` if this DataSet is visible inside the chart, or `false` ifit is currently hidden. + /// `true` if this DataSet is visible inside the chart, or `false` ifit is currently hidden. open var isVisible: Bool { return visible diff --git a/Source/Charts/Data/Implementations/Standard/BarChartData.swift b/Source/Charts/Data/Implementations/Standard/BarChartData.swift index 0317fc8a6b..6697c32cf2 100644 --- a/Source/Charts/Data/Implementations/Standard/BarChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/BarChartData.swift @@ -33,9 +33,10 @@ open class BarChartData: BarLineScatterCandleBubbleChartData /// Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specified by the parameters. /// Do not forget to call notifyDataSetChanged() on your BarChart object after calling this method. /// - /// - parameter the starting point on the x-axis where the grouping should begin - /// - parameter groupSpace: The space between groups of bars in values (not pixels) e.g. 0.8f for bar width 1f - /// - parameter barSpace: The space between individual bars in values (not pixels) e.g. 0.1f for bar width 1f + /// - Parameters: + /// - fromX: the starting point on the x-axis where the grouping should begin + /// - groupSpace: The space between groups of bars in values (not pixels) e.g. 0.8f for bar width 1f + /// - barSpace: The space between individual bars in values (not pixels) e.g. 0.1f for bar width 1f @objc open func groupBars(fromX: Double, groupSpace: Double, barSpace: Double) { let setCount = _dataSets.count @@ -95,8 +96,9 @@ open class BarChartData: BarLineScatterCandleBubbleChartData /// In case of grouped bars, this method returns the space an individual group of bar needs on the x-axis. /// - /// - parameter groupSpace: - /// - parameter barSpace: + /// - Parameters: + /// - groupSpace: + /// - barSpace: @objc open func groupWidth(groupSpace: Double, barSpace: Double) -> Double { return Double(_dataSets.count) * (self.barWidth + barSpace) + groupSpace diff --git a/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift b/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift index d93fd36cdd..c2b595043b 100644 --- a/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift +++ b/Source/Charts/Data/Implementations/Standard/BarChartDataEntry.swift @@ -109,13 +109,13 @@ open class BarChartDataEntry: ChartDataEntry return remainder } - /// - returns: The sum of all negative values this entry (if stacked) contains. (this is a positive number) + /// The sum of all negative values this entry (if stacked) contains. (this is a positive number) @objc open var negativeSum: Double { return _negativeSum } - /// - returns: The sum of all positive values this entry (if stacked) contains. + /// The sum of all positive values this entry (if stacked) contains. @objc open var positiveSum: Double { return _positiveSum @@ -150,8 +150,10 @@ open class BarChartDataEntry: ChartDataEntry } /// Splits up the stack-values of the given bar-entry into Range objects. - /// - parameter entry: - /// - returns: + /// + /// - Parameters: + /// - entry: + /// - Returns: @objc open func calcRanges() { let values = yValues @@ -209,7 +211,7 @@ open class BarChartDataEntry: ChartDataEntry } } - /// - returns: The ranges of the individual stack-entries. Will return null if this entry is not stacked. + /// The ranges of the individual stack-entries. Will return null if this entry is not stacked. @objc open var ranges: [Range]? { return _ranges @@ -229,8 +231,9 @@ open class BarChartDataEntry: ChartDataEntry /// Calculates the sum across all values of the given stack. /// - /// - parameter vals: - /// - returns: + /// - Parameters: + /// - vals: + /// - Returns: private static func calcSum(values: [Double]?) -> Double { guard let values = values diff --git a/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift index d3549ea06a..94e8a58707 100644 --- a/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/BarChartDataSet.swift @@ -114,19 +114,19 @@ open class BarChartDataSet: BarLineScatterCandleBubbleChartDataSet, IBarChartDat } } - /// - returns: The maximum number of bars that can be stacked upon another in this DataSet. + /// The maximum number of bars that can be stacked upon another in this DataSet. open var stackSize: Int { return _stackSize } - /// - returns: `true` if this DataSet is stacked (stacksize > 1) or not. + /// `true` if this DataSet is stacked (stacksize > 1) or not. open var isStacked: Bool { return _stackSize > 1 ? true : false } - /// - returns: The overall entry count, including counting each stack-value individually + /// The overall entry count, including counting each stack-value individually @objc open var entryCountStacks: Int { return _entryCountStacks diff --git a/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift b/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift index 25cfc739d6..a815f67755 100644 --- a/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift +++ b/Source/Charts/Data/Implementations/Standard/BubbleChartDataEntry.swift @@ -22,9 +22,10 @@ open class BubbleChartDataEntry: ChartDataEntry super.init() } - /// - parameter x: The index on the x-axis. - /// - parameter y: The value on the y-axis. - /// - parameter size: The size of the bubble. + /// - Parameters: + /// - x: The index on the x-axis. + /// - y: The value on the y-axis. + /// - size: The size of the bubble. @objc public init(x: Double, y: Double, size: CGFloat) { super.init(x: x, y: y) @@ -32,10 +33,11 @@ open class BubbleChartDataEntry: ChartDataEntry self.size = size } - /// - parameter x: The index on the x-axis. - /// - parameter y: The value on the y-axis. - /// - parameter size: The size of the bubble. - /// - parameter data: Spot for additional data this Entry represents. + /// - Parameters: + /// - x: The index on the x-axis. + /// - y: The value on the y-axis. + /// - size: The size of the bubble. + /// - data: Spot for additional data this Entry represents. @objc public init(x: Double, y: Double, size: CGFloat, data: AnyObject?) { super.init(x: x, y: y, data: data) @@ -43,10 +45,11 @@ open class BubbleChartDataEntry: ChartDataEntry self.size = size } - /// - parameter x: The index on the x-axis. - /// - parameter y: The value on the y-axis. - /// - parameter size: The size of the bubble. - /// - parameter icon: icon image + /// - Parameters: + /// - x: The index on the x-axis. + /// - y: The value on the y-axis. + /// - size: The size of the bubble. + /// - icon: icon image @objc public init(x: Double, y: Double, size: CGFloat, icon: NSUIImage?) { super.init(x: x, y: y, icon: icon) @@ -54,11 +57,12 @@ open class BubbleChartDataEntry: ChartDataEntry self.size = size } - /// - parameter x: The index on the x-axis. - /// - parameter y: The value on the y-axis. - /// - parameter size: The size of the bubble. - /// - parameter icon: icon image - /// - parameter data: Spot for additional data this Entry represents. + /// - Parameters: + /// - x: The index on the x-axis. + /// - y: The value on the y-axis. + /// - size: The size of the bubble. + /// - icon: icon image + /// - data: Spot for additional data this Entry represents. @objc public init(x: Double, y: Double, size: CGFloat, icon: NSUIImage?, data: AnyObject?) { super.init(x: x, y: y, icon: icon, data: data) diff --git a/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift b/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift index 3010717ead..2ffd02d69d 100644 --- a/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift +++ b/Source/Charts/Data/Implementations/Standard/CandleChartDataEntry.swift @@ -70,13 +70,13 @@ open class CandleChartDataEntry: ChartDataEntry self.close = close } - /// - returns: The overall range (difference) between shadow-high and shadow-low. + /// The overall range (difference) between shadow-high and shadow-low. @objc open var shadowRange: Double { return abs(high - low) } - /// - returns: The body size (difference between open and close). + /// The body size (difference between open and close). @objc open var bodyRange: Double { return abs(open - close) diff --git a/Source/Charts/Data/Implementations/Standard/ChartData.swift b/Source/Charts/Data/Implementations/Standard/ChartData.swift index 24309ebae9..065cded398 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartData.swift @@ -235,13 +235,13 @@ open class ChartData: NSObject } } - /// - returns: The number of LineDataSets this object contains + /// The number of LineDataSets this object contains @objc open var dataSetCount: Int { return _dataSets.count } - /// - returns: The smallest y-value the data object contains. + /// The smallest y-value the data object contains. @objc open var yMin: Double { return _yMin @@ -279,7 +279,7 @@ open class ChartData: NSObject } } - /// - returns: The greatest y-value the data object contains. + /// The greatest y-value the data object contains. @objc open var yMax: Double { return _yMax @@ -317,18 +317,18 @@ open class ChartData: NSObject } } - /// - returns: The minimum x-value the data object contains. + /// The minimum x-value the data object contains. @objc open var xMin: Double { return _xMin } - /// - returns: The maximum x-value the data object contains. + /// The maximum x-value the data object contains. @objc open var xMax: Double { return _xMax } - /// - returns: All DataSet objects this ChartData object holds. + /// All DataSet objects this ChartData object holds. @objc open var dataSets: [IChartDataSet] { get @@ -346,10 +346,11 @@ open class ChartData: NSObject /// /// **IMPORTANT: This method does calculations at runtime, do not over-use in performance critical situations.** /// - /// - parameter dataSets: the DataSet array to search - /// - parameter type: - /// - parameter ignorecase: if true, the search is not case-sensitive - /// - returns: The index of the DataSet Object with the given label. Sensitive or not. + /// - Parameters: + /// - dataSets: the DataSet array to search + /// - type: + /// - ignorecase: if true, the search is not case-sensitive + /// - Returns: The index of the DataSet Object with the given label. Sensitive or not. internal func getDataSetIndexByLabel(_ label: String, ignorecase: Bool) -> Int { if ignorecase @@ -380,7 +381,7 @@ open class ChartData: NSObject return -1 } - /// - returns: The labels of all DataSets as a string array. + /// - Returns: The labels of all DataSets as a string array. internal func dataSetLabels() -> [String] { var types = [String]() @@ -400,8 +401,9 @@ open class ChartData: NSObject /// Get the Entry for a corresponding highlight object /// - /// - parameter highlight: - /// - returns: The entry that is highlighted + /// - Parameters: + /// - highlight: + /// - Returns: The entry that is highlighted @objc open func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? { if highlight.dataSetIndex >= dataSets.count @@ -416,9 +418,10 @@ open class ChartData: NSObject /// **IMPORTANT: This method does calculations at runtime. Use with care in performance critical situations.** /// - /// - parameter label: - /// - parameter ignorecase: - /// - returns: The DataSet Object with the given label. Sensitive or not. + /// - Parameters: + /// - label: + /// - ignorecase: + /// - Returns: The DataSet Object with the given label. Sensitive or not. @objc open func getDataSetByLabel(_ label: String, ignorecase: Bool) -> IChartDataSet? { let index = getDataSetIndexByLabel(label, ignorecase: ignorecase) @@ -453,7 +456,7 @@ open class ChartData: NSObject /// Removes the given DataSet from this data object. /// Also recalculates all minimum and maximum values. /// - /// - returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. + /// - Returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. @objc @discardableResult open func removeDataSet(_ dataSet: IChartDataSet!) -> Bool { if dataSet === nil @@ -475,7 +478,7 @@ open class ChartData: NSObject /// Removes the DataSet at the given index in the DataSet array from the data object. /// Also recalculates all minimum and maximum values. /// - /// - returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. + /// - Returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. @objc @discardableResult open func removeDataSetByIndex(_ index: Int) -> Bool { if index >= _dataSets.count || index < 0 @@ -529,7 +532,8 @@ open class ChartData: NSObject /// Removes the Entry object closest to the given xIndex from the ChartDataSet at the /// specified index. - /// - returns: `true` if an entry was removed, `false` ifno Entry was found that meets the specified requirements. + /// + /// - Returns: `true` if an entry was removed, `false` ifno Entry was found that meets the specified requirements. @objc @discardableResult open func removeEntry(xValue: Double, dataSetIndex: Int) -> Bool { if dataSetIndex >= _dataSets.count @@ -545,7 +549,7 @@ open class ChartData: NSObject return false } - /// - returns: The DataSet that contains the provided Entry, or null, if no DataSet contains this entry. + /// - Returns: The DataSet that contains the provided Entry, or null, if no DataSet contains this entry. @objc open func getDataSetForEntry(_ e: ChartDataEntry!) -> IChartDataSet? { if e == nil @@ -566,7 +570,7 @@ open class ChartData: NSObject return nil } - /// - returns: The index of the provided DataSet in the DataSet array of this data object, or -1 if it does not exist. + /// - Returns: The index of the provided DataSet in the DataSet array of this data object, or -1 if it does not exist. @objc open func indexOfDataSet(_ dataSet: IChartDataSet) -> Int { for i in 0 ..< _dataSets.count @@ -580,7 +584,7 @@ open class ChartData: NSObject return -1 } - /// - returns: The first DataSet from the datasets-array that has it's dependency on the left axis. Returns null if no DataSet with left dependency could be found. + /// - Returns: The first DataSet from the datasets-array that has it's dependency on the left axis. Returns null if no DataSet with left dependency could be found. @objc open func getFirstLeft(dataSets: [IChartDataSet]) -> IChartDataSet? { for dataSet in dataSets @@ -594,7 +598,7 @@ open class ChartData: NSObject return nil } - /// - returns: The first DataSet from the datasets-array that has it's dependency on the right axis. Returns null if no DataSet with right dependency could be found. + /// - Returns: The first DataSet from the datasets-array that has it's dependency on the right axis. Returns null if no DataSet with right dependency could be found. @objc open func getFirstRight(dataSets: [IChartDataSet]) -> IChartDataSet? { for dataSet in _dataSets @@ -608,7 +612,7 @@ open class ChartData: NSObject return nil } - /// - returns: All colors used across all DataSet objects this object represents. + /// - Returns: All colors used across all DataSet objects this object represents. @objc open func getColors() -> [NSUIColor]? { var clrcnt = 0 @@ -709,7 +713,8 @@ open class ChartData: NSObject } /// Checks if this data object contains the specified DataSet. - /// - returns: `true` if so, `false` ifnot. + /// + /// - Returns: `true` if so, `false` ifnot. @objc open func contains(dataSet: IChartDataSet) -> Bool { for set in dataSets @@ -723,7 +728,7 @@ open class ChartData: NSObject return false } - /// - returns: The total entry count across all DataSet objects this data object contains. + /// The total entry count across all DataSet objects this data object contains. @objc open var entryCount: Int { var count = 0 @@ -736,7 +741,7 @@ open class ChartData: NSObject return count } - /// - returns: The DataSet object with the maximum number of entries or null if there are no DataSets. + /// The DataSet object with the maximum number of entries or null if there are no DataSets. @objc open var maxEntryCountSet: IChartDataSet? { if _dataSets.count == 0 diff --git a/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift b/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift index 41094cf4e4..ac591071d0 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartDataEntry.swift @@ -22,8 +22,10 @@ open class ChartDataEntry: ChartDataEntryBase, NSCopying } /// An Entry represents one single entry in the chart. - /// - parameter x: the x value - /// - parameter y: the y value (the actual value of the entry) + /// + /// - Parameters: + /// - x: the x value + /// - y: the y value (the actual value of the entry) @objc public init(x: Double, y: Double) { super.init(y: y) @@ -32,9 +34,11 @@ open class ChartDataEntry: ChartDataEntryBase, NSCopying } /// An Entry represents one single entry in the chart. - /// - parameter x: the x value - /// - parameter y: the y value (the actual value of the entry) - /// - parameter data: Space for additional data this Entry represents. + /// + /// - Parameters: + /// - x: the x value + /// - y: the y value (the actual value of the entry) + /// - data: Space for additional data this Entry represents. @objc public init(x: Double, y: Double, data: AnyObject?) { @@ -46,9 +50,11 @@ open class ChartDataEntry: ChartDataEntryBase, NSCopying } /// An Entry represents one single entry in the chart. - /// - parameter x: the x value - /// - parameter y: the y value (the actual value of the entry) - /// - parameter icon: icon image + /// + /// - Parameters: + /// - x: the x value + /// - y: the y value (the actual value of the entry) + /// - icon: icon image @objc public init(x: Double, y: Double, icon: NSUIImage?) { @@ -58,10 +64,12 @@ open class ChartDataEntry: ChartDataEntryBase, NSCopying } /// An Entry represents one single entry in the chart. - /// - parameter x: the x value - /// - parameter y: the y value (the actual value of the entry) - /// - parameter icon: icon image - /// - parameter data: Space for additional data this Entry represents. + /// + /// - Parameters: + /// - x: the x value + /// - y: the y value (the actual value of the entry) + /// - icon: icon image + /// - data: Space for additional data this Entry represents. @objc public init(x: Double, y: Double, icon: NSUIImage?, data: AnyObject?) { diff --git a/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift b/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift index 0dcb1c71c6..5b1075bc41 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartDataEntryBase.swift @@ -28,7 +28,9 @@ open class ChartDataEntryBase: NSObject } /// An Entry represents one single entry in the chart. - /// - parameter y: the y value (the actual value of the entry) + /// + /// - Parameters: + /// - y: the y value (the actual value of the entry) @objc public init(y: Double) { super.init() @@ -36,8 +38,9 @@ open class ChartDataEntryBase: NSObject self.y = y } - /// - parameter y: the y value (the actual value of the entry) - /// - parameter data: Space for additional data this Entry represents. + /// - Parameters: + /// - y: the y value (the actual value of the entry) + /// - data: Space for additional data this Entry represents. @objc public init(y: Double, data: AnyObject?) { @@ -47,8 +50,9 @@ open class ChartDataEntryBase: NSObject self.data = data } - /// - parameter y: the y value (the actual value of the entry) - /// - parameter icon: icon image + /// - Parameters: + /// - y: the y value (the actual value of the entry) + /// - icon: icon image @objc public init(y: Double, icon: NSUIImage?) { @@ -58,9 +62,10 @@ open class ChartDataEntryBase: NSObject self.icon = icon } - /// - parameter y: the y value (the actual value of the entry) - /// - parameter icon: icon image - /// - parameter data: Space for additional data this Entry represents. + /// - Parameters: + /// - y: the y value (the actual value of the entry) + /// - icon: icon image + /// - data: Space for additional data this Entry represents. @objc public init(y: Double, icon: NSUIImage?, data: AnyObject?) { diff --git a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift index 1ee39f7030..f86f4cac5a 100644 --- a/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/ChartDataSet.swift @@ -54,9 +54,8 @@ open class ChartDataSet: ChartBaseDataSet // MARK: - Data functions and accessors - /// * - /// - note: Calls `notifyDataSetChanged()` after setting a new value. - /// - returns: The array of y-values that this DataSet represents. + /// - Note: Calls `notifyDataSetChanged()` after setting a new value. + /// - Returns: The array of y-values that this DataSet represents. /// the entries that this dataset represents / holds together @objc open var values: [ChartDataEntry] { @@ -140,31 +139,32 @@ open class ChartDataSet: ChartBaseDataSet /// Updates the min and max x and y value of this DataSet based on the given Entry. /// - /// - parameter e: + /// - Parameters: + /// - e: internal func calcMinMax(entry e: ChartDataEntry) { calcMinMaxX(entry: e) calcMinMaxY(entry: e) } - /// - returns: The minimum y-value this DataSet holds + /// The minimum y-value this DataSet holds open override var yMin: Double { return _yMin } - /// - returns: The maximum y-value this DataSet holds + /// The maximum y-value this DataSet holds open override var yMax: Double { return _yMax } - /// - returns: The minimum x-value this DataSet holds + /// The minimum x-value this DataSet holds open override var xMin: Double { return _xMin } - /// - returns: The maximum x-value this DataSet holds + /// The maximum x-value this DataSet holds open override var xMax: Double { return _xMax } - /// - returns: The number of y-values this DataSet represents + /// The number of y-values this DataSet represents open override var entryCount: Int { return values.count } - /// - returns: The entry object found at the given index (not x-value!) - /// - throws: out of bounds + /// - 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!) open override func entryForIndex(_ i: Int) -> ChartDataEntry? { guard i >= values.startIndex, i < values.endIndex else { @@ -173,12 +173,13 @@ open class ChartDataSet: ChartBaseDataSet return values[i] } - /// - returns: The first Entry object found at the given x-value with binary search. + /// - 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. - /// - parameter xValue: the x-value - /// - parameter closestToY: If there are multiple y-values for the specified x-value, - /// - parameter rounding: determine whether to round up/down/closest if there is no Entry matching the provided x-value open override func entryForXValue( _ xValue: Double, closestToY yValue: Double, @@ -192,11 +193,12 @@ open class ChartDataSet: ChartBaseDataSet return nil } - /// - returns: The first Entry object found at the given x-value with binary search. + /// - 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. - /// - parameter xValue: the x-value - /// - parameter closestToY: If there are multiple y-values for the specified x-value, open override func entryForXValue( _ xValue: Double, closestToY yValue: Double) -> ChartDataEntry? @@ -204,7 +206,7 @@ open class ChartDataSet: ChartBaseDataSet return entryForXValue(xValue, closestToY: yValue, rounding: .closest) } - /// - returns: All Entry objects found at the given xIndex with binary search. + /// - Returns: All Entry objects found at the given xIndex with binary search. /// An empty array if no Entry object at that index. open override func entriesForXValue(_ xValue: Double) -> [ChartDataEntry] { @@ -262,12 +264,12 @@ open class ChartDataSet: ChartBaseDataSet return entries } - /// - returns: The array-index of the specified entry. + /// - 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. - /// - /// - parameter xValue: x-value of the entry to search for - /// - parameter closestToY: If there are multiple y-values for the specified x-value, - /// - parameter rounding: Rounding method if exact value was not found open override func entryIndex( x xValue: Double, closestToY yValue: Double, @@ -370,9 +372,9 @@ open class ChartDataSet: ChartBaseDataSet return closest } - /// - returns: The array-index of the specified entry - /// - /// - parameter e: the entry to search for + /// - Parameters: + /// - e: the entry to search for + /// - Returns: The array-index of the specified entry open override func entryIndex(entry e: ChartDataEntry) -> Int { for i in 0 ..< values.count @@ -389,8 +391,10 @@ open class ChartDataSet: ChartBaseDataSet /// Adds an Entry to the DataSet dynamically. /// Entries are added to the end of the list. /// This will also recalculate the current minimum and maximum values of the DataSet and the value-sum. - /// - parameter e: the entry to add - /// - returns: True + /// + /// - Parameters: + /// - e: the entry to add + /// - Returns: True open override func addEntry(_ e: ChartDataEntry) -> Bool { calcMinMax(entry: e) @@ -404,8 +408,10 @@ open class ChartDataSet: ChartBaseDataSet /// Adds an Entry to the DataSet dynamically. /// Entries are added to their appropriate index respective to it's x-index. /// This will also recalculate the current minimum and maximum values of the DataSet and the value-sum. - /// - parameter e: the entry to add - /// - returns: True + /// + /// - Parameters: + /// - e: the entry to add + /// - Returns: True open override func addEntryOrdered(_ e: ChartDataEntry) -> Bool { calcMinMax(entry: e) @@ -430,8 +436,10 @@ open class ChartDataSet: ChartBaseDataSet /// Removes an Entry from the DataSet dynamically. /// This will also recalculate the current minimum and maximum values of the DataSet and the value-sum. - /// - parameter entry: the entry to remove - /// - returns: `true` if the entry was removed successfully, else if the entry does not exist + /// + /// - Parameters: + /// - entry: the entry to remove + /// - Returns: `true` if the entry was removed successfully, else if the entry does not exist open override func removeEntry(_ entry: ChartDataEntry) -> Bool { var removed = false @@ -454,7 +462,7 @@ open class ChartDataSet: ChartBaseDataSet /// Removes the first Entry (at index 0) of this DataSet from the entries array. /// - /// - returns: `true` if successful, `false` if not. + /// - Returns: `true` if successful, `false` if not. open override func removeFirst() -> Bool { let entry: ChartDataEntry? = values.isEmpty ? nil : values.removeFirst() @@ -463,7 +471,7 @@ open class ChartDataSet: ChartBaseDataSet /// Removes the last Entry (at index size-1) of this DataSet from the entries array. /// - /// - returns: `true` if successful, `false` if not. + /// - Returns: `true` if successful, `false` if not. open override func removeLast() -> Bool { let entry: ChartDataEntry? = values.isEmpty ? nil : values.removeLast() @@ -471,7 +479,8 @@ open class ChartDataSet: ChartBaseDataSet } /// Checks if this DataSet contains the specified Entry. - /// - returns: `true` if contains the entry, `false` if not. + /// + /// - Returns: `true` if contains the entry, `false` if not. open override func contains(_ e: ChartDataEntry) -> Bool { for entry in values diff --git a/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift b/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift index 8d269edf66..32c78e6578 100644 --- a/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/CombinedChartData.swift @@ -165,7 +165,7 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData } } - /// - returns: All data objects in row: line-bar-scatter-candle-bubble if not null. + /// All data objects in row: line-bar-scatter-candle-bubble if not null. @objc open var allData: [ChartData] { var data = [ChartData]() @@ -269,8 +269,9 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData /// Get the Entry for a corresponding highlight object /// - /// - parameter highlight: - /// - returns: The entry that is highlighted + /// - Parameters: + /// - highlight: + /// - Returns: The entry that is highlighted open override func entryForHighlight(_ highlight: Highlight) -> ChartDataEntry? { if highlight.dataIndex >= allData.count @@ -299,7 +300,8 @@ open class CombinedChartData: BarLineScatterCandleBubbleChartData /// Get dataset for highlight /// - /// - Parameter highlight: current highlight + /// - Parameters: + /// - highlight: current highlight /// - Returns: dataset related to highlight @objc open func getDataSetByHighlight(_ highlight: Highlight) -> IChartDataSet! { diff --git a/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift index 1b5b106a36..de4a01fe8c 100644 --- a/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/LineChartDataSet.swift @@ -76,7 +76,7 @@ open class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet open var circleColors = [NSUIColor]() - /// - returns: The color at the given index of the DataSet's circle-color array. + /// - Returns: The color at the given index of the DataSet's circle-color array. /// Performs a IndexOutOfBounds check by modulus. open func getCircleColor(atIndex index: Int) -> NSUIColor? { @@ -112,7 +112,7 @@ open class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet /// If true, drawing circles is enabled open var drawCirclesEnabled = true - /// - returns: `true` if drawing circles for this DataSet is enabled, `false` ifnot + /// `true` if drawing circles for this DataSet is enabled, `false` ifnot open var isDrawCirclesEnabled: Bool { return drawCirclesEnabled } /// The color of the inner circle (the circle-hole). @@ -121,7 +121,7 @@ open class LineChartDataSet: LineRadarChartDataSet, ILineChartDataSet /// `true` if drawing circles for this DataSet is enabled, `false` ifnot open var drawCircleHoleEnabled = true - /// - returns: `true` if drawing the circle-holes is enabled, `false` ifnot. + /// `true` if drawing the circle-holes is enabled, `false` ifnot. open var isDrawCircleHoleEnabled: Bool { return drawCircleHoleEnabled } /// This is how much (in pixels) into the dash pattern are we starting from. diff --git a/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift index 50161909e5..54a3af6929 100644 --- a/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/LineRadarChartDataSet.swift @@ -63,7 +63,7 @@ open class LineRadarChartDataSet: LineScatterCandleRadarChartDataSet, ILineRadar /// Please note that this method uses the path clipping for drawing the filled area (with images, gradients and layers). open var drawFilledEnabled = false - /// - returns: `true` if filled drawing is enabled, `false` ifnot + /// `true` if filled drawing is enabled, `false` ifnot open var isDrawFilledEnabled: Bool { return drawFilledEnabled diff --git a/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift index 698fb16629..1c68983bbc 100644 --- a/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/LineScatterCandleRadarChartDataSet.swift @@ -24,10 +24,10 @@ open class LineScatterCandleRadarChartDataSet: BarLineScatterCandleBubbleChartDa /// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. open var drawVerticalHighlightIndicatorEnabled = true - /// - returns: `true` if horizontal highlight indicator lines are enabled (drawn) + /// `true` if horizontal highlight indicator lines are enabled (drawn) open var isHorizontalHighlightIndicatorEnabled: Bool { return drawHorizontalHighlightIndicatorEnabled } - /// - returns: `true` if vertical highlight indicator lines are enabled (drawn) + /// `true` if vertical highlight indicator lines are enabled (drawn) open var isVerticalHighlightIndicatorEnabled: Bool { return drawVerticalHighlightIndicatorEnabled } /// Enables / disables both vertical and horizontal highlight-indicators. diff --git a/Source/Charts/Data/Implementations/Standard/PieChartData.swift b/Source/Charts/Data/Implementations/Standard/PieChartData.swift index b8476492b9..ce6e4b6810 100644 --- a/Source/Charts/Data/Implementations/Standard/PieChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/PieChartData.swift @@ -23,7 +23,7 @@ open class PieChartData: ChartData super.init(dataSets: dataSets) } - /// - returns: All DataSet objects this ChartData object holds. + /// All DataSet objects this ChartData object holds. @objc open override var dataSets: [IChartDataSet] { get @@ -102,7 +102,7 @@ open class PieChartData: ChartData /// Removes the DataSet at the given index in the DataSet array from the data object. /// Also recalculates all minimum and maximum values. /// - /// - returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. + /// - Returns: `true` if a DataSet was removed, `false` ifno DataSet could be removed. open override func removeDataSetByIndex(_ index: Int) -> Bool { if index >= _dataSets.count || index < 0 @@ -113,7 +113,7 @@ open class PieChartData: ChartData return false } - /// - returns: The total y-value sum across all DataSet objects the this object represents. + /// The total y-value sum across all DataSet objects the this object represents. @objc open var yValueSum: Double { guard let dataSet = dataSet else { return 0.0 } diff --git a/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift b/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift index 7777af222b..0907997f03 100644 --- a/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift +++ b/Source/Charts/Data/Implementations/Standard/PieChartDataEntry.swift @@ -19,33 +19,37 @@ open class PieChartDataEntry: ChartDataEntry super.init() } - /// - parameter value: The value on the y-axis - /// - parameter label: The label for the x-axis + /// - Parameters: + /// - value: The value on the y-axis + /// - label: The label for the x-axis @objc public convenience init(value: Double, label: String?) { self.init(value: value, label: label, icon: nil, data: nil) } - /// - parameter value: The value on the y-axis - /// - parameter label: The label for the x-axis - /// - parameter data: Spot for additional data this Entry represents + /// - Parameters: + /// - value: The value on the y-axis + /// - label: The label for the x-axis + /// - data: Spot for additional data this Entry represents @objc public convenience init(value: Double, label: String?, data: AnyObject?) { self.init(value: value, label: label, icon: nil, data: data) } - /// - parameter value: The value on the y-axis - /// - parameter label: The label for the x-axis - /// - parameter icon: icon image + /// - Parameters: + /// - value: The value on the y-axis + /// - label: The label for the x-axis + /// - icon: icon image @objc public convenience init(value: Double, label: String?, icon: NSUIImage?) { self.init(value: value, label: label, icon: icon, data: nil) } - /// - parameter value: The value on the y-axis - /// - parameter label: The label for the x-axis - /// - parameter icon: icon image - /// - parameter data: Spot for additional data this Entry represents + /// - Parameters: + /// - value: The value on the y-axis + /// - label: The label for the x-axis + /// - icon: icon image + /// - data: Spot for additional data this Entry represents @objc public init(value: Double, label: String?, icon: NSUIImage?, data: AnyObject?) { super.init(x: 0.0, y: value, icon: icon, data: data) @@ -53,29 +57,33 @@ open class PieChartDataEntry: ChartDataEntry self.label = label } - /// - parameter value: The value on the y-axis + /// - Parameters: + /// - value: The value on the y-axis @objc public convenience init(value: Double) { self.init(value: value, label: nil, icon: nil, data: nil) } - /// - parameter value: The value on the y-axis - /// - parameter data: Spot for additional data this Entry represents + /// - Parameters: + /// - value: The value on the y-axis + /// - data: Spot for additional data this Entry represents @objc public convenience init(value: Double, data: AnyObject?) { self.init(value: value, label: nil, icon: nil, data: data) } - /// - parameter value: The value on the y-axis - /// - parameter icon: icon image + /// - Parameters: + /// - value: The value on the y-axis + /// - icon: icon image @objc public convenience init(value: Double, icon: NSUIImage?) { self.init(value: value, label: nil, icon: icon, data: nil) } - /// - parameter value: The value on the y-axis - /// - parameter icon: icon image - /// - parameter data: Spot for additional data this Entry represents + /// - Parameters: + /// - value: The value on the y-axis + /// - icon: icon image + /// - data: Spot for additional data this Entry represents @objc public convenience init(value: Double, icon: NSUIImage?, data: AnyObject?) { self.init(value: value, label: nil, icon: icon, data: data) diff --git a/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift b/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift index 9fd5cf1ba1..ac1714afbe 100644 --- a/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift +++ b/Source/Charts/Data/Implementations/Standard/RadarChartDataEntry.swift @@ -19,14 +19,16 @@ open class RadarChartDataEntry: ChartDataEntry super.init() } - /// - parameter value: The value on the y-axis. - /// - parameter data: Spot for additional data this Entry represents. + /// - Parameters: + /// - value: The value on the y-axis. + /// - data: Spot for additional data this Entry represents. @objc public init(value: Double, data: AnyObject?) { super.init(x: 0.0, y: value, data: data) } - /// - parameter value: The value on the y-axis. + /// - Parameters: + /// - value: The value on the y-axis. @objc public convenience init(value: Double) { self.init(value: value, data: nil) diff --git a/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift b/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift index 67b4730a28..5cb4560d62 100644 --- a/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift +++ b/Source/Charts/Data/Implementations/Standard/RadarChartDataSet.swift @@ -40,7 +40,7 @@ open class RadarChartDataSet: LineRadarChartDataSet, IRadarChartDataSet /// **default**: false open var drawHighlightCircleEnabled: Bool = false - /// - returns: `true` if highlight circle should be drawn, `false` ifnot + /// `true` if highlight circle should be drawn, `false` ifnot open var isDrawHighlightCircleEnabled: Bool { return drawHighlightCircleEnabled } open var highlightCircleFillColor: NSUIColor? = NSUIColor.white diff --git a/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift b/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift index ff8ccaf93e..58ee4929d1 100644 --- a/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift +++ b/Source/Charts/Data/Implementations/Standard/ScatterChartData.swift @@ -24,7 +24,7 @@ open class ScatterChartData: BarLineScatterCandleBubbleChartData super.init(dataSets: dataSets) } - /// - returns: The maximum shape-size across all DataSets. + /// - Returns: The maximum shape-size across all DataSets. @objc open func getGreatestShapeSize() -> CGFloat { var max = CGFloat(0.0) diff --git a/Source/Charts/Data/Interfaces/IBarChartDataSet.swift b/Source/Charts/Data/Interfaces/IBarChartDataSet.swift index 6f5cad081c..b90b4dc0c2 100644 --- a/Source/Charts/Data/Interfaces/IBarChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/IBarChartDataSet.swift @@ -19,10 +19,10 @@ public protocol IBarChartDataSet: IBarLineScatterCandleBubbleChartDataSet // MARK: - Styling functions and accessors - /// - returns: `true` if this DataSet is stacked (stacksize > 1) or not. + /// `true` if this DataSet is stacked (stacksize > 1) or not. var isStacked: Bool { get } - /// - returns: The maximum number of bars that can be stacked upon another in this DataSet. + /// 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 diff --git a/Source/Charts/Data/Interfaces/IChartDataSet.swift b/Source/Charts/Data/Interfaces/IChartDataSet.swift index 293db393eb..849da103b7 100644 --- a/Source/Charts/Data/Interfaces/IChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/IChartDataSet.swift @@ -27,64 +27,66 @@ public protocol IChartDataSet /// This is only needed for the autoScaleMinMax feature. func calcMinMaxY(fromX: Double, toX: Double) - /// - returns: The minimum y-value this DataSet holds + /// The minimum y-value this DataSet holds var yMin: Double { get } - /// - returns: The maximum y-value this DataSet holds + /// The maximum y-value this DataSet holds var yMax: Double { get } - /// - returns: The minimum x-value this DataSet holds + /// The minimum x-value this DataSet holds var xMin: Double { get } - /// - returns: The maximum x-value this DataSet holds + /// The maximum x-value this DataSet holds var xMax: Double { get } - /// - returns: The number of y-values this DataSet represents + /// The number of y-values this DataSet represents var entryCount: Int { get } - /// - returns: The entry object found at the given index (not x-value!) - /// - throws: out of bounds + /// - 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? - /// - returns: The first Entry object found at the given x-value with binary search. + /// - 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. - /// - parameter xValue: the x-value - /// - parameter closestToY: If there are multiple y-values for the specified x-value, - /// - parameter rounding: determine whether to round up/down/closest if there is no Entry matching the provided x-value func entryForXValue( _ xValue: Double, closestToY yValue: Double, rounding: ChartDataSetRounding) -> ChartDataEntry? - /// - returns: The first Entry object found at the given x-value with binary search. + /// - 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. - /// - parameter xValue: the x-value - /// - parameter closestToY: If there are multiple y-values for the specified x-value, func entryForXValue( _ xValue: Double, closestToY yValue: Double) -> ChartDataEntry? - /// - returns: All Entry objects found at the given x-value with binary search. + /// - 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] - /// - returns: The array-index of the specified entry. + /// - 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. - /// - /// - parameter xValue: x-value of the entry to search for - /// - parameter closestToY: If there are multiple y-values for the specified x-value, - /// - parameter rounding: Rounding method if exact value was not found func entryIndex( x xValue: Double, closestToY yValue: Double, rounding: ChartDataSetRounding) -> Int - /// - returns: The array-index of the specified entry - /// - /// - parameter e: the entry to search for + /// - 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. @@ -92,8 +94,10 @@ public protocol IChartDataSet /// *optional feature, can return `false` ifnot implemented* /// /// Entries are added to the end of the list. - /// - parameter e: the entry to add - /// - returns: `true` if the entry was added successfully, `false` ifthis feature is not supported + /// + /// - 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. @@ -103,51 +107,56 @@ public protocol IChartDataSet /// *optional feature, can return `false` ifnot implemented* /// /// Entries are added to the end of the list. - /// - parameter e: the entry to add - /// - returns: `true` if the entry was added successfully, `false` ifthis feature is not supported + /// + /// - 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* /// - /// - parameter 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 + /// - 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* /// - /// - parameter 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 + /// - 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* /// - /// - parameter 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 + /// - 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 + /// - 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 + /// - 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. + /// - Returns: `true` if contains the entry, `false` ifnot. func contains(_ e: ChartDataEntry) -> Bool /// Removes all values from this DataSet and does all necessary recalculations. @@ -170,7 +179,7 @@ public protocol IChartDataSet /// 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. + /// - 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 @@ -183,13 +192,13 @@ public protocol IChartDataSet /// if true, value highlighting is enabled var highlightEnabled: Bool { get set } - /// - returns: `true` if value highlighting is enabled for this dataset + /// `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: IValueFormatter? { get set } - /// - returns: `true` if the valueFormatter object of this DataSet is null. + /// `true` if the valueFormatter object of this DataSet is null. var needsFormatter: Bool { get } /// Sets/get a single color for value text. @@ -197,7 +206,7 @@ public protocol IChartDataSet /// 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. + /// - 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 @@ -232,15 +241,15 @@ public protocol IChartDataSet /// 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. + /// - 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 } - /// - returns: `true` if y-value drawing is enabled, `false` ifnot + /// `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. + /// - 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 @@ -256,6 +265,6 @@ public protocol IChartDataSet /// 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 } - /// - returns: `true` if this DataSet is visible inside the chart, or `false` ifit is currently hidden. + /// `true` if this DataSet is visible inside the chart, or `false` ifit is currently hidden. var isVisible: Bool { get } } diff --git a/Source/Charts/Data/Interfaces/ILineChartDataSet.swift b/Source/Charts/Data/Interfaces/ILineChartDataSet.swift index bc9e484907..071f269535 100644 --- a/Source/Charts/Data/Interfaces/ILineChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/ILineChartDataSet.swift @@ -38,7 +38,7 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet var circleColors: [NSUIColor] { get set } - /// - returns: The color at the given index of the DataSet's circle-color array. + /// - 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? @@ -52,7 +52,7 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet /// If true, drawing circles is enabled var drawCirclesEnabled: Bool { get set } - /// - returns: `true` if drawing circles for this DataSet is enabled, `false` ifnot + /// `true` if drawing circles for this DataSet is enabled, `false` ifnot var isDrawCirclesEnabled: Bool { get } /// The color of the inner circle (the circle-hole). @@ -61,7 +61,7 @@ public protocol ILineChartDataSet: ILineRadarChartDataSet /// `true` if drawing circles for this DataSet is enabled, `false` ifnot var drawCircleHoleEnabled: Bool { get set } - /// - returns: `true` if drawing the circle-holes is enabled, `false` ifnot. + /// `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. diff --git a/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift b/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift index b53a5337fa..d9f8980b47 100644 --- a/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/ILineRadarChartDataSet.swift @@ -22,7 +22,7 @@ public protocol ILineRadarChartDataSet: ILineScatterCandleRadarChartDataSet /// 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. + /// - Returns: The object that is used for filling the area below the line. /// **default**: nil var fill: Fill? { get set } @@ -40,6 +40,6 @@ public protocol ILineRadarChartDataSet: ILineScatterCandleRadarChartDataSet /// Please note that this method uses the path clipping for drawing the filled area (with images, gradients and layers). var drawFilledEnabled: Bool { get set } - /// - returns: `true` if filled drawing is enabled, `false` if not + /// `true` if filled drawing is enabled, `false` if not var isDrawFilledEnabled: Bool { get } } diff --git a/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift b/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift index cf646a1b56..27c2bca944 100644 --- a/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/ILineScatterCandleRadarChartDataSet.swift @@ -24,10 +24,10 @@ public protocol ILineScatterCandleRadarChartDataSet: IBarLineScatterCandleBubble /// Enables / disables the vertical highlight-indicator. If disabled, the indicator is not drawn. var drawVerticalHighlightIndicatorEnabled: Bool { get set } - /// - returns: `true` if horizontal highlight indicator lines are enabled (drawn) + /// `true` if horizontal highlight indicator lines are enabled (drawn) var isHorizontalHighlightIndicatorEnabled: Bool { get } - /// - returns: `true` if vertical highlight indicator lines are enabled (drawn) + /// `true` if vertical highlight indicator lines are enabled (drawn) var isVerticalHighlightIndicatorEnabled: Bool { get } /// Enables / disables both vertical and horizontal highlight-indicators. diff --git a/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift b/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift index 5703f07d00..0565146725 100644 --- a/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift +++ b/Source/Charts/Data/Interfaces/IScatterChartDataSet.swift @@ -19,18 +19,18 @@ public protocol IScatterChartDataSet: ILineScatterCandleRadarChartDataSet // MARK: - Styling functions and accessors - /// - returns: The size the scatter shape will have + /// 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) + /// - 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. + /// - Returns: Color for the hole in the shape. Setting to `nil` will behave as transparent. /// **default**: nil var scatterShapeHoleColor: NSUIColor? { get } - /// - returns: The IShapeRenderer responsible for rendering this DataSet. + /// The IShapeRenderer responsible for rendering this DataSet. var shapeRenderer: IShapeRenderer? { get } } diff --git a/Source/Charts/Filters/DataApproximator.swift b/Source/Charts/Filters/DataApproximator.swift index 6cd5338ff7..01c1d9fb4a 100644 --- a/Source/Charts/Filters/DataApproximator.swift +++ b/Source/Charts/Filters/DataApproximator.swift @@ -52,10 +52,11 @@ open class DataApproximator: NSObject /// apply the Douglas-Peucker-Reduction to an array of `CGPoint`s with a given tolerance /// - /// - parameter points: - /// - parameter tolerance: - /// - parameter start: - /// - parameter end: + /// - Parameters: + /// - points: + /// - tolerance: + /// - start: + /// - end: open class func reduceWithDouglasPeuker( points: [CGPoint], tolerance: CGFloat, diff --git a/Source/Charts/Formatters/IAxisValueFormatter.swift b/Source/Charts/Formatters/IAxisValueFormatter.swift index 9634334cb5..302eee18f8 100644 --- a/Source/Charts/Formatters/IAxisValueFormatter.swift +++ b/Source/Charts/Formatters/IAxisValueFormatter.swift @@ -20,10 +20,10 @@ public protocol IAxisValueFormatter: class /// /// For performance reasons, avoid excessive calculations and memory allocations inside this method. /// - /// - returns: The customized label that is drawn on the x-axis. - /// - parameter value: the value that is currently being drawn - /// - parameter axis: the axis that the value belongs to - /// + /// - 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 diff --git a/Source/Charts/Formatters/IFillFormatter.swift b/Source/Charts/Formatters/IFillFormatter.swift index 8a88500299..7b684fd84e 100644 --- a/Source/Charts/Formatters/IFillFormatter.swift +++ b/Source/Charts/Formatters/IFillFormatter.swift @@ -16,6 +16,6 @@ import CoreGraphics @objc(IChartFillFormatter) public protocol IFillFormatter { - /// - returns: The vertical (y-axis) position where the filled-line of the LineDataSet should end. + /// - Returns: The vertical (y-axis) position where the filled-line of the LineDataSet should end. func getFillLinePosition(dataSet: ILineChartDataSet, dataProvider: LineChartDataProvider) -> CGFloat } diff --git a/Source/Charts/Formatters/IValueFormatter.swift b/Source/Charts/Formatters/IValueFormatter.swift index 5aae95b2a1..53ca7a40c2 100644 --- a/Source/Charts/Formatters/IValueFormatter.swift +++ b/Source/Charts/Formatters/IValueFormatter.swift @@ -24,14 +24,11 @@ public protocol IValueFormatter: class /// /// For performance reasons, avoid excessive calculations and memory allocations inside this method. /// - /// - returns: The formatted label ready to be drawn - /// - /// - parameter value: The value to be formatted - /// - /// - parameter dataSetIndex: The index of the DataSet the entry in focus belongs to - /// - /// - parameter viewPortHandler: provides information about the current chart state (scale, translation, ...) - /// + /// - 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, diff --git a/Source/Charts/Highlight/BarHighlighter.swift b/Source/Charts/Highlight/BarHighlighter.swift index 2bb81a2a33..3500955ee5 100644 --- a/Source/Charts/Highlight/BarHighlighter.swift +++ b/Source/Charts/Highlight/BarHighlighter.swift @@ -49,11 +49,13 @@ open class BarHighlighter: ChartHighlighter } /// This method creates the Highlight object that also indicates which value of a stacked BarEntry has been selected. - /// - parameter high: the Highlight to work with looking for stacked values - /// - parameter set: - /// - parameter xIndex: - /// - parameter yValue: - /// - returns: + /// + /// - Parameters: + /// - high: the Highlight to work with looking for stacked values + /// - set: + /// - xIndex: + /// - yValue: + /// - Returns: @objc open func getStackedHighlight(high: Highlight, set: IBarChartDataSet, xValue: Double, @@ -89,10 +91,10 @@ open class BarHighlighter: ChartHighlighter axis: high.axis) } - /// - returns: The index of the closest value inside the values array / ranges (stacked barchart) to the value given as a parameter. - /// - parameter entry: - /// - parameter value: - /// - returns: + /// - Parameters: + /// - entry: + /// - value: + /// - Returns: The index of the closest value inside the values array / ranges (stacked barchart) to the value given as a parameter. @objc open func getClosestStackIndex(ranges: [Range]?, value: Double) -> Int { guard let ranges = ranges else { return 0 } diff --git a/Source/Charts/Highlight/ChartHighlighter.swift b/Source/Charts/Highlight/ChartHighlighter.swift index 3fe679f20d..6ce94a9b75 100644 --- a/Source/Charts/Highlight/ChartHighlighter.swift +++ b/Source/Charts/Highlight/ChartHighlighter.swift @@ -28,9 +28,9 @@ open class ChartHighlighter : NSObject, IHighlighter return getHighlight(xValue: xVal, x: x, y: y) } - /// - returns: The corresponding x-pos for a given touch-position in pixels. - /// - parameter x: - /// - returns: + /// - Parameters: + /// - x: + /// - Returns: The corresponding x-pos for a given touch-position in pixels. @objc open func getValsForTouch(x: CGFloat, y: CGFloat) -> CGPoint { guard let chart = self.chart as? BarLineScatterCandleBubbleChartDataProvider else { return .zero } @@ -39,11 +39,11 @@ open class ChartHighlighter : NSObject, IHighlighter return chart.getTransformer(forAxis: .left).valueForTouchPoint(x: x, y: y) } - /// - returns: The corresponding ChartHighlight for a given x-value and xy-touch position in pixels. - /// - parameter xValue: - /// - parameter x: - /// - parameter y: - /// - returns: + /// - Parameters: + /// - xValue: + /// - x: + /// - y: + /// - Returns: The corresponding ChartHighlight for a given x-value and xy-touch position in pixels. @objc open func getHighlight(xValue xVal: Double, x: CGFloat, y: CGFloat) -> Highlight? { guard let chart = chart else { return nil } @@ -61,12 +61,12 @@ open class ChartHighlighter : NSObject, IHighlighter return detail } - /// - returns: A list of Highlight objects representing the entries closest to the given xVal. + /// - Parameters: + /// - xValue: the transformed x-value of the x-touch position + /// - x: touch position + /// - y: touch position + /// - Returns: A list of Highlight objects representing the entries closest to the given xVal. /// The returned list contains two objects per DataSet (closest rounding up, closest rounding down). - /// - parameter xValue: the transformed x-value of the x-touch position - /// - parameter x: touch position - /// - parameter y: touch position - /// - returns: @objc open func getHighlights(xValue: Double, x: CGFloat, y: CGFloat) -> [Highlight] { var vals = [Highlight]() @@ -89,7 +89,7 @@ open class ChartHighlighter : NSObject, IHighlighter return vals } - /// - returns: An array of `Highlight` objects corresponding to the selected xValue and dataSetIndex. + /// - Returns: An array of `Highlight` objects corresponding to the selected xValue and dataSetIndex. internal func buildHighlights( dataSet set: IChartDataSet, dataSetIndex: Int, @@ -120,7 +120,7 @@ open class ChartHighlighter : NSObject, IHighlighter // - MARK: - Utilities - /// - returns: The `ChartHighlight` of the closest value on the x-y cartesian axes + /// - Returns: The `ChartHighlight` of the closest value on the x-y cartesian axes internal func closestSelectionDetailByPixel( closestValues: [Highlight], x: CGFloat, @@ -148,7 +148,7 @@ open class ChartHighlighter : NSObject, IHighlighter return closest } - /// - returns: The minimum distance from a touch-y-value (in pixels) to the closest y-value (in pixels) that is displayed in the chart. + /// - Returns: The minimum distance from a touch-y-value (in pixels) to the closest y-value (in pixels) that is displayed in the chart. internal func getMinimumDistance( closestValues: [Highlight], y: CGFloat, diff --git a/Source/Charts/Highlight/Highlight.swift b/Source/Charts/Highlight/Highlight.swift index e036b08464..d1692d3fbb 100644 --- a/Source/Charts/Highlight/Highlight.swift +++ b/Source/Charts/Highlight/Highlight.swift @@ -52,14 +52,15 @@ open class Highlight: NSObject super.init() } - /// - parameter x: the x-value of the highlighted value - /// - parameter y: the y-value of the highlighted value - /// - parameter xPx: the x-pixel of the highlighted value - /// - parameter yPx: the y-pixel of the highlighted value - /// - parameter dataIndex: the index of the Data the highlighted value belongs to - /// - parameter dataSetIndex: the index of the DataSet the highlighted value belongs to - /// - parameter stackIndex: references which value of a stacked-bar entry has been selected - /// - parameter axis: the axis the highlighted value belongs to + /// - Parameters: + /// - x: the x-value of the highlighted value + /// - y: the y-value of the highlighted value + /// - xPx: the x-pixel of the highlighted value + /// - yPx: the y-pixel of the highlighted value + /// - dataIndex: the index of the Data the highlighted value belongs to + /// - dataSetIndex: the index of the DataSet the highlighted value belongs to + /// - stackIndex: references which value of a stacked-bar entry has been selected + /// - axis: the axis the highlighted value belongs to @objc public init( x: Double, y: Double, xPx: CGFloat, yPx: CGFloat, @@ -80,13 +81,14 @@ open class Highlight: NSObject _axis = axis } - /// - parameter x: the x-value of the highlighted value - /// - parameter y: the y-value of the highlighted value - /// - parameter xPx: the x-pixel of the highlighted value - /// - parameter yPx: the y-pixel of the highlighted value - /// - parameter dataSetIndex: the index of the DataSet the highlighted value belongs to - /// - parameter stackIndex: references which value of a stacked-bar entry has been selected - /// - parameter axis: the axis the highlighted value belongs to + /// - Parameters: + /// - x: the x-value of the highlighted value + /// - y: the y-value of the highlighted value + /// - xPx: the x-pixel of the highlighted value + /// - yPx: the y-pixel of the highlighted value + /// - dataSetIndex: the index of the DataSet the highlighted value belongs to + /// - stackIndex: references which value of a stacked-bar entry has been selected + /// - axis: the axis the highlighted value belongs to @objc public convenience init( x: Double, y: Double, xPx: CGFloat, yPx: CGFloat, @@ -101,14 +103,15 @@ open class Highlight: NSObject axis: axis) } - /// - parameter x: the x-value of the highlighted value - /// - parameter y: the y-value of the highlighted value - /// - parameter xPx: the x-pixel of the highlighted value - /// - parameter yPx: the y-pixel of the highlighted value - /// - parameter dataIndex: the index of the Data the highlighted value belongs to - /// - parameter dataSetIndex: the index of the DataSet the highlighted value belongs to - /// - parameter stackIndex: references which value of a stacked-bar entry has been selected - /// - parameter axis: the axis the highlighted value belongs to + /// - Parameters: + /// - x: the x-value of the highlighted value + /// - y: the y-value of the highlighted value + /// - xPx: the x-pixel of the highlighted value + /// - yPx: the y-pixel of the highlighted value + /// - dataIndex: the index of the Data the highlighted value belongs to + /// - dataSetIndex: the index of the DataSet the highlighted value belongs to + /// - stackIndex: references which value of a stacked-bar entry has been selected + /// - axis: the axis the highlighted value belongs to @objc public init( x: Double, y: Double, xPx: CGFloat, yPx: CGFloat, @@ -125,10 +128,11 @@ open class Highlight: NSObject _axis = axis } - /// - parameter x: the x-value of the highlighted value - /// - parameter y: the y-value of the highlighted value - /// - parameter dataSetIndex: the index of the DataSet the highlighted value belongs to - /// - parameter dataIndex: The data index to search in (only used in CombinedChartView currently) + /// - Parameters: + /// - x: the x-value of the highlighted value + /// - y: the y-value of the highlighted value + /// - dataSetIndex: the index of the DataSet the highlighted value belongs to + /// - dataIndex: The data index to search in (only used in CombinedChartView currently) @objc public init(x: Double, y: Double, dataSetIndex: Int, dataIndex: Int = -1) { _x = x @@ -137,9 +141,10 @@ open class Highlight: NSObject self.dataIndex = dataIndex } - /// - parameter x: the x-value of the highlighted value - /// - parameter dataSetIndex: the index of the DataSet the highlighted value belongs to - /// - parameter stackIndex: references which value of a stacked-bar entry has been selected + /// - Parameters: + /// - x: the x-value of the highlighted value + /// - dataSetIndex: the index of the DataSet the highlighted value belongs to + /// - stackIndex: references which value of a stacked-bar entry has been selected @objc public convenience init(x: Double, dataSetIndex: Int, stackIndex: Int) { self.init(x: x, y: Double.nan, dataSetIndex: dataSetIndex) diff --git a/Source/Charts/Highlight/IHighlighter.swift b/Source/Charts/Highlight/IHighlighter.swift index 56acfcc226..21ae298c34 100644 --- a/Source/Charts/Highlight/IHighlighter.swift +++ b/Source/Charts/Highlight/IHighlighter.swift @@ -15,9 +15,9 @@ import CoreGraphics @objc(IChartHighlighter) public protocol IHighlighter: class { - /// - returns: A Highlight object corresponding to the given x- and y- touch positions in pixels. - /// - parameter x: - /// - parameter y: - /// - returns: + /// - 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? } diff --git a/Source/Charts/Highlight/PieRadarHighlighter.swift b/Source/Charts/Highlight/PieRadarHighlighter.swift index ec77e72f5b..c55988ab31 100644 --- a/Source/Charts/Highlight/PieRadarHighlighter.swift +++ b/Source/Charts/Highlight/PieRadarHighlighter.swift @@ -49,10 +49,11 @@ open class PieRadarHighlighter: ChartHighlighter } - /// - returns: The closest Highlight object of the given objects based on the touch position inside the chart. - /// - parameter index: - /// - parameter x: - /// - parameter y: + /// - Parameters: + /// - index: + /// - x: + /// - y: + /// - Returns: The closest Highlight object of the given objects based on the touch position inside the chart. @objc open func closestHighlight(index: Int, x: CGFloat, y: CGFloat) -> Highlight? { fatalError("closestHighlight(index, x, y) cannot be called on PieRadarChartHighlighter") diff --git a/Source/Charts/Highlight/RadarHighlighter.swift b/Source/Charts/Highlight/RadarHighlighter.swift index d54193c2f8..cfaf57aec9 100644 --- a/Source/Charts/Highlight/RadarHighlighter.swift +++ b/Source/Charts/Highlight/RadarHighlighter.swift @@ -39,10 +39,10 @@ open class RadarHighlighter: PieRadarHighlighter return closest } - /// - returns: An array of Highlight objects for the given index. + /// - Parameters: + /// - index: + /// - Returns: An array of Highlight objects for the given index. /// The Highlight objects give information about the value at the selected index and DataSet it belongs to. - /// - /// - parameter index: internal func getHighlights(forIndex index: Int) -> [Highlight] { var vals = [Highlight]() diff --git a/Source/Charts/Highlight/Range.swift b/Source/Charts/Highlight/Range.swift index 1585869ff0..4b7ead10fb 100644 --- a/Source/Charts/Highlight/Range.swift +++ b/Source/Charts/Highlight/Range.swift @@ -25,8 +25,9 @@ open class Range: NSObject super.init() } - /// - returns: `true` if this range contains (if the value is in between) the given value, `false` ifnot. - /// - parameter value: + /// - Parameters: + /// - value: + /// - Returns: `true` if this range contains (if the value is in between) the given value, `false` ifnot. @objc open func contains(_ value: Double) -> Bool { if value > from && value <= to diff --git a/Source/Charts/Interfaces/ChartDataProvider.swift b/Source/Charts/Interfaces/ChartDataProvider.swift index 99619331c0..531f04b750 100644 --- a/Source/Charts/Interfaces/ChartDataProvider.swift +++ b/Source/Charts/Interfaces/ChartDataProvider.swift @@ -15,16 +15,16 @@ import CoreGraphics @objc public protocol ChartDataProvider { - /// - returns: The minimum x-value of the chart, regardless of zoom or translation. + /// The minimum x-value of the chart, regardless of zoom or translation. var chartXMin: Double { get } - /// - returns: The maximum x-value of the chart, regardless of zoom or translation. + /// The maximum x-value of the chart, regardless of zoom or translation. var chartXMax: Double { get } - /// - returns: The minimum y-value of the chart, regardless of zoom or translation. + /// The minimum y-value of the chart, regardless of zoom or translation. var chartYMin: Double { get } - /// - returns: The maximum y-value of the chart, regardless of zoom or translation. + /// The maximum y-value of the chart, regardless of zoom or translation. var chartYMax: Double { get } var maxHighlightDistance: CGFloat { get } @@ -36,4 +36,4 @@ public protocol ChartDataProvider var data: ChartData? { get } var maxVisibleCount: Int { get } -} \ No newline at end of file +} diff --git a/Source/Charts/Renderers/AxisRendererBase.swift b/Source/Charts/Renderers/AxisRendererBase.swift index 15a9206e51..302bdf5312 100644 --- a/Source/Charts/Renderers/AxisRendererBase.swift +++ b/Source/Charts/Renderers/AxisRendererBase.swift @@ -54,8 +54,10 @@ open class AxisRendererBase: Renderer } /// 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 + /// + /// - 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 diff --git a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift index 4ba1b5fac7..39acdb00ed 100644 --- a/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift +++ b/Source/Charts/Renderers/BarLineScatterCandleBubbleRenderer.swift @@ -38,7 +38,7 @@ open class BarLineScatterCandleBubbleRenderer: DataRenderer return XBounds(chart: chart, dataSet: dataSet, animator: animator) } - /// - returns: `true` if the DataSet values should be drawn, `false` if not. + /// - Returns: `true` if the DataSet values should be drawn, `false` if not. internal func shouldDrawValues(forDataSet set: IChartDataSet) -> Bool { return set.isVisible && (set.isDrawValuesEnabled || set.isDrawIconsEnabled) diff --git a/Source/Charts/Renderers/ChartDataRendererBase.swift b/Source/Charts/Renderers/ChartDataRendererBase.swift index da4fd67af2..68905ff50a 100644 --- a/Source/Charts/Renderers/ChartDataRendererBase.swift +++ b/Source/Charts/Renderers/ChartDataRendererBase.swift @@ -50,7 +50,8 @@ open class DataRenderer: Renderer /// Draws all highlight indicators for the values that are currently highlighted. /// - /// - parameter indices: the highlighted values + /// - Parameters: + /// - indices: the highlighted values @objc open func drawHighlighted(context: CGContext, indices: [Highlight]) { fatalError("drawHighlighted() cannot be called on DataRenderer") diff --git a/Source/Charts/Renderers/CombinedChartRenderer.swift b/Source/Charts/Renderers/CombinedChartRenderer.swift index bc80bd0a34..0e2bb0d0b7 100644 --- a/Source/Charts/Renderers/CombinedChartRenderer.swift +++ b/Source/Charts/Renderers/CombinedChartRenderer.swift @@ -168,7 +168,7 @@ open class CombinedChartRenderer: DataRenderer } } - /// - returns: The sub-renderer object at the specified index. + /// - Returns: The sub-renderer object at the specified index. @objc open func getSubRenderer(index: Int) -> DataRenderer? { if index >= _renderers.count || index < 0 @@ -181,7 +181,7 @@ open class CombinedChartRenderer: DataRenderer } } - /// - returns: All sub-renderers. + /// All sub-renderers. @objc open var subRenderers: [DataRenderer] { get { return _renderers } @@ -190,10 +190,10 @@ open class CombinedChartRenderer: DataRenderer // MARK: Accessors - /// - returns: `true` if drawing values above bars is enabled, `false` ifnot + /// `true` if drawing values above bars is enabled, `false` ifnot @objc open var isDrawValueAboveBarEnabled: Bool { return drawValueAboveBarEnabled } - /// - returns: `true` if drawing shadows (maxvalue) for each bar is enabled, `false` ifnot + /// `true` if drawing shadows (maxvalue) for each bar is enabled, `false` ifnot @objc open var isDrawBarShadowEnabled: Bool { return drawBarShadowEnabled } /// the order in which the provided data objects should be drawn. diff --git a/Source/Charts/Renderers/RadarChartRenderer.swift b/Source/Charts/Renderers/RadarChartRenderer.swift index a535cfd5d1..0177bb0377 100644 --- a/Source/Charts/Renderers/RadarChartRenderer.swift +++ b/Source/Charts/Renderers/RadarChartRenderer.swift @@ -76,9 +76,10 @@ open class RadarChartRenderer: LineRadarRenderer /// Draws the RadarDataSet /// - /// - parameter context: - /// - parameter dataSet: - /// - parameter mostEntries: the entry count of the dataset with the most entries + /// - Parameters: + /// - context: + /// - dataSet: + /// - mostEntries: the entry count of the dataset with the most entries internal func drawDataSet(context: CGContext, dataSet: IRadarChartDataSet, mostEntries: Int) { guard let chart = chart else { return } diff --git a/Source/Charts/Renderers/Scatter/IShapeRenderer.swift b/Source/Charts/Renderers/Scatter/IShapeRenderer.swift index bb12d9824a..ff12ee3fb2 100644 --- a/Source/Charts/Renderers/Scatter/IShapeRenderer.swift +++ b/Source/Charts/Renderers/Scatter/IShapeRenderer.swift @@ -17,11 +17,12 @@ public protocol IShapeRenderer: class { /// Renders the provided ScatterDataSet with a shape. /// - /// - parameter context: CGContext for drawing on - /// - parameter dataSet: The DataSet to be drawn - /// - parameter viewPortHandler: Contains information about the current state of the view - /// - parameter point: Position to draw the shape at - /// - parameter color: Color to draw the 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: IScatterChartDataSet, diff --git a/Source/Charts/Utils/ChartUtils.swift b/Source/Charts/Utils/ChartUtils.swift index 741b9b3859..25ccfde3db 100644 --- a/Source/Charts/Utils/ChartUtils.swift +++ b/Source/Charts/Utils/ChartUtils.swift @@ -36,8 +36,8 @@ extension FloatingPoint return self * 180 / .pi } - /// - returns: An angle between 0.0 < 360.0 (not less than zero, less than 360) - /// NOTE: Value must be in degrees + /// - Note: Value must be in degrees + /// - Returns: An angle between 0.0 < 360.0 (not less than zero, less than 360) var normalizedAngle: Self { let angle = truncatingRemainder(dividingBy: 360) @@ -288,7 +288,7 @@ open class ChartUtils return formatter } - /// - returns: The default value formatter used for all chart components that needs a default + /// - Returns: The default value formatter used for all chart components that needs a default open class func defaultValueFormatter() -> IValueFormatter { return _defaultValueFormatter diff --git a/Source/Charts/Utils/Platform+Accessibility.swift b/Source/Charts/Utils/Platform+Accessibility.swift index 675bc255ab..85f0a17315 100644 --- a/Source/Charts/Utils/Platform+Accessibility.swift +++ b/Source/Charts/Utils/Platform+Accessibility.swift @@ -179,7 +179,7 @@ open class NSUIAccessibilityElement: NSAccessibilityElement } } -/// NOTE: setAccessibilityRole(.list) is called at init. See Platform.swift. +/// - Note: setAccessibilityRole(.list) is called at init. See Platform.swift. extension NSUIView: NSAccessibilityGroup { open override func accessibilityLabel() -> String? diff --git a/Source/Charts/Utils/Transformer.swift b/Source/Charts/Utils/Transformer.swift index ca99fb2360..86f05ea909 100644 --- a/Source/Charts/Utils/Transformer.swift +++ b/Source/Charts/Utils/Transformer.swift @@ -150,7 +150,7 @@ open class Transformer: NSObject pixel = pixel.applying(pixelToValueMatrix) } - /// - returns: The x and y values in the chart at the given touch point + /// - Returns: The x and y values in the chart at the given touch point /// (encapsulated in a CGPoint). This method transforms pixel coordinates to /// coordinates / values in the chart. @objc open func valueForTouchPoint(_ point: CGPoint) -> CGPoint @@ -158,7 +158,7 @@ open class Transformer: NSObject return point.applying(pixelToValueMatrix) } - /// - returns: The x and y values in the chart at the given touch point + /// - Returns: The x and y values in the chart at the given touch point /// (x/y). This method transforms pixel coordinates to /// coordinates / values in the chart. @objc open func valueForTouchPoint(x: CGFloat, y: CGFloat) -> CGPoint diff --git a/Source/Charts/Utils/ViewPortHandler.swift b/Source/Charts/Utils/ViewPortHandler.swift index 4fde6eca50..56e034b418 100755 --- a/Source/Charts/Utils/ViewPortHandler.swift +++ b/Source/Charts/Utils/ViewPortHandler.swift @@ -443,49 +443,49 @@ open class ViewPortHandler: NSObject return (_contentRect.origin.y + _contentRect.size.height) >= normalizedY } - /// - returns: The current x-scale factor + /// The current x-scale factor @objc open var scaleX: CGFloat { return _scaleX } - /// - returns: The current y-scale factor + /// The current y-scale factor @objc open var scaleY: CGFloat { return _scaleY } - /// - returns: The minimum x-scale factor + /// The minimum x-scale factor @objc open var minScaleX: CGFloat { return _minScaleX } - /// - returns: The minimum y-scale factor + /// The minimum y-scale factor @objc open var minScaleY: CGFloat { return _minScaleY } - /// - returns: The minimum x-scale factor + /// The minimum x-scale factor @objc open var maxScaleX: CGFloat { return _maxScaleX } - /// - returns: The minimum y-scale factor + /// The minimum y-scale factor @objc open var maxScaleY: CGFloat { return _maxScaleY } - /// - returns: The translation (drag / pan) distance on the x-axis + /// The translation (drag / pan) distance on the x-axis @objc open var transX: CGFloat { return _transX } - /// - returns: The translation (drag / pan) distance on the y-axis + /// The translation (drag / pan) distance on the y-axis @objc open var transY: CGFloat { return _transY @@ -497,13 +497,13 @@ open class ViewPortHandler: NSObject return isFullyZoomedOutX && isFullyZoomedOutY } - /// - returns: `true` if the chart is fully zoomed out on it's y-axis (vertical). + /// `true` if the chart is fully zoomed out on it's y-axis (vertical). @objc open var isFullyZoomedOutY: Bool { return !(_scaleY > _minScaleY || _minScaleY > 1.0) } - /// - returns: `true` if the chart is fully zoomed out on it's x-axis (horizontal). + /// `true` if the chart is fully zoomed out on it's x-axis (horizontal). @objc open var isFullyZoomedOutX: Bool { return !(_scaleX > _minScaleX || _minScaleX > 1.0) @@ -521,31 +521,31 @@ open class ViewPortHandler: NSObject _transOffsetY = offset } - /// - returns: `true` if both drag offsets (x and y) are zero or smaller. + /// `true` if both drag offsets (x and y) are zero or smaller. @objc open var hasNoDragOffset: Bool { return _transOffsetX <= 0.0 && _transOffsetY <= 0.0 } - /// - returns: `true` if the chart is not yet fully zoomed out on the x-axis + /// `true` if the chart is not yet fully zoomed out on the x-axis @objc open var canZoomOutMoreX: Bool { return _scaleX > _minScaleX } - /// - returns: `true` if the chart is not yet fully zoomed in on the x-axis + /// `true` if the chart is not yet fully zoomed in on the x-axis @objc open var canZoomInMoreX: Bool { return _scaleX < _maxScaleX } - /// - returns: `true` if the chart is not yet fully zoomed out on the y-axis + /// `true` if the chart is not yet fully zoomed out on the y-axis @objc open var canZoomOutMoreY: Bool { return _scaleY > _minScaleY } - /// - returns: `true` if the chart is not yet fully zoomed in on the y-axis + /// `true` if the chart is not yet fully zoomed in on the y-axis @objc open var canZoomInMoreY: Bool { return _scaleY < _maxScaleY