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.

100 lines (98 loc) 3.41 kB
import { Canvas, Paint } from '@nativescript-community/ui-canvas'; import { Color } from '@nativescript/core'; import { PieRadarChartBase } from './PieRadarChartBase'; import { YAxis } from '../components/YAxis'; import { RadarData } from '../data/RadarData'; import { RadarDataSet } from '../data/RadarDataSet'; import { Entry } from '../data/Entry'; import { RadarChartRenderer } from '../renderer/RadarChartRenderer'; import { XAxisRendererRadarChart } from '../renderer/XAxisRendererRadarChart'; import { YAxisRendererRadarChart } from '../renderer/YAxisRendererRadarChart'; import { Highlight } from '../highlight/Highlight'; import { BaseCustomRenderer } from '../renderer/DataRenderer'; export interface CustomRenderer extends BaseCustomRenderer { drawRadar?: (c: Canvas, e: Entry, left: number, top: number, right: number, bottom: number, paint: Paint) => void; drawHighlight?: (c: Canvas, e: Highlight, left: number, top: number, right: number, bottom: number, paint: Paint) => void; } /** * Implementation of the RadarChart, a "spidernet"-like chart. It works best * when displaying 5-10 entries per DataSet. * */ export declare class RadarChart extends PieRadarChartBase<Entry, RadarDataSet, RadarData> { renderer: RadarChartRenderer; /** * width of the main web lines */ webLineWidth: number; /** * width of the inner web lines */ webLineWidthInner: number; /** * color for the main web lines */ webColor: Color | string; /** * color for the inner web */ webColorInner: Color | string; /** * transparency the grid is drawn with (0-255) */ webAlpha: number; /** * flag indicating if the web lines should be drawn or not */ drawWeb: boolean; /** * modulus that determines how many labels and web-lines are skipped before the next is drawn */ private mSkipWebLineCount; /** * the object reprsenting the y-axis labels */ yAxis: YAxis; yAxisRenderer: YAxisRendererRadarChart; xAxisRenderer: XAxisRendererRadarChart; protected init(): void; protected calcMinMax(): void; notifyDataSetChanged(): void; draw(c: Canvas): void; /** * Returns the factor that is needed to transform values into pixels. */ get factor(): number; /** * Returns the angle that each slice in the radar chart occupies. */ get sliceAngle(): number; getIndexForAngle(angle: number): number; /** * Sets the number of web-lines that should be skipped on chart web before the * next one is drawn. This targets the lines that come from the center of the RadarChart. * * @param count if count = 1 -> 1 line is skipped in between */ set skipWebLineCount(count: number); /** * Returns the modulus that is used for skipping web-lines. */ get skipWebLineCount(): number; protected get requiredLegendOffset(): number; protected get requiredBaseOffset(): number; get radius(): number; /** * Returns the maximum value this chart can display on it's y-axis. */ get yChartMax(): number; /** * Returns the minimum value this chart can display on it's y-axis. */ get yChartMin(): number; /** * Returns the range of y-values this chart can display. */ get yRange(): number; customRenderer: CustomRenderer; }