iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x

SCILegendDataSource

@interface SCILegendDataSource : NSObject <UICollectionViewDataSource>

Defines the dataSource for SCIChartLegend.

  • Gets or sets the list of series info to display in SCIChartLegend.

    Declaration

    Objective-C

    @property (nonatomic, strong) SCIObservableCollection *_Nonnull dataSet;

    Swift

    var dataSet: SCIObservableCollection<AnyObject> { get set }
  • Gets the xib name which is used to register nib for cell with reuse identifier, which later used to dequeue the legend items.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *legendItemXibName;

    Swift

    var legendItemXibName: String? { get }
  • Gets the bundle which is used to load cell nib.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSBundle *bundle;

    Swift

    var bundle: Bundle? { get }
  • Gets the class which is used to register class for cell with reuse identifier, which later used to dequeue the legend items.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) Class legendItemClass;

    Swift

    var legendItemClass: AnyClass? { get }
  • Creates a new instance of the SCILegendDataSource class.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithLegend:
                                (nonnull UICollectionView<ISCIChartLegend> *)legend
                         legendItemXibName:(nullable NSString *)legendItemXibName
                                    bundle:(nonnull NSBundle *)bundle;

    Swift

    init(legend: UICollectionView & ISCIChartLegend, legendItemXibName: String?, bundle: Bundle)

    Parameters

    legend

    The SCIChartLegend whith which this data source is associated.

    legendItemXibName

    The xib name which is used to register nib for cell with reuse identifier, which later used to dequeue the legend items. Assosiated class of this view must conform to ISCILegendItem.

  • Creates a new instance of the SCILegendDataSource class.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithLegend:
                                (nonnull UICollectionView<ISCIChartLegend> *)legend
                           legendItemClass:(nullable Class)cellClass;

    Swift

    init(legend: UICollectionView & ISCIChartLegend, legendItemClass cellClass: AnyClass?)

    Parameters

    legend

    The SCIChartLegend whith which this data source is associated.

    cellClass

    The class name which is used to register class for cell with reuse identifier, which later used to dequeue the legend items. Assosiated class of this view must conform to ISCILegendItem.

  • Registers observer to listen for changes on this SCILegendDataSource instance.

    Declaration

    Objective-C

    - (void)registerDataSourceObserver:
        (nonnull id<ISCILegendDataSourceObserver>)dataSourceObserver;

    Swift

    func registerDataSourceObserver(_ dataSourceObserver: ISCILegendDataSourceObserver)

    Parameters

    dataSourceObserver

    The observer to deregister.

  • Deregisters observer from listening changes on this SCILegendDataSource instance.

    Declaration

    Objective-C

    - (void)unregisterDataSourceObserver:
        (nonnull id<ISCILegendDataSourceObserver>)dataSourceObserver;

    Swift

    func unregisterDataSourceObserver(_ dataSourceObserver: ISCILegendDataSourceObserver)

    Parameters

    dataSourceObserver

    The observer to deregister.