AWFGraphRenderer
Objective-C
@interface AWFGraphRenderer : NSObject
Swift
class AWFGraphRenderer : NSObject
AWFGraphRenderer is the base class used to render series data onto a graph view. This class should not be used alone and must be subclassed to provide
all drawing based on the desired result and renderer type.
-
The graph view this renderer instance belongs to.
Declaration
Objective-C
@property (nonatomic, strong, nullable) AWFGraphView *graphView;Swift
var graphView: AWFGraphView? { get set } -
The receiver’s delegate.
A graph renderer sends messages to its delegate regarding the selection and deselecton of series item data points.
Declaration
Objective-C
@property (nonatomic, nullable) id<AWFGraphRendererDelegate> delegate;Swift
unowned(unsafe) var delegate: AWFGraphRendererDelegate? { get set } -
Renders a series item in the graph.
Declaration
Objective-C
- (void)drawSeriesItem:(nonnull AWFSeriesItem *)seriesItem;Swift
func draw(_ seriesItem: AWFSeriesItem)Parameters
seriesItemThe series item to render
-
Updates all series items managed by this renderer.
Declaration
Objective-C
- (void)update;Swift
func update() -
Updates all series items managed by this renderer for the specified zoom scale.
This is called automatically by the parent graph view when its zoom scale changes and should not be called directly.
Declaration
Objective-C
- (void)adjustForZoomScale:(CGFloat)zoomScale;Swift
func adjust(forZoomScale zoomScale: CGFloat)Parameters
zoomScaleThe zoom scale to use
-
Returns the layer that was hit at the specified point, if any.
This is used to determine if a series item data element was tapped from the parent graph view.
Declaration
Objective-C
- (nonnull CALayer *)hitTest:(CGPoint)point inView:(nonnull UIView *)view;Swift
func hitTest(_ point: CGPoint, in view: UIView) -> CALayerParameters
pointThe point to test against
viewThe view in which to test
Return Value
The layer that was hit, otherwise
nilif none were hit. -
Selects the graph renderer item at the
indexof the specifiedseriesItem. If a callout view is available, this method will also display a callout view containing the value of the item at the selected point and series item.Note: The provided
seriesItemmust use this renderer type in order for the item to be selected.Declaration
Objective-C
- (void)selectItemAtIndex:(NSInteger)index inSeriesItem:(nonnull AWFSeriesItem *)seriesItem;Swift
func selectItem(at index: Int, in seriesItem: AWFSeriesItem)Parameters
indexThe index of the point in the series item to select.
seriesItemThe series item that contains the point to select.
-
Deselects all selected graph renderer items, if any, and dismisses the callout view.
Declaration
Objective-C
- (void)deselectAllItems;Swift
func deselectAllItems()
View on GitHub
AWFGraphRenderer Class Reference