@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.
70 lines (69 loc) • 1.77 kB
TypeScript
import { Chart } from '../charts/Chart';
import { Highlight } from '../highlight/Highlight';
export declare enum ChartGesture {
NONE = 0,
DRAG = 1,
X_ZOOM = 2,
Y_ZOOM = 3,
PINCH_ZOOM = 4,
ROTATE = 5,
SINGLE_TAP = 6,
DOUBLE_TAP = 7,
LONG_PRESS = 8,
FLING = 9
}
/**
* Created by philipp on 12/06/15.
*/
export declare abstract class ChartTouchListener<T extends Chart<any, any, any>> {
/**
* the last touch gesture that has been performed
**/
protected mLastGesture: ChartGesture;
protected static NONE: number;
protected static DRAG: number;
protected static X_ZOOM: number;
protected static Y_ZOOM: number;
protected static PINCH_ZOOM: number;
protected static POST_ZOOM: number;
protected static ROTATE: number;
/**
* integer field that holds the current touch-state
*/
protected mTouchMode: number;
/**
* the last highlighted object (via touch)
*/
lastHighlighted: Highlight;
/**
* the chart the listener represents
*/
readonly chart: T;
constructor(chart: T);
dispose(): void;
init(): void;
/**
* returns the touch mode the listener is currently in
*/
get touchMode(): number;
/**
* Returns the last gesture that has been performed on the chart.
*/
get lastGesture(): ChartGesture;
/**
* Perform a highlight operation.
*
* @param e
*/
protected performHighlight(h: Highlight): void;
/**
* returns the distance between two points
*
* @param eventX
* @param startX
* @param eventY
* @param startY
* @return
*/
protected static distance(eventX: any, startX: any, eventY: any, startY: any): number;
}