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.

136 lines (133 loc) 3.9 kB
import { Paint } from '@nativescript-community/ui-canvas'; import { AxisBase } from './AxisBase'; import { Chart } from '../charts/Chart'; /** * Enum that specifies the axis a DataSet should be plotted against, either LEFT or RIGHT. * */ export declare enum AxisDependency { LEFT = 0, RIGHT = 1 } /** * enum for the position of the y-labels relative to the chart */ export declare enum YAxisLabelPosition { OUTSIDE_CHART = 0, INSIDE_CHART = 1 } /** * Class representing the y-axis labels settings and its entries. Only use the setter methods to * modify it. Do not * access public variables directly. Be aware that not all features the YLabels class provides * are suitable for the * RadarChart. Customizations that affect the value range of the axis need to be applied before * setting data for the * chart. * */ export declare class YAxis extends AxisBase { /** * indicates if the bottom y-label entry is drawn or not */ drawBottomYLabelEntry: boolean; /** * indicates if the top y-label entry is drawn or not */ drawTopYLabelEntry: boolean; /** * flag that indicates if the axis is inverted or not */ inverted: boolean; /** * flag that indicates if the zero-line should be drawn regardless of other grid lines */ drawZeroLine: boolean; /** * flag indicating that auto scale min restriction should be used */ private mUseAutoScaleRestrictionMin; /** * flag indicating that auto scale max restriction should be used */ private mUseAutoScaleRestrictionMax; /** * Color of the zero line */ zeroLineColor: string; /** * Width of the zero line in pixels */ zeroLineWidth: number; /** * axis space from the largest value to the top in percent of the total axis range */ spaceTop: number; /** * axis space from the smallest value to the bottom in percent of the total axis range */ spaceBottom: number; /** * the position of the y-labels relative to the chart */ position: YAxisLabelPosition; /** * the side this axis object represents */ axisDependency: AxisDependency; /** * the minimum width that the axis should take (in dp). * <p/> * default: 0.0 */ minWidth: number; /** * the maximum width that the axis can take (in dp). * use Inifinity for disabling the maximum * default: Number.POSITIVE_INFINITY (no maximum specified) */ maxWidth: number; constructor(position: AxisDependency, chart: WeakRef<Chart<any, any, any>>); /** * This method is deprecated. * Use setAxisMinimum(...) / setAxisMaximum(...) instead. * * @param startAtZero */ setStartAtZero(startAtZero: any): void; /** * This is for normal (not horizontal) charts horizontal spacing. * * @param p * @return */ getRequiredWidthSpace(p: Paint): number; /** * This is for HorizontalBarChart vertical spacing. * * @param p * @return */ getRequiredHeightSpace(p: Paint): number; /** * Returns true if this axis needs horizontal offset, false if no offset is needed. */ get needsOffset(): boolean; /** * Returns true if autoscale restriction for axis min value is enabled */ isUseAutoScaleMinRestriction(): boolean; /** * Sets autoscale restriction for axis min value as enabled/disabled */ setUseAutoScaleMinRestriction(isEnabled: any): void; /** * Returns true if autoscale restriction for axis max value is enabled */ isUseAutoScaleMaxRestriction(): boolean; /** * Sets autoscale restriction for axis max value as enabled/disabled */ setUseAutoScaleMaxRestriction(isEnabled: any): void; calculate(dataMin: any, dataMax: any): void; }