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.

82 lines (81 loc) 3.16 kB
import { IAxisValueFormatter } from './IAxisValueFormatter'; import { IValueFormatter } from './IValueFormatter'; import { AxisBase } from '../components/AxisBase'; import { BarEntry } from '../data/BarEntry'; import { Entry } from '../data/Entry'; import { PieEntry } from '../data/PieEntry'; import { RadarEntry } from '../data/RadarEntry'; import { BubbleEntry } from '../data/BubbleEntry'; import { CandleEntry } from '../data/CandleEntry'; import { BaseEntry } from '../data/BaseEntry'; /** * Class to format all values before they are drawn as labels. */ export declare abstract class ValueFormatter implements IAxisValueFormatter, IValueFormatter { /** * Called when drawing any label, used to change numbers into formatted strings. * * @param value float to be formatted * @return formatted string label */ getFormattedValue(value: number, entry?: BaseEntry): string; /** * Used to draw axis labels, calls {@link #getFormattedValue} by default. * * @param value float to be formatted * @param axis axis being labeled * @return formatted string label */ getAxisLabel(value: number, axis: AxisBase): string; /** * Used to draw bar labels, calls {@link #getFormattedValue} by default. * * @param value current value to be formatted * @return formatted string label */ getBarLabel(value: any, entry: BarEntry): string; /** * Used to draw stacked bar labels, calls {@link #getFormattedValue} by default. * * @param value current value to be formatted * @param entry stacked entry being labeled, contains all Y values * @return formatted string label */ getBarStackedLabel(value: any, entry: BarEntry): string; /** * Used to draw line and scatter labels, calls {@link #getFormattedValue} by default. * * @param entry point being labeled, contains X value * @return formatted string label */ getPointLabel(value: any, entry: Entry): string; /** * Used to draw pie value labels, calls {@link #getFormattedValue} by default. * * @param value float to be formatted, may have been converted to percentage * @param entry slice being labeled, contains original, non-percentage Y value * @return formatted string label */ getPieLabel(value: any, entry: PieEntry): string; /** * Used to draw radar value labels, calls {@link #getFormattedValue} by default. * * @param entry entry being labeled * @return formatted string label */ getRadarLabel(value: any, entry: RadarEntry): string; /** * Used to draw bubble size labels, calls {@link #getFormattedValue} by default. * * @param entry bubble being labeled, also contains X and Y values * @return formatted string label */ getBubbleLabel(value: any, entry: BubbleEntry): string; /** * Used to draw high labels, calls {@link #getFormattedValue} by default. * * @param entry candlestick being labeled * @return formatted string label */ getCandleLabel(value: any, entry: CandleEntry): string; }