Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update document to latest format #3621

Merged
merged 10 commits into from
Nov 7, 2018
60 changes: 38 additions & 22 deletions Source/Charts/Animation/Animator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -169,39 +171,47 @@ 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))
}

/// 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)
}

/// 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))
}

/// 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()
Expand All @@ -225,17 +235,21 @@ 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))
}

/// 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()
Expand All @@ -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))
Expand Down
24 changes: 13 additions & 11 deletions Source/Charts/Charts/BarChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -128,9 +129,10 @@ 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))
Expand Down Expand Up @@ -168,16 +170,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
liuxuan30 marked this conversation as resolved.
Show resolved Hide resolved
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 }
}
Loading