UNPKG

igniteui-react-charts

Version:

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

113 lines (112 loc) 2.88 kB
import * as React from 'react'; import { IgrLegendBase, IIgrLegendBaseProps } from './igr-legend-base'; import { Legend } from "./Legend"; import { LegendOrientation } from './LegendOrientation'; import { ReactWrapper } from "igniteui-react-core"; /** * Represents a legend in a IgxDataChartComponent control. * * The `Legend` helps end-user identify visuals of chart series with contextual information related to the data plotted in the chart control. * * ```ts * <IgrDataChart * dataSource={this.data} * ref={this.onChartRef} width="100%" height="400px"> * <IgrCategoryXAxis name="xAxis" label="Country" /> * <IgrNumericYAxis name="yAxis" minimumValue={0} /> * * <IgrLegend ref={this.onLegendRef} * orientation="Horizontal" /> * ``` * * ```ts * public onChartRef(chart: IgrDataChart) { * this.chart = chart; * if (this.legend) { * this.chart.legend = this.legend; * } * } * * public onLegendRef(legend: IgrLegend) { * this.legend = legend; * if (this.chart) { * this.chart.legend = this.legend; * } * } * ``` */ export declare class IgrLegend extends IgrLegendBase<IIgrLegendProps> { container: ReactWrapper; private _elRef; render(): React.DetailedReactHTMLElement<{ className: string; ref: (div: HTMLDivElement) => void; }, HTMLDivElement>; private _getMainRef; componentDidMount(): void; private initializeContent; constructor(props: IIgrLegendProps); private _wrapper; destroy(): void; protected createImplementation(): Legend; get i(): Legend; /** * Gets or sets the current Legend object's orientation. * * ```ts * <IgrLegend ref={this.onLegendRef} * orientation="Horizontal" /> * ``` */ get orientation(): LegendOrientation; set orientation(v: LegendOrientation); /** * Gets or sets color of text * * ```ts * <IgrLegend ref={this.onLegendRef} * textColor= "red" /> * ``` */ get textColor(): string; set textColor(v: string); /** * Gets or sets style of text. * * ```ts * <IgrLegend ref={this.onLegendRef} * textStyle= "9pt Verdana" /> * ``` */ get textStyle(): string; set textStyle(v: string); } export interface IIgrLegendProps extends IIgrLegendBaseProps { /** * Gets or sets the current Legend object's orientation. * * ```ts * <IgrLegend ref={this.onLegendRef} * orientation="Horizontal" /> * ``` */ orientation?: LegendOrientation | string; /** * Gets or sets color of text * * ```ts * <IgrLegend ref={this.onLegendRef} * textColor= "red" /> * ``` */ textColor?: string; /** * Gets or sets style of text. * * ```ts * <IgrLegend ref={this.onLegendRef} * textStyle= "9pt Verdana" /> * ``` */ textStyle?: string; }