DataSource interface

Hierarchy

Index

Properties

Optional Readonly Aggregator

Aggregator: undefined | object

Map of aggregators, the number needs to be the index of the aggregator row

Optional Comments

Comments: IComment[]

Readonly Data

Data: TDataValue[][]

Access to the raw data Returns data-rows where each row is a datapoint in the order: <dimension[0]>..<dimension, <measure[0]>..<measure[m-1]>. The order of dimensions and measures is the same as returned from listDimensions() and listMeasures()

Readonly Dimensions

Id

Id: string

Readonly Measures

Name

Name: string

The name of the context as it will be displayed to the user. Changing the name will trigger a TrueChart repaint

Optional SourceReference

SourceReference: unknown

Optional external reference, to help managing the connection between the BI and trueChart

Methods

addDataRow

  • Adds row(s) to the dataset. TrueChart will be repainted on successful adding.

    Parameters

    • row: TDataValue[] | TDataValue[][]

      Data points of 1 single row or multiple rows. The data of each row must be <dimension[0]>..<dimension, <measure[0]>..<measure[m-1]>. The order of dimensions and measures is the same as returned from listDimensions() and listMeasures()

    Returns boolean

    True when succeeded.

addDimension

  • Adds a dimension to the context. TrueChart will be repainted on successful adding.

    Parameters

    • newDimension: IDimension | IHierarchyDimension
    • data: (string | Date)[]

      Initial data of the new dimension. If there is already data in this context, the length of this array must be the same as the existing data.

    Returns string

    internal ID of the dimension for reference

addMeasure

  • Adds a measure to the context. TrueChart will be repainted on successful adding.

    Parameters

    Returns string

    internal ID of the measure for reference

beginUpdate

  • beginUpdate(): void
  • Call this to mark the beginning of multiple changes to the datasource. Between beginUpdate() and endUpdate() no checks and repaint-triggers will be processed

    Returns void

changeData

  • changeData(columns: object): boolean
  • Changes existing data points

    Parameters

    Returns boolean

    True when succeeded

endUpdate

  • endUpdate(): void
  • Call this to mark the end of multiple changes.

    Returns void

listDimensions

  • Returns information about all dimensions in this context. This can be used to display header information for tables.

    Returns (IDimension & object)[]

    []}

listMeasures

  • Returns information about all measures in this context. This can be used to display header information for tables.

    Returns (IMeasure & object)[]

    []}

markAggregatorRow

  • adds a aggregator row to the data source

    Parameters

    • type: TAggregatorType

      type of the aggregator row

    • rowIndex: number

      position where the data row should be insert

    Returns void

removeDimension

  • removeDimension(dimensionId: string): boolean
  • Removes a formerly added dimension. TrueChart will be repainted on successful removing.

    Parameters

    • dimensionId: string

      ID of the dimension to be deleted

    Returns boolean

    True when succeeded

removeMeasure

  • removeMeasure(measureId: string): boolean
  • Removes a formerly added measure. TrueChart will be repainted on successful removing.

    Parameters

    • measureId: string

      ID of the measure to be deleted

    Returns boolean

    True when succeeded

renameDimension

  • renameDimension(dimensionId: string, newName: string): boolean
  • Renames an existing dimension and repaint on success

    Parameters

    • dimensionId: string

      ID of the dimension to be renamed

    • newName: string

      new name of the dimension

    Returns boolean

    true if succeeded

renameMeasure

  • renameMeasure(measureId: string, newName: string): boolean
  • Renames an existing measure and repaint on success

    Parameters

    • measureId: string

      ID of the measure to be renamed

    • newName: string

      new name of the measure

    Returns boolean

    true if succeeded