SChartCrosshairLineDrawer

@protocol SChartCrosshairLineDrawer <NSObject>

Protocol defining how crosshair lines (cross lines and data point center) are drawn

  • Responsible for creating a UIBezierPath for the lines of the crosshair.

    Declaration

    Objective-C

    - (nonnull UIBezierPath *)
     drawLinesForCrosshair:(CGRect)plotAreaFrame
                    series:(nullable SChartMappedSeries *)series
    trackedDataPointCenter:(CGPoint)trackedDataPointCenter
                     xAxis:(nonnull SChartAxis *)xAxis
                     yAxis:(nonnull SChartAxis *)yAxis;

    Swift

    func drawLines(forCrosshair plotAreaFrame: CGRect, series: SChartMappedSeries?, trackedDataPointCenter: CGPoint, xAxis: SChartAxis, yAxis: SChartAxis) -> UIBezierPath

    Parameters

    plotAreaFrame

    The frame of the plot area.

    series

    The series being tracked by the crosshair.

    trackedDataPointCenter

    The center of the tracked data point.

    xAxis

    The x-axis associated with the series.

    yAxis

    The y-axis associated with the series.

  • Responsible for creating a UIBezierPath for the ellipses of the crosshair.

    Declaration

    Objective-C

    - (nonnull UIBezierPath *)drawEllipseForCrosshair:
        (CGPoint)trackedDataPointCenter;

    Swift

    func drawEllipse(forCrosshair trackedDataPointCenter: CGPoint) -> UIBezierPath

    Parameters

    trackedDataPointCenter

    The center of the tracked data point.