AWFGraphSeries

Objective-C

@interface AWFGraphSeries : NSObject

Swift

class AWFGraphSeries : NSObject

The AWFGraphSeries class manages an array of AWFSeriesItem instances that are associated with a graph view. This class also provides utility methods for getting additional information about all of the series items managed by it.

  • An array of series items belonging to this series.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSArray *items;

    Swift

    var items: [Any]? { get }
  • The delegate’s receiver.

    A graph series sends messages to its delegate regarding changes to its data loading state.

    Declaration

    Objective-C

    @property (nonatomic, nullable) id<AWFGraphSeriesDelegate> delegate;

    Swift

    unowned(unsafe) var delegate: AWFGraphSeriesDelegate? { get set }
  • Initializes and returns a graph series instance using the specified series items.

    Declaration

    Objective-C

    + (nonnull instancetype)seriesWithItems:(nullable NSArray *)items;

    Swift

    convenience init(items: [Any]?)

    Parameters

    items

    An array of series items to initialize the graph series with

    Return Value

    An initialized graph series instance

  • Adds a new series item to the series.

    Declaration

    Objective-C

    - (void)addSeriesItem:(nonnull AWFSeriesItem *)item;

    Swift

    func addItem(_ item: AWFSeriesItem)

    Parameters

    item

    The series item to add

  • Adds an array of series items to the series.

    Declaration

    Objective-C

    - (void)addSeriesItems:(nonnull NSArray *)items;

    Swift

    func addItems(_ items: [Any])

    Parameters

    items

    The array of items to add

  • Removes a series item from the series.

    Declaration

    Objective-C

    - (void)removeSeriesItem:(nonnull AWFSeriesItem *)item;

    Swift

    func removeItem(_ item: AWFSeriesItem)

    Parameters

    item

    The series item to remove

  • Requests data for all series items using the associated object loader.

    Declaration

    Objective-C

    - (void)loadSeriesDataWithCompletion:(nonnull void (^)(void))completionBlock;

    Swift

    func loadData() async

    Parameters

    completionBlock

    The block to be executed on the completion of a successful request. This block has no return value and does not return an argument.

  • Returns the value range across all series items for the specified axis.

    Declaration

    Objective-C

    - (AWFGraphSeriesRange)rangeForAxis:(AWFGraphAxisType)axis;

    Swift

    func range(for axis: AWFGraphAxisType) -> AWFGraphSeriesRange

    Parameters

    axis

    The axis to return the range for

  • Returns the value interval across all series items for the specified axis.

    Declaration

    Objective-C

    - (CGFloat)valueIntervalForAxis:(AWFGraphAxisType)axis;

    Swift

    func valueInterval(for axis: AWFGraphAxisType) -> CGFloat

    Parameters

    axis

    The axis to return the value interval for

  • Returns the closest data point across all series to the specified value and axis.

    Declaration

    Objective-C

    - (nullable AWFSeriesPoint *)closestPointForAllSeriesToValue:(CGFloat)value
                                                         forAxis:
                                                             (AWFGraphAxisType)axis;

    Swift

    func closestPointForAllSeries(toValue value: CGFloat, for axis: AWFGraphAxisType) -> AWFSeriesPoint?

    Parameters

    value

    The value to return the closest data point for

    axis

    The axis the value is on