UNPKG

@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.

103 lines (102 loc) 4.03 kB
import { BarLineScatterCandleBubbleDataProvider } from '../interfaces/dataprovider/BarLineScatterCandleBubbleDataProvider'; import { IHighlighter } from './IHighlighter'; import { Highlight } from './Highlight'; import { AxisDependency } from '../components/YAxis'; import { IDataSet } from '../interfaces/datasets/IDataSet'; import { Entry } from '../data/Entry'; export declare class ChartHighlighter<T extends BarLineScatterCandleBubbleDataProvider> implements IHighlighter { /** * instance of the data-provider */ protected mChart: T; /** * buffer for storing previously highlighted values */ protected mHighlightBuffer: Highlight[]; constructor(chart: T); getHighlight(x: any, y: any): Highlight<Entry>[]; /** * Returns a recyclable MPPointD instance. * Returns the corresponding xPos for a given touch-position in pixels. * * @param x * @param y * @return */ protected getValsForTouch(x: any, y: any): any; /** * Returns the corresponding Highlight for a given xVal and x- and y-touch position in pixels. * * @param xVal * @param x * @param y * @return */ protected getHighlightForX(xVal: any, x: any, y: any): Highlight<Entry>[]; /** * Returns the minimum distance from a touch value (in pixels) to the * closest value (in pixels) that is displayed in the chart. * * @param closestValues * @param pos * @param axis * @return */ protected getMinimumDistance(closestValues: Highlight[], pos: any, axis: any): number; protected getHighlightPos(h: Highlight): number; protected getChartData(): import("../data/BarLineScatterCandleBubbleData").BarLineScatterCandleBubbleData<any, any>; /** * Returns a list of Highlight objects representing the entries closest to the given xVal. * The returned list contains two objects per DataSet (closest rounding up, closest rounding down). * * @param xVal the transformed x-value of the x-touch position * @return */ getHighlightsAtXValue(xVal: any, x?: any, y?: any): Highlight<Entry>[]; /** * An array of `Highlight` objects corresponding to the selected xValue and dataSetIndex. * * @param set * @param dataSetIndex * @param xVal * @param rounding * @return */ protected buildHighlights(set: IDataSet<Entry>, dataSetIndex: any, touchX: any, touchY: any, xVal: any, rounding: any): Highlight<Entry>[]; /** * Returns the Highlight of the DataSet that contains the closest value on the * y-axis. * * @param closestValues contains two Highlight objects per DataSet closest to the selected x-position (determined by * rounding up an down) * @param x * @param y * @param minSelectionDistance * @param axis the closest axis * @return */ getClosestHighlightByPixel(closestValues: Highlight[], x: number, y: number, minSelectionDistance: number, axis?: AxisDependency): Highlight<Entry>; /** * Returns sorted highlights based on distance to touch x,y * * @param closestValues contains two Highlight objects per DataSet closest to the selected x-position (determined by * rounding up an down) * @param x * @param y * @param minSelectionDistance * @param axis the closest axis * @return */ sortedHighlights(closestValues: Highlight[], x: number, y: number, minSelectionDistance: number, axis?: AxisDependency): Highlight<Entry>[]; /** * Calculates the distance between the two given points. * * @param x1 * @param y1 * @param x2 * @param y2 * @return */ protected getDistance(x1: number, y1: number, x2: number, y2: number): number; protected getData(): import("../data/BarLineScatterCandleBubbleData").BarLineScatterCandleBubbleData<any, any>; }