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.

55 lines (54 loc) 1.86 kB
import { Renderer } from './Renderer'; import { Canvas, FontMetrics, Paint } from '@nativescript-community/ui-canvas'; import { Legend } from '../components/Legend'; import { ViewPortHandler } from '../utils/ViewPortHandler'; import { ChartData } from '../data/ChartData'; import { LegendEntry } from '../components/LegendEntry'; import { IDataSet } from '../interfaces/datasets/IDataSet'; export declare class LegendRenderer extends Renderer { /** * palet for the legend labels */ protected mLegendLabelPaint: Paint; /** * palet used for the legend forms */ protected mLegendFormPaint: Paint; /** * the legend object this renderer renders */ protected mLegend: Legend; protected legendFontMetrics: FontMetrics; protected computedEntries: LegendEntry[]; constructor(viewPortHandler: ViewPortHandler, legend: Legend); get formPaint(): Paint; get labelPaint(): Paint; /** * Prepares the legend and calculates all needed forms, labels and colors. * * @param data */ computeLegend(data: ChartData<any, IDataSet<any>>): void; renderLegend(c: Canvas): void; private mLineFormPath; /** * Draws the Legend-form at the given position with the color at the given * index. * * @param c canvas to draw with * @param x position * @param y position * @param entry the entry to render * @param legend the legend context */ protected drawForm(c: Canvas, x: any, y: any, entry: LegendEntry, legend: Legend, paint: Paint): void; /** * Draws the provided label at the given position. * * @param c canvas to draw with * @param x * @param y * @param label the label to draw */ protected drawLabel(c: Canvas, x: any, y: any, label: any, paint: Paint): void; }