Data object that represents all data for the BarChart.

Hierarchy (View Summary)

Constructors

Properties

barWidth: number

the width of the bars on the x-axis, in values (not pixels)

fixedBarScale: boolean

if set to true, bar keep the same size with zoom scale

mDataSets: BarDataSet[]

array that holds all DataSets the ChartData object represents

mLeftAxisMax: number
mLeftAxisMin: number
mRightAxisMax: number
mRightAxisMin: number
mXMax: number

maximum x-value in the value array

mXMin: number

minimum x-value in the value array

mYMax: number

maximum y-value in the value array across all axes

mYMin: number

the minimum y-value in the value array across all axes

Accessors

  • get colors(): any[]
  • Returns all colors used across all DataSet objects this object represents.

    Returns any[]

  • get dataSetCount(): number
  • returns the number of LineDataSets this object contains

    Returns number

  • get dataSets(): T[]
  • Returns all DataSet objects this ChartData object holds.

    Returns T[]

  • set drawValuesEnabled(enabled: any): void
  • Enables / disables drawing values (value-text) for all DataSets this data object contains.

    Parameters

    • enabled: any

    Returns void

  • get entryCount(): number
  • Returns the total entry count across all DataSet objects this data object contains.

    Returns number

  • get highlightEnabled(): boolean
  • Returns true if highlighting of all underlying values is enabled, false if not.

    Returns boolean

  • get maxEntryCountSet(): T
  • Returns the DataSet object with the maximum number of entries or null if there are no DataSets.

    Returns T

  • set valueFormatter(f: IValueFormatter): void
  • Sets a custom IValueFormatter for all DataSets this data object contains.

    Parameters

    Returns void

  • set valueTextColor(color: any): void
  • Sets the color of the value-text (color in which the value-labels are drawn) for all DataSets this data object contains.

    Parameters

    • color: any

    Returns void

  • set valueTextColors(colors: any): void
  • Sets the same list of value-colors for all DataSets this data object contains.

    Parameters

    • colors: any

    Returns void

  • set valueTextSize(size: any): void
  • Sets the size (in dp) of the value-text for all DataSets this data object contains.

    Parameters

    • size: any

    Returns void

  • set valueTypeface(tf: any): void
  • Sets the Typeface for all value-labels for all DataSets this data object contains.

    Parameters

    • tf: any

    Returns void

  • get visibleDataSets(): T[]
  • Returns T[]

  • get xMax(): number
  • Returns the maximum x-value this data object contains.

    Returns number

  • get xMin(): number
  • Returns the minimum x-value this data object contains.

    Returns number

  • get yMax(): number
  • Returns number

  • get yMin(): number
  • Returns number

Methods

  • Adds an Entry to the DataSet at the specified index. Entries are added to the end of the list.

    Parameters

    • e: any
    • dataSetIndex: any

    Returns void

  • Calc minimum and maximum values (both x and y) over all DataSets.

    Returns void

  • Calc minimum and maximum y-values over all DataSets. Tell DataSets to recalculate their min and max y-values, this is only needed for autoScaleMinMax.

    Parameters

    • fromX: any

      the x-value to start the calculation from

    • toX: any

      the x-value to which the calculation should be performed

    Returns void

  • Clears this data object from all DataSets and removes all Entries. Don't forget to invalidate the chart after this.

    Returns void

  • Checks if this data object contains the specified DataSet. Returns true if so, false if not.

    Parameters

    • dataSet: any

    Returns boolean

  • Returns the DataSet object with the given label. Search can be case sensitive or not. IMPORTANT: This method does calculations at runtime. Use with care in performance critical situations.

    Parameters

    • label: string
    • Optionalignorecase: boolean

    Returns BarDataSet

  • Retrieve the index of a DataSet with a specific label from the ChartData. Search can be case sensitive or not. IMPORTANT: This method does calculations at runtime, do not over-use in performance critical situations.

    Parameters

    • dataSets: BarDataSet[]

      the DataSet array to search

    • label: string
    • Optionalignorecase: boolean

      if true, the search is not case-sensitive

    Returns number

  • In case of grouped bars, this method returns the space an individual group of bar needs on the x-axis.

    Parameters

    • groupSpace: any
    • barSpace: any

    Returns any

  • Returns the minimum y-value for the specified axis.

    Parameters

    • Optionalaxis: any

    Returns number

  • Groups all BarDataSet objects this data object holds together by modifying the x-value of their entries. Previously set x-values of entries will be overwritten. Leaves space between bars and groups as specified by the parameters. Do not forget to call notifyDataSetChanged() on your BarChart object after calling this method.

    Parameters

    • fromX: any

      the starting polet on the x-axis where the grouping should begin

    • groupSpace: any

      the space between groups of bars in values (not pixels) e.g. 0.8f for bar width 1

    • barSpace: any

      the space between individual bars in values (not pixels) e.g. 0.1 for bar width 1

    • Optionalcentered: boolean

      whether to group bar around x values or between (default is false)

    • OptionalgroupCondensed: boolean

      whether to condensed grouped bar (no space for "0" bars)

    Returns void

  • Call this method to let the ChartData know that the underlying data has changed. Calling this performs all necessary recalculations needed when the contained data has changed.

    Returns void

  • Removes the given DataSet from this data object. Also recalculates all minimum and maximum values. Returns true if a DataSet was removed, false if no DataSet could be removed.

    Parameters

    Returns boolean

  • Removes the DataSet at the given index in the DataSet array from the data object. Also recalculates all minimum and maximum values. Returns true if a DataSet was removed, false if no DataSet could be removed.

    Parameters

    • index: any

    Returns boolean

  • Removes the given Entry object from the DataSet at the specified index.

    Parameters

    • e: any
    • dataSetIndex: any

    Returns boolean

  • Removes the Entry object closest to the given DataSet at the specified index. Returns true if an Entry was removed, false if no Entry was found that meets the specified requirements.

    Parameters

    • index: any
    • dataSetIndex: any

    Returns boolean

  • Removes the Entry object closest to the given DataSet at the specified index. Returns true if an Entry was removed, false if no Entry was found that meets the specified requirements.

    Parameters

    • xValue: any
    • dataSetIndex: any

    Returns boolean

  • Enables / disables highlighting values for all DataSets this data object contains. If set to true, this means that values can be highlighted programmatically or by touch gesture.

    Parameters

    • enabled: any

    Returns void