@nativescript-community/ui-chart
Version:
A powerful chart / graph plugin, supporting line, bar, pie, radar, bubble, and candlestick charts as well as scaling, panning and animations.
99 lines (97 loc) • 3.35 kB
TypeScript
import { ObservableArray } from '@nativescript/core';
import { Entry } from './Entry';
import { BaseDataSet } from './BaseDataSet';
/**
* Determines how to round DataSet index values for
* {@link DataSet#getEntryIndex(float, float, Rounding)} DataSet.getEntryIndex()}
* when an exact x-index is not found.
*/
export declare enum Rounding {
UP = 0,
DOWN = 1,
CLOSEST = 2
}
/**
* The DataSet class represents one group or type of entries (Entry) in the
* Chart that belong together. It is designed to logically separate different
* groups of values inside the Chart (e.g. the values for a specific line in the
* LineChart, or the values of a specific group of bars in the BarChart).
*
*/
export declare abstract class DataSet<T extends Entry> extends BaseDataSet<T> {
/**
* the entries that this DataSet represents / holds together
*/
protected mValues: T[] | ObservableArray<T>;
/**
* maximum y-value in the value array
*/
protected mYMax: number;
/**
* minimum y-value in the value array
*/
protected mYMin: number;
/**
* maximum x-value in the value array
*/
protected mXMax: number;
/**
* minimum x-value in the value array
*/
protected mXMin: number;
/**
* Creates a new DataSet object with the given values (entries) it represents. Also, a
* label that describes the DataSet can be specified. The label can also be
* used to retrieve the DataSet from a ChartData object.
*
* @param values
* @param label
*/
constructor(values: any, label: any, xProperty?: any, yProperty?: any);
toString(): string;
init(): void;
mCanCalculateMinMax: boolean;
batchEntryOperations(cb: any): void;
calcMinMax(): void;
protected initEntryData(e: T): void;
calcMinMaxYRange(fromX: any, toX: any): void;
/**
* Updates the min and max x and y value of this DataSet based on the given Entry.
*
* @param e
*/
protected calcMinMaxForEntry(e?: T, index?: number): void;
protected calcMinMaxX(e?: T, index?: number): void;
protected calcMinMaxY(e: T, index?: number): void;
protected getInternalValues(): T[] | ObservableArray<T>;
get entryCount(): number;
/**
* Returns the array of entries that this DataSet represents.
*/
get values(): T[] | ObservableArray<T>;
/**
* Sets the array of entries that this DataSet represents, and calls notifyDataSetChanged()
*/
set values(values: T[] | ObservableArray<T>);
get yMin(): number;
get yMax(): number;
get xMin(): number;
get xMax(): number;
addEntryOrdered(e: T): void;
clear(): void;
addEntry(e: T): boolean;
removeEntry(e: T): boolean;
removeEntryAtIndex(index: number): boolean;
getEntryIndex(e: T): number;
getEntryYValue(e: T): any;
getEntryForXValue(xValue: any, closestToY: any, rounding?: Rounding): T;
getEntryAndIndexForXValue(xValue: any, closestToY: any, rounding?: Rounding): {
entry: T;
index: number;
};
protected updateGetEntryForIndex(): void;
getEntryForIndex(index: any): T;
getEntryIndexForXValue(xValue: any, closestToY: any, rounding: any): number;
getEntriesForXValue(xValue: any): any[];
getEntriesAndIndexesForXValue(xValue: any): any[];
}