Nativescript plugin for Charts
    Preparing search index...

    Class Chart<U, D, T>Abstract

    Baseclass of all Chart-Views.

    Type Parameters

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    animator: ChartAnimator

    object responsible for animations

    chartTouchListener: ChartTouchListener<any>
    defaultValueFormatter: DefaultValueFormatter

    the default IValueFormatter that has been determined by the chart considering the provided minimum and maximum values, number of digits depends on provided chart-data

    descPaint: Paint

    palet object used for drawing the description text in the bottom right corner of the chart

    disableScrollEnabled: boolean

    Wether to disable scroll while touching the chart. Default to true

    doubleTapGestureOptions: TapGestureHandlerOptions & { gestureTag?: number }
    dragDecelerationEnabled: boolean

    If set to true, chart continues to scroll after touch up

    dragDecelerationFrictionCoef: number

    Deceleration friction coefficient in [0 ; 1] interval, higher values indicate that speed will decrease slowly, for example if it set to 0, it will stop immediately. value must be < 1.0

    drawMarkersEnabled: boolean

    if set to true, the marker view is drawn when a value is clicked

    extraBottomOffset: number
    extraLeftOffset: number
    extraRightOffset: number
    extraTopOffset: number

    Extra offsets to be appended to the viewport

    highlighter: IHighlighter
    highlightsFilterByAxis: boolean

    Wether to filter highlights by axis. Default is true

    indicesToHighlight: Highlight<Entry>[]

    array of Highlight objects that reference the highlighted slices in the chart

    jobs: any[]

    tasks to be done after the view is setup

    legendRenderer: LegendRenderer

    Gesture listener for custom callbacks when making gestures on the chart.

    marker: IMarker

    the view that represents the marker

    maxHighlightDistance: number

    The maximum distance in dp away from an entry causing it to highlight.

    maxVisibleValueCount: number
    mData: T

    object that holds all data that was originally set for the chart, before it was modified or any filtering algorithms had been applied

    mDescription: Description

    the object responsible for representing the description text

    mDisallowInterceptTouchEvent: boolean
    mHighlightPerTapEnabled: boolean

    Flag that indicates if highlighting per tap (touch) is enabled

    mInfoPaint: Paint

    palet object for drawing the information text when there are no values in the chart

    mLegend: Legend

    the legend object containing all data associated with the legend

    noComputeAutoScaleOnNextDraw: boolean

    let the chart know it does not need to compute autoScale (it can used the cached ones)

    noComputeAxisOnNextDraw: boolean

    let the chart know it does not need to compute axis and legends (it can used the cached ones)

    noDataText: any

    text that is displayed when the chart is empty

    offsetsCalculated: any

    flag that indicates if offsets calculation has already been done or not

    panGestureOptions: PanGestureHandlerOptions & { gestureTag?: number }
    pinchGestureOptions: PinchGestureHandlerOptions & { gestureTag?: number }
    renderer: DataRenderer

    object responsible for rendering the data

    rotationGestureOptions: RotationGestureHandlerOptions & { gestureTag?: number }
    tapGestureOptions: TapGestureHandlerOptions & { gestureTag?: number }
    viewPortHandler: ViewPortHandler

    object that manages the bounds and drawing constraints of the chart

    xAxis: XAxis

    the object representing the labels on the x-axis

    yChartMax: number

    Returns the maximum y value of the chart, regardless of zoom or translation.

    yChartMin: number

    Returns the minimum y value of the chart, regardless of zoom or translation.

    Accessors

    • get center(): { x: number; y: number }

      Returns a recyclable MPPointF instance. Returns the center polet of the chart (the whole View) in pixels.

      Returns { x: number; y: number }

    • get centerOffsets(): { x: number; y: number }

      Returns a recyclable MPPointF instance. Returns the center of the chart taking offsets under consideration. (returns the center of the content rectangle)

      Returns { x: number; y: number }

    • get centerOfView(): { x: number; y: number }

      Returns a recyclable MPPointF instance.

      Returns { x: number; y: number }

    • get chartBitmap(): any

      Returns the bitmap that represents the chart.

      Returns any

    • get contentRect(): RectF

      Returns the rectangle that defines the borders of the chart-value surface (into which the actual values are drawn).

      Returns RectF

    • get data(): T

      Returns the ChartData object that has been set for the chart.

      Returns T

    • set data(data: T): void

      Sets a new data object for the chart. The data object contains all values and information needed for displaying.

      Parameters

      • data: T

      Returns void

    • get description(): Description

      Returns the animator responsible for animating chart values.

      Returns Description

    • set extraOffsets(value: [number, number, number, number]): void

      Sets extra offsets (around the chart view) to be appended to the auto-calculated offsets.

      Parameters

      • value: [number, number, number, number]

      Returns void

    • get hasValuesToHighlight(): boolean

      Returns true if there are values to highlight, false if there are no values to highlight. Checks if the highlight array is null, has a length of zero or if the first object is null.

      Returns boolean

    • get highlighted(): Highlight<Entry>[]

      Returns the array of currently highlighted values. This might a null or empty array if nothing is highlighted.

      Returns Highlight<Entry>[]

    • get infoPaint(): Paint

      Returns Paint

    • set lastHighlighted(highs: any): void

      Sets the last highlighted value for the touchlistener.

      Parameters

      • highs: any

      Returns void

    • get legend(): Legend

      Returns the Legend object of the chart. This method can be used to get an instance of the legend in order to customize the automatically generated Legend.

      Returns Legend

    • get length(): boolean

      Returns true if the chart is empty (meaning it's data object is either null or contains no entries).

      Returns boolean

    • set noDataTextColor(color: any): void

      Sets the color of the no data text.

      Parameters

      • color: any

      Returns void

    • set noDataTextTypeface(tf: Font): void

      Sets the typeface to be used for the no data text.

      Parameters

      • tf: Font

      Returns void

    • get viewPortScaleX(): number

      Returns number

    • get viewPortScaleY(): number

      Returns number

    • get xChartMax(): number

      Returns the maximum x value of the chart, regardless of zoom or translation.

      Returns number

    • get xChartMin(): number

      Returns the minimum x value of the chart, regardless of zoom or translation.

      Returns number

    • get xRange(): number

      Returns number

    • get yMax(): number

      returns the current y-max value across all DataSets

      Returns number

    • get yMin(): number

      returns the current y-min value across all DataSets

      Returns number

    Methods

    • Either posts a job immediately if the chart has already setup it's dimensions or adds the job to the execution queue.

      Parameters

      Returns void

    • Animates the rendering of the chart on the x-axis with the specified animation time. If animate(...) is called, no further calling of invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.

      Parameters

      • durationMillis: any
      • Optionaleasing: EasingFunction

        a custom easing function to be used on the animation phase

      Returns void

    • Animates the drawing / rendering of the chart on both x- and y-axis with the specified animation time. If animate(...) is called, no further calling of invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.

      Parameters

      • durationMillisX: any
      • durationMillisY: any
      • OptionaleasingX: EasingFunction

        a custom easing function to be used on the animation phase

      • OptionaleasingY: EasingFunction

        a custom easing function to be used on the animation phase

      Returns void

    • Animates the rendering of the chart on the y-axis with the specified animation time. If animate(...) is called, no further calling of invalidate() is necessary to refresh the chart. ANIMATIONS ONLY WORK FOR API LEVEL 11 (Android 3.0.x) AND HIGHER.

      Parameters

      • durationMillis: any
      • Optionaleasing: EasingFunction

        a custom easing function to be used on the animation phase

      Returns void

    • Calculates the y-min and y-max value and the y-delta and x-delta value

      Returns any

    • Calculates the offsets of the chart to the border depending on the position of an eventual legend or depending on the length of the y-axis and x-axis labels and their position

      Parameters

      • Optionalforce: boolean

      Returns any

    • Clears the chart from all data (sets it to null) and refreshes it (by calling invalidate()).

      Returns void

    • Returns void

    • Removes all DataSets (and thereby Entries) from the chart. Does not set the data object to null. Also refreshes the chart by calling invalidate().

      Returns void

    • disables intercept touchevents

      Returns void

    • Clean up references to the native view.

      Returns void

    • Parameters

      • canvas: Canvas

      Returns void

    • Draws the description text in the bottom right corner of the chart (per default)

      Parameters

      • c: Canvas

      Returns void

    • draws all MarkerViews on the highlighted positions

      Parameters

      • canvas: Canvas

      Returns void

    • enables intercept touchevents

      Returns void

    • Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch polet inside the Line-, Scatter-, or CandleStick-Chart.

      Parameters

      • x: any
      • y: any

      Returns Highlight<Entry>

    • Returns the Highlight object (contains x-index and DataSet index) of the selected value at the given touch polet inside the Line-, Scatter-, or CandleStick-Chart.

      Parameters

      • xValue: any

      Returns Highlight<Entry>[]

    • Returns the Highlights (contains x-index and DataSet index) of the selected value at the given touch polet inside the Line-, Scatter-, or CandleStick-Chart.

      Parameters

      • x: any
      • y: any

      Returns Highlight<Entry>[]

    • Returns all jobs that are scheduled to be executed after onSizeChanged(...).

      Returns any[]

    • Returns the actual position in pixels of the MarkerView for the given Highlight object.

      Parameters

      Returns number[]

    • Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.

      Parameters

      Returns void

    • Highlights the value selected by touch gesture. Unlike highlightValues(...), this generates a callback to the OnChartValueSelectedListener.

      Parameters

      • highs: Highlight<Entry>[]
      • OptionalcallListener: boolean

        call the listener

      Returns void

    • Highlights any y-value at the given x-value in the given DataSet. Provide -1 as the dataSetIndex to undo all highlighting.

      Parameters

      • x: any

        The x-value to highlight

      • y: any

        The y-value to highlight. Supply NaN for "any"

      • dataSetIndex: any

        The dataset index to search in

      • OptionalcallListener: boolean

        Should the listener be called for this change

      Returns void

    • Highlights the values at the given indices in the given DataSets. Provide null or an empty array to undo all highlighting. This should be used to programmatically highlight values. This method will not call the listener.

      Parameters

      • highs: any

      Returns void

    • initialize all paints and stuff

      Returns void

    • Initializes properties/listeners of the native view.

      Returns void

    • Lets the chart know its underlying data has changed and performs all necessary recalculations. It is crucial that this method is called everytime data is changed dynamically. Not calling this method can lead to crashes or unexpected behaviour.

      Returns any

    • Parameters

      • canvas: Canvas

      Returns void

    • Called from layout when this view should assign a size and position to each of its children. Derived classes with children should override this method and call layout on each of their children.

      Parameters

      • left: number

        Left position, relative to parent

      • top: number

        Top position, relative to parent

      • right: number

        Right position, relative to parent

      • bottom: number

        Bottom position, relative to parent

      Returns void

    • Parameters

      • w: number
      • h: number

      Returns void

    • Parameters

      • w: number
      • h: number
      • oldw: number
      • oldh: number

      Returns void

    • Parameters

      • job: any

      Returns void

    • RESET PERFORMANCE TRACKING FIELDS

      Returns void

    • Sets extra offsets (around the chart view) to be appended to the auto-calculated offsets.

      Parameters

      • left: any
      • top: any
      • right: any
      • bottom: any

      Returns void

    • Calculates the required number of digits for the values that might be drawn in the chart (if enabled), and creates the default-value-formatter

      Parameters

      • min: any
      • max: any

      Returns void