SChartSeriesCrosshairTooltip Class Reference

Inherits from SChartCrosshairMultiValueTooltip : SChartCrosshairTooltip : UIView
Declared in SChartSeriesCrosshairTooltip.h
Availability Standard
Premium
Related samples

Overview

An extension of SChartCrosshairMultiValueTooltip, this tooltip adds a caret that points in the direction of the current tracked datapoint and sets its background color to be the same as that of the current tracked series.

When the series goes beyond the plot area’s bounds (the view within which the series is drawn), the tooltip by default will remain positioned within the frame’s bounds and point to the offscreen datapoint. This behaviour can be altered by implementing classes that conform to SChartSeriesCrosshairTooltipPositionerProtocol and SChartSeriesCrosshairTooltipDrawerProtocol.

Altering how the tooltip is styled can be done by subclassing SChartSeriesCrosshairTooltipStyler or creating a class that conforms to SChartSeriesCrosshairTooltipStylerProtocol.

Properties

caretWidth

Defines the width of the tooltip’s caret at its base.

@property (nonatomic, assign) CGFloat caretWidth

Discussion

Default is 10.

Declared In

SChartSeriesCrosshairTooltip.h

drawer

Handles the drawing of the tooltip. It is expected to return a CGPathRef that defines the path of the tooltip.

@property (nonatomic, retain) id<SChartSeriesCrosshairTooltipDrawerProtocol> drawer

Discussion

Default is SChartSeriesCrosshairTooltipDrawer.

Declared In

SChartSeriesCrosshairTooltip.h

positioner

Handles the positioning of the tooltip.

@property (nonatomic, retain) id<SChartSeriesCrosshairTooltipPositionerProtocol> positioner

Discussion

The default is SChartSeriesCrosshairTooltipPositioner.

Declared In

SChartSeriesCrosshairTooltip.h

shapeLayer

The layer upon which the tooltip is drawn.

@property (nonatomic, retain) CAShapeLayer *shapeLayer

Discussion

This property is exposed for use in classes conforming to SChartSeriesCrosshairTooltipStylerProtocol to apply attributes extracted from SChartCrosshairStyle to the shape layer.

NOTE: The preferred method to supply a CGPathRef to the shape layer is by conforming to SChartSeriesCrosshairTooltipDrawerProtocol and returning a path using newPathForTooltip:withCurrentTrackedPoint:onChart:trackingSeries:. Any path set directly on this property will be overidden when the tooltip’s position changes.

Declared In

SChartSeriesCrosshairTooltip.h

styler

Responsible for styling the tooltip.

@property (nonatomic, retain) id<SChartSeriesCrosshairTooltipStylerProtocol> styler

Discussion

Default is SChartSeriesCrosshairTooltipStyler.

Declared In

SChartSeriesCrosshairTooltip.h

Instance Methods

setPosition:trackingSeries:forDataPoint:onChart:

Called when the chart’s crosshair has been moved to a new position.

- (void)setPosition:(CGPoint)position trackingSeries:(SChartMappedSeries *)series forDataPoint:(id<SChartData>)dataPoint onChart:(ShinobiChart *)chart

Parameters

position

The position on the chart of the datapoint currently being tracked by the crosshair

series

The series currently being tracked by the crosshair

dataPoint

The datapoint the crosshair is centered over

chart

The chart on which the tooltip will be drawn

Discussion

In this method the tooltip is positioned, drawn and styled.

Declared In

SChartSeriesCrosshairTooltip.h