Nativescript plugin for Charts
    Preparing search index...

    Created by Philipp Jahoda on 21/10/15.

    interface IPieDataSet {
        automaticallyDisableSliceSpacing: boolean;
        axisDependency: AxisDependency;
        color: string | Color;
        colors: (string | Color)[];
        drawIconsEnabled: boolean;
        drawValuesEnabled: boolean;
        entryCount: number;
        fillShader: any;
        form: LegendForm;
        formLineDashEffect: DashPathEffect;
        formLineWidth: number;
        formSize: number;
        highlightEnabled: boolean;
        iconsOffset: MPPointF;
        label: string;
        needsFormatter: boolean;
        selectionShift: number;
        sliceSpace: number;
        usingSliceColorAsValueLineColor: boolean;
        valueFormatter: IValueFormatter;
        valueLineColor: any;
        valueLinePart1Length: number;
        valueLinePart1OffsetPercentage: number;
        valueLinePart2Length: number;
        valueLineVariableLength: boolean;
        valueLineWidth: number;
        values: PieEntry[] | ObservableArray<PieEntry>;
        valueTextColor: string | Color;
        valueTextColors: (string | Color)[];
        valueTextSize: number;
        valueTypeface: Font;
        visible: boolean;
        xMax: number;
        xMin: number;
        xProperty: string;
        xValuePosition: ValuePosition;
        yMax: number;
        yMin: number;
        yProperty: string;
        yValuePosition: ValuePosition;
        addEntry(e: PieEntry): boolean;
        addEntryOrdered(e: PieEntry): any;
        calcMinMax(): any;
        calcMinMaxYRange(fromX: number, toX: number): any;
        clear(): any;
        contains(entry: PieEntry): boolean;
        getColor(index?: number): string | Color;
        getEntriesAndIndexesForXValue(
            xValue: number,
        ): { entry: PieEntry; index: number }[];
        getEntriesForXValue(xValue: number): PieEntry[] | ObservableArray<PieEntry>;
        getEntryAndIndexForXValue(
            xValue: number,
            closestToY: number,
            rounding?: Rounding,
        ): { entry: PieEntry; index: number };
        getEntryForIndex(index: number): PieEntry;
        getEntryForXValue(
            xValue: number,
            closestToY: number,
            rounding?: Rounding,
        ): PieEntry;
        getEntryIndex(e: PieEntry): number;
        getEntryIndexForXValue(
            xValue: number,
            closestToY: number,
            rounding: Rounding,
        ): number;
        getEntryXValue(e: BaseEntry, entryIndex: number): number;
        getEntryYValue(e: PieEntry): number;
        getIndexInEntries(xIndex: number): number;
        init(): any;
        removeEntry(e: PieEntry): boolean;
        removeEntryAtIndex(index: number): boolean;
        removeEntryByXValue(xValue: number): boolean;
        removeFirst(): boolean;
        removeLast(): boolean;
    }

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    automaticallyDisableSliceSpacing: boolean

    When enabled, slice spacing will be 0.0 when the smallest value is going to be smaller than the slice spacing itself.

    axisDependency: AxisDependency

    the axis this DataSet should be plotted against.

    color: string | Color
    colors: (string | Color)[]

    returns all the colors that are set for this DataSet

    drawIconsEnabled: boolean

    Set this to true to draw y-icons on the chart.

    NOTE (for bar and line charts): if maxVisibleValueCount is reached, no icons will be drawn even if this is enabled

    drawValuesEnabled: boolean

    set this to true to draw y-values on the chart.

    NOTE (for bar and line charts): if maxVisibleValueCount is reached, no values will be drawn even if this is enabled

    entryCount: number

    Returns the number of y-values this DataSet represents -> the size of the y-values array -> yvals.length

    fillShader: any

    Returns the shader used for filling the area below the line.

    The form to draw for this dataset in the legend.

    Return `DEFAULT` to use the default legend form.

    formLineDashEffect: DashPathEffect

    The line dash path effect used for shapes that consist of lines.

    Return `null` to use the default legend form line dash effect.

    formLineWidth: number

    The line width for drawing the form of this dataset in the legend

    Return `Float.NaN` to use the default legend form line width.

    formSize: number

    The form size to draw for this dataset in the legend.

    Return `Float.NaN` to use the default legend form size.

    highlightEnabled: boolean

    If set to true, value highlighting is enabled which means that values can be highlighted programmatically or by touch gesture.

    iconsOffset: MPPointF

    Offset of icons drawn on the chart.

    For all charts except Pie and Radar it will be ordinary (x offset,y offset).

    For Pie and Radar chart it will be (y offset, distance from center offset); so if you want icon to be rendered under value, you should increase X component of CGPoint, and if you want icon to be rendered closet to center, you should decrease height component of CGPoint.

    label: string

    the label string that describes the DataSet.

    needsFormatter: boolean

    Returns true if the valueFormatter object of this DataSet is null.

    selectionShift: number

    indicates the selection distance of a pie slice

    sliceSpace: number

    the space in pixels between the chart-slices, default 0

    usingSliceColorAsValueLineColor: boolean
    valueFormatter: IValueFormatter

    Sets the formatter to be used for drawing the values inside the chart. If no formatter is set, the chart will automatically determine a reasonable formatting (concerning decimals) for all the values that are drawn inside the chart. Use chart.defaultValueFormatter to use the formatter calculated by the chart.

    valueLineColor: any

    When valuePosition is OutsideSlice, indicates line color

    valueLinePart1Length: number

    When valuePosition is OutsideSlice, indicates length of first half of the line

    valueLinePart1OffsetPercentage: number

    When valuePosition is OutsideSlice, indicates offset as percentage out of the slice size

    valueLinePart2Length: number

    When valuePosition is OutsideSlice, indicates length of second half of the line

    valueLineVariableLength: boolean

    When valuePosition is OutsideSlice, this allows variable line length

    valueLineWidth: number

    When valuePosition is OutsideSlice, indicates line width

    values: PieEntry[] | ObservableArray<PieEntry>

    getEntryYValue

    Returns the values that belong to DataSet.

    valueTextColor: string | Color

    Sets the color the value-labels of this DataSet should have.

    valueTextColors: (string | Color)[]

    Sets a list of colors to be used as the colors for the drawn values.

    valueTextSize: number

    Sets the text-size of the value-labels of this DataSet in dp.

    valueTypeface: Font

    Sets a Typeface for the value-labels of this DataSet.

    visible: boolean

    Set the visibility of this DataSet. If not visible, the DataSet will not be drawn to the chart upon refreshing it.

    xMax: number

    returns the maximum x-value this DataSet holds

    xMin: number

    returns the minimum x-value this DataSet holds

    xProperty: string
    xValuePosition: ValuePosition
    yMax: number

    returns the maximum y-value this DataSet holds

    yMin: number

    returns the minimum y-value this DataSet holds

    yProperty: string
    yValuePosition: ValuePosition

    Methods

    • Adds an Entry to the DataSet dynamically. Entries are added to the end of the list. This will also recalculate the current minimum and maximum values of the DataSet and the value-sum.

      Parameters

      Returns boolean

    • Adds an Entry to the DataSet dynamically. Entries are added to their appropriate index in the values array respective to their x-position. This will also recalculate the current minimum and maximum values of the DataSet and the value-sum.

      Parameters

      Returns any

    • Calculates the minimum and maximum x and y values (mXMin, this.mXMax, this.mYMin, this.mYMax).

      Returns any

    • Calculates the min and max y-values from the Entry closest to the given fromX to the Entry closest to the given toX value. This is only needed for the autoScaleMinMax feature.

      Parameters

      • fromX: number
      • toX: number

      Returns any

    • Removes all values from this DataSet and does all necessary recalculations.

      Returns any

    • Checks if this DataSet contains the specified Entry. Returns true if so, false if not. NOTE: Performance is pretty bad on this one, do not over-use in performance critical situations.

      Parameters

      Returns boolean

    • Returns the color at the given index of the DataSet's color array. Performs a IndexOutOfBounds check by modulus.

      Parameters

      • Optionalindex: number

      Returns string | Color

    • Returns all Entry objects found at the given x-value with binary search. An empty array if no Entry object at that x-value. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.

      Parameters

      • xValue: number

      Returns { entry: PieEntry; index: number }[]

    • Returns all Entry objects found at the given x-value with binary search. An empty array if no Entry object at that x-value. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.

      Parameters

      • xValue: number

      Returns PieEntry[] | ObservableArray<PieEntry>

    • Returns the first Entry object found at the given x-value with binary search. If the no Entry at the specified x-value is found, this method returns the Entry at the closest x-value according to the rounding. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.

      Parameters

      • xValue: number

        the x-value

      • closestToY: number

        If there are multiple y-values for the specified x-value,

      • Optionalrounding: Rounding

        determine whether to round up/down/closest if there is no Entry matching the provided x-value

      Returns { entry: PieEntry; index: number }

    • Returns the Entry object found at the given index (NOT xIndex) in the values array.

      Parameters

      • index: number

      Returns PieEntry

    • Returns the first Entry object found at the given x-value with binary search. If the no Entry at the specified x-value is found, this method returns the Entry at the closest x-value according to the rounding. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.

      Parameters

      • xValue: number

        the x-value

      • closestToY: number

        If there are multiple y-values for the specified x-value,

      • Optionalrounding: Rounding

        determine whether to round up/down/closest if there is no Entry matching the provided x-value

      Returns PieEntry

    • Returns the position of the provided entry in the DataSets Entry array. Returns -1 if doesn't exist.

      Parameters

      Returns number

    • Returns the first Entry index found at the given x-value with binary search. If the no Entry at the specified x-value is found, this method returns the Entry at the closest x-value according to the rounding. INFORMATION: This method does calculations at runtime. Do not over-use in performance critical situations.

      Parameters

      • xValue: number

        the x-value

      • closestToY: number

        If there are multiple y-values for the specified x-value,

      • rounding: Rounding

        determine whether to round up/down/closest if there is no Entry matching the provided x-value

      Returns number

    • Parameters

      • e: BaseEntry
      • entryIndex: number

      Returns number

    • This method returns the actual index in the Entry array of the DataSet for a given xIndex. IMPORTANT: This method does calculations at runtime, do not over-use in performance critical situations.

      Parameters

      • xIndex: number

      Returns number

    • Initializes DataSet chart data.

      Returns any

    • Removes an Entry from the DataSets entries array. This will also recalculate the current minimum and maximum values of the DataSet and the value-sum. Returns true if an Entry was removed, false if no Entry could be removed.

      Parameters

      Returns boolean

    • Removes the Entry object at the given index in the values array from the DataSet. Returns true if an Entry was removed, false if no Entry could be removed.

      Parameters

      • index: number

      Returns boolean

    • Removes the Entry object closest to the given x-value from the DataSet. Returns true if an Entry was removed, false if no Entry could be removed.

      Parameters

      • xValue: number

      Returns boolean

    • Removes the first Entry (at index 0) of this DataSet from the entries array. Returns true if successful, false if not.

      Returns boolean

    • Removes the last Entry (at index size-1) of this DataSet from the entries array. Returns true if successful, false if not.

      Returns boolean