UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

807 lines (801 loc) 21.4 kB
import { HorizontalAlignment_$type } from "igniteui-react-core"; import { VerticalAlignment_$type } from "igniteui-react-core"; import { Visibility_$type } from "igniteui-react-core"; import { ValueAxisLabelLocation_$type } from "./ValueAxisLabelLocation"; import { AngleAxisLabelLocation_$type } from "./AngleAxisLabelLocation"; import { IgrDomainChart } from "./igr-domain-chart"; import { brushToString, stringToBrush, ensureBool, ensureEnum, arrayFindByName } from "igniteui-react-core"; /** * Represents a base class for domain charts with X/Y axes */ export class IgrRadialBaseChart extends IgrDomainChart { /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); } /** * Gets or sets function which takes an context object and returns a formatted label for the X-axis. */ get angleAxisFormatLabel() { return this.i.abp; } set angleAxisFormatLabel(v) { this.i.abp = v; } /** * Gets or sets function which takes a context object and returns a formatted label for the Y-axis. */ get valueAxisFormatLabel() { return this.i.abq; } set valueAxisFormatLabel(v) { this.i.abq = v; } /** * Gets or sets the left margin of labels on the X-axis */ get angleAxisLabelLeftMargin() { return this.i.ac4; } set angleAxisLabelLeftMargin(v) { this.i.ac4 = +v; } /** * Gets or sets the top margin of labels on the X-axis */ get angleAxisLabelTopMargin() { return this.i.ac6; } set angleAxisLabelTopMargin(v) { this.i.ac6 = +v; } /** * Gets or sets the right margin of labels on the X-axis */ get angleAxisLabelRightMargin() { return this.i.ac5; } set angleAxisLabelRightMargin(v) { this.i.ac5 = +v; } /** * Gets or sets the bottom margin of labels on the X-axis */ get angleAxisLabelBottomMargin() { return this.i.ac3; } set angleAxisLabelBottomMargin(v) { this.i.ac3 = +v; } /** * Gets or sets the left margin of labels on the Y-axis */ get valueAxisLabelLeftMargin() { return this.i.adr; } set valueAxisLabelLeftMargin(v) { this.i.adr = +v; } /** * Gets or sets the top margin of labels on the Y-axis */ get valueAxisLabelTopMargin() { return this.i.adt; } set valueAxisLabelTopMargin(v) { this.i.adt = +v; } /** * Gets or sets the right margin of labels on the Y-axis */ get valueAxisLabelRightMargin() { return this.i.ads; } set valueAxisLabelRightMargin(v) { this.i.ads = +v; } /** * Gets or sets the bottom margin of labels on the Y-axis */ get valueAxisLabelBottomMargin() { return this.i.adq; } set valueAxisLabelBottomMargin(v) { this.i.adq = +v; } /** * Gets or sets color of labels on the X-axis */ get angleAxisLabelTextColor() { return brushToString(this.i.ah4); } set angleAxisLabelTextColor(v) { this.i.ah4 = stringToBrush(v); } /** * Gets or sets color of labels on the Y-axis */ get valueAxisLabelTextColor() { return brushToString(this.i.aib); } set valueAxisLabelTextColor(v) { this.i.aib = stringToBrush(v); } /** * Gets the actual color of labels on the X-axis */ get actualAngleAxisLabelTextColor() { return brushToString(this.i.ah2); } set actualAngleAxisLabelTextColor(v) { this.i.ah2 = stringToBrush(v); } /** * Gets the actual color of labels on the Y-axis */ get actualValueAxisLabelTextColor() { return brushToString(this.i.ah3); } set actualValueAxisLabelTextColor(v) { this.i.ah3 = stringToBrush(v); } /** * Gets or sets the margin around a title on the X-axis */ get angleAxisTitleMargin() { return this.i.adh; } set angleAxisTitleMargin(v) { this.i.adh = +v; } /** * Gets or sets the margin around a title on the Y-axis */ get valueAxisTitleMargin() { return this.i.ad4; } set valueAxisTitleMargin(v) { this.i.ad4 = +v; } /** * Gets or sets the left margin of a title on the X-axis */ get angleAxisTitleLeftMargin() { return this.i.adg; } set angleAxisTitleLeftMargin(v) { this.i.adg = +v; } /** * Gets or sets the left margin of a title on the Y-axis */ get valueAxisTitleLeftMargin() { return this.i.ad3; } set valueAxisTitleLeftMargin(v) { this.i.ad3 = +v; } /** * Gets or sets the top margin of a title on the X-axis */ get angleAxisTitleTopMargin() { return this.i.adj; } set angleAxisTitleTopMargin(v) { this.i.adj = +v; } /** * Gets or sets the top margin of a title on the Y-axis */ get valueAxisTitleTopMargin() { return this.i.ad6; } set valueAxisTitleTopMargin(v) { this.i.ad6 = +v; } /** * Gets or sets the right margin of a title on the X-axis */ get angleAxisTitleRightMargin() { return this.i.adi; } set angleAxisTitleRightMargin(v) { this.i.adi = +v; } /** * Gets or sets the right margin of a title on the Y-axis */ get valueAxisTitleRightMargin() { return this.i.ad5; } set valueAxisTitleRightMargin(v) { this.i.ad5 = +v; } /** * Gets or sets the bottom margin of a title on the X-axis */ get angleAxisTitleBottomMargin() { return this.i.adf; } set angleAxisTitleBottomMargin(v) { this.i.adf = +v; } /** * Gets or sets the bottom margin of a title on the Y-axis */ get valueAxisTitleBottomMargin() { return this.i.ad2; } set valueAxisTitleBottomMargin(v) { this.i.ad2 = +v; } /** * Gets or sets color of title on the X-axis */ get angleAxisTitleTextColor() { return brushToString(this.i.aia); } set angleAxisTitleTextColor(v) { this.i.aia = stringToBrush(v); } /** * Gets or sets color of title on the Y-axis */ get valueAxisTitleTextColor() { return brushToString(this.i.aih); } set valueAxisTitleTextColor(v) { this.i.aih = stringToBrush(v); } /** * Gets or sets CSS font property for labels on X-axis */ get angleAxisLabelTextStyle() { return this.i.aez; } set angleAxisLabelTextStyle(v) { this.i.aez = v; } /** * Gets or sets CSS font property for labels on Y-axis */ get valueAxisLabelTextStyle() { return this.i.af7; } set valueAxisLabelTextStyle(v) { this.i.af7 = v; } /** * Gets or sets CSS font property for title on X-axis */ get angleAxisTitleTextStyle() { return this.i.afp; } set angleAxisTitleTextStyle(v) { this.i.afp = v; } /** * Gets or sets CSS font property for title on Y-axis */ get valueAxisTitleTextStyle() { return this.i.agx; } set valueAxisTitleTextStyle(v) { this.i.agx = v; } /** * Gets or sets the format for labels along the X-axis. */ get angleAxisLabel() { return this.i.ad9; } set angleAxisLabel(v) { this.i.ad9 = v; } /** * Gets or sets the property or string from which the labels are derived. */ get valueAxisLabel() { return this.i.aea; } set valueAxisLabel(v) { this.i.aea = v; } /** * Gets or sets the color to apply to major gridlines along the X-axis. */ get angleAxisMajorStroke() { return brushToString(this.i.ah5); } set angleAxisMajorStroke(v) { this.i.ah5 = stringToBrush(v); } /** * Gets or sets the color to apply to major gridlines along the Y-axis. */ get valueAxisMajorStroke() { return brushToString(this.i.aic); } set valueAxisMajorStroke(v) { this.i.aic = stringToBrush(v); } /** * Gets or sets the thickness to apply to major gridlines along the X-axis. */ get angleAxisMajorStrokeThickness() { return this.i.ac7; } set angleAxisMajorStrokeThickness(v) { this.i.ac7 = +v; } /** * Gets or sets the thickness to apply to major gridlines along the Y-axis. */ get valueAxisMajorStrokeThickness() { return this.i.adu; } set valueAxisMajorStrokeThickness(v) { this.i.adu = +v; } /** * Gets or sets the thickness to apply to minor gridlines along the X-axis. */ get angleAxisMinorStrokeThickness() { return this.i.ada; } set angleAxisMinorStrokeThickness(v) { this.i.ada = +v; } /** * Gets or sets the thickness to apply to minor gridlines along the Y-axis. */ get valueAxisMinorStrokeThickness() { return this.i.adx; } set valueAxisMinorStrokeThickness(v) { this.i.adx = +v; } /** * Gets or sets the color to apply to stripes along the X-axis. */ get angleAxisStrip() { return brushToString(this.i.ah7); } set angleAxisStrip(v) { this.i.ah7 = stringToBrush(v); } /** * Gets or sets the color to apply to stripes along the Y-axis. */ get valueAxisStrip() { return brushToString(this.i.aie); } set valueAxisStrip(v) { this.i.aie = stringToBrush(v); } /** * Gets or sets the color to apply to the X-axis line. */ get angleAxisStroke() { return brushToString(this.i.ah8); } set angleAxisStroke(v) { this.i.ah8 = stringToBrush(v); } /** * Gets or sets the color to apply to the Y-axis line. */ get valueAxisStroke() { return brushToString(this.i.aif); } set valueAxisStroke(v) { this.i.aif = stringToBrush(v); } /** * Gets or sets the thickness to apply to the X-axis line. */ get angleAxisStrokeThickness() { return this.i.adb; } set angleAxisStrokeThickness(v) { this.i.adb = +v; } /** * Gets or sets the thickness to apply to the Y-axis line. */ get valueAxisStrokeThickness() { return this.i.ady; } set valueAxisStrokeThickness(v) { this.i.ady = +v; } /** * Gets or sets the length of tickmarks along the X-axis. */ get angleAxisTickLength() { return this.i.adc; } set angleAxisTickLength(v) { this.i.adc = +v; } /** * Gets or sets the length of tickmarks along the Y-axis. */ get valueAxisTickLength() { return this.i.adz; } set valueAxisTickLength(v) { this.i.adz = +v; } /** * Gets or sets the color to apply to tickmarks along the X-axis. */ get angleAxisTickStroke() { return brushToString(this.i.ah9); } set angleAxisTickStroke(v) { this.i.ah9 = stringToBrush(v); } /** * Gets or sets the color to apply to tickmarks along the Y-axis. */ get valueAxisTickStroke() { return brushToString(this.i.aig); } set valueAxisTickStroke(v) { this.i.aig = stringToBrush(v); } /** * Gets or sets the thickness to apply to tickmarks along the X-axis. */ get angleAxisTickStrokeThickness() { return this.i.add; } set angleAxisTickStrokeThickness(v) { this.i.add = +v; } /** * Gets or sets the thickness to apply to tickmarks along the Y-axis. */ get valueAxisTickStrokeThickness() { return this.i.ad0; } set valueAxisTickStrokeThickness(v) { this.i.ad0 = +v; } /** * Gets or sets the Text to display below the X-axis. */ get angleAxisTitle() { return this.i.afg; } set angleAxisTitle(v) { this.i.afg = v; } /** * Gets or sets the Text to display to the left of the Y-axis. */ get valueAxisTitle() { return this.i.ago; } set valueAxisTitle(v) { this.i.ago = v; } /** * Gets or sets the color to apply to minor gridlines along the X-axis. */ get angleAxisMinorStroke() { return brushToString(this.i.ah6); } set angleAxisMinorStroke(v) { this.i.ah6 = stringToBrush(v); } /** * Gets or sets the color to apply to minor gridlines along the Y-axis. */ get valueAxisMinorStroke() { return brushToString(this.i.aid); } set valueAxisMinorStroke(v) { this.i.aid = stringToBrush(v); } /** * Gets or sets the angle of rotation for labels along the X-axis. */ get angleAxisLabelAngle() { return this.i.ac2; } set angleAxisLabelAngle(v) { this.i.ac2 = +v; } /** * Gets or sets the angle of rotation for labels along the Y-axis. */ get valueAxisLabelAngle() { return this.i.adp; } set valueAxisLabelAngle(v) { this.i.adp = +v; } /** * Gets or sets the distance between the X-axis and the bottom of the chart. */ get angleAxisExtent() { return this.i.ac1; } set angleAxisExtent(v) { this.i.ac1 = +v; } /** * Gets or sets the maximum distance between the X-axis and the bottom of the chart. */ get angleAxisMaximumExtent() { return this.i.ac8; } set angleAxisMaximumExtent(v) { this.i.ac8 = +v; } /** * Gets or sets the maximum width between the X-axis and the bottom of the chart, as a percentage of total chart width. */ get angleAxisMaximumExtentPercentage() { return this.i.ac9; } set angleAxisMaximumExtentPercentage(v) { this.i.ac9 = +v; } /** * Gets or sets the distance between the Y-axis and the left edge of the chart. */ get valueAxisExtent() { return this.i.ado; } set valueAxisExtent(v) { this.i.ado = +v; } /** * Gets or sets the distance between the Y-axis and the left edge of the chart. */ get valueAxisMaximumExtent() { return this.i.adv; } set valueAxisMaximumExtent(v) { this.i.adv = +v; } /** * Gets or sets the distance between the Y-axis and the left edge of the chart. */ get valueAxisMaximumExtentPercentage() { return this.i.adw; } set valueAxisMaximumExtentPercentage(v) { this.i.adw = +v; } /** * Gets or sets the angle of rotation for the X-axis title. */ get angleAxisTitleAngle() { return this.i.ade; } set angleAxisTitleAngle(v) { this.i.ade = +v; } /** * Gets or sets the angle of rotation for the Y-axis title. */ get valueAxisTitleAngle() { return this.i.ad1; } set valueAxisTitleAngle(v) { this.i.ad1 = +v; } /** * Gets or sets whether to invert the direction of the X-axis by placing the first data items on the right side of the chart. */ get angleAxisInverted() { return this.i.abx; } set angleAxisInverted(v) { this.i.abx = ensureBool(v); } /** * Gets or sets whether to invert the direction of the Y-axis by placing the minimum numeric value at the top of the chart. */ get valueAxisInverted() { return this.i.aby; } set valueAxisInverted(v) { this.i.aby = ensureBool(v); } /** * Gets or sets Horizontal alignment of the X-axis title. */ get angleAxisTitleAlignment() { return this.i.ahk; } set angleAxisTitleAlignment(v) { this.i.ahk = ensureEnum(HorizontalAlignment_$type, v); } /** * Gets or sets Vertical alignment of the Y-axis title. */ get valueAxisTitleAlignment() { return this.i.ain; } set valueAxisTitleAlignment(v) { this.i.ain = ensureEnum(VerticalAlignment_$type, v); } /** * Gets or sets Horizontal alignment of X-axis labels. */ get angleAxisLabelHorizontalAlignment() { return this.i.ahj; } set angleAxisLabelHorizontalAlignment(v) { this.i.ahj = ensureEnum(HorizontalAlignment_$type, v); } /** * Gets or sets Horizontal alignment of Y-axis labels. */ get valueAxisLabelHorizontalAlignment() { return this.i.ahl; } set valueAxisLabelHorizontalAlignment(v) { this.i.ahl = ensureEnum(HorizontalAlignment_$type, v); } /** * Gets or sets Vertical alignment of X-axis labels. */ get angleAxisLabelVerticalAlignment() { return this.i.ail; } set angleAxisLabelVerticalAlignment(v) { this.i.ail = ensureEnum(VerticalAlignment_$type, v); } /** * Gets or sets Vertical alignment of Y-axis labels. */ get valueAxisLabelVerticalAlignment() { return this.i.aim; } set valueAxisLabelVerticalAlignment(v) { this.i.aim = ensureEnum(VerticalAlignment_$type, v); } /** * Gets or sets Visibility of X-axis labels. */ get angleAxisLabelVisibility() { return this.i.aiq; } set angleAxisLabelVisibility(v) { this.i.aiq = ensureEnum(Visibility_$type, v); } /** * Gets or sets Visibility of Y-axis labels. */ get valueAxisLabelVisibility() { return this.i.air; } set valueAxisLabelVisibility(v) { this.i.air = ensureEnum(Visibility_$type, v); } /** * Gets or sets location of Y-axis labels, relative to the plot area. */ get valueAxisLabelLocation() { return this.i.abu; } set valueAxisLabelLocation(v) { this.i.abu = ensureEnum(ValueAxisLabelLocation_$type, v); } /** * Gets or sets location of X-axis labels, relative to the plot area. */ get angleAxisLabelLocation() { return this.i.abk; } set angleAxisLabelLocation(v) { this.i.abk = ensureEnum(AngleAxisLabelLocation_$type, v); } /** * Gets or sets the format string for the X axis label. */ get angleAxisLabelFormat() { return this.i.aeq; } set angleAxisLabelFormat(v) { this.i.aeq = v; } /** * Gets or sets the format specifiers to use with the AngleAxisLabelFormat string. */ get angleAxisLabelFormatSpecifiers() { return this.i.abh; } set angleAxisLabelFormatSpecifiers(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.abh = v; } /** * Gets or sets the format string for the Y axis label. */ get valueAxisLabelFormat() { return this.i.afy; } set valueAxisLabelFormat(v) { this.i.afy = v; } /** * Gets or sets the format specifiers to use with the ValueAxisLabelFormat string. */ get valueAxisLabelFormatSpecifiers() { return this.i.abi; } set valueAxisLabelFormatSpecifiers(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.abi = v; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.angleAxisLabelFormatSpecifiers != null && arrayFindByName(this.angleAxisLabelFormatSpecifiers, name)) { return arrayFindByName(this.angleAxisLabelFormatSpecifiers, name); } if (this.valueAxisLabelFormatSpecifiers != null && arrayFindByName(this.valueAxisLabelFormatSpecifiers, name)) { return arrayFindByName(this.valueAxisLabelFormatSpecifiers, name); } return null; } /** * Called by the UI framework to provide a UI container for rendering this control. * @param container * The UI container element. */ provideContainer(container) { this.i.provideContainer(container); } /** * Converts the given visual location to a data value. * @param unscaledValue * The x-coordinate of the location to scale. */ getScaledAngle(unscaledValue) { let iv = this.i.adk(unscaledValue); return (iv); } /** * Converts the given data value to a visual location. * @param scaledValue * The data value to un-scale. */ getUnscaledAngle(scaledValue) { let iv = this.i.adm(scaledValue); return (iv); } /** * Converts the given visual location to a data value. * @param unscaledValue * The y-coordinate of the location to scale. */ getScaledValue(unscaledValue) { let iv = this.i.adl(unscaledValue); return (iv); } /** * Converts the given data value to a visual location. * @param scaledValue * The data value to un-scale. */ getUnscaledValue(scaledValue) { let iv = this.i.adn(scaledValue); return (iv); } }