UNPKG

igniteui-react-charts

Version:

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

130 lines (129 loc) 5.21 kB
import { TimeAxisLabellingMode } from "./TimeAxisLabellingMode"; import { IgrTimeAxisLabelFormatCollection } from "./igr-time-axis-label-format-collection"; import { IgrCategoryXAxis, IIgrCategoryXAxisProps } from "./igr-category-x-axis"; import { OrdinalTimeXAxis } from "./OrdinalTimeXAxis"; /** * A horizontal axis that uses an ordinal DateTime scale. * On an ordinal time axis, datapoints are aligned according to their order in the ItemsSource, like a category axis. * * You can use the `OrdinalTimeXAxis` to display dates at equidistant. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * * <IgrOrdinalTimeXAxis name="xAxis" label="Date" /> * <IgrNumericYAxis name="yAxis" /> * </IgrDataChart> * ``` * * ```ts * this.series.xAxis = this.ordinalTimeXAxis; * this.series.yAxis = this.numericYAxis; * this.series.xAxisName = "xAxis"; * this.series.yAxisName = "YAxis"; * ``` */ export declare class IgrOrdinalTimeXAxis<P extends IIgrOrdinalTimeXAxisProps = IIgrOrdinalTimeXAxisProps> extends IgrCategoryXAxis<P> { protected createImplementation(): OrdinalTimeXAxis; /** * @hidden */ get i(): OrdinalTimeXAxis; constructor(props: P); /** * Gets or sets the DateTime mapping property for the axis. */ get dateTimeMemberPath(): string; set dateTimeMemberPath(v: string); /** * Gets or sets the labelling mode to use when the automatic label formats are applied. */ get labellingMode(): TimeAxisLabellingMode; set labellingMode(v: TimeAxisLabellingMode); /** * Gets or sets if the current axis is of ordinal axis type */ get isOrdinal(): boolean; private _labelFormats; /** * A list of axis label formats to apply, which are selected according to the visible axis range. * The label format selected will be the one with the largest range smaller than the visible range of the axis. * * You can use the `LabelFormats` for adjusting the labels depending on the range of the time shown by the chart. * * ```ts * let labelFormat = new TimeAxisLabelFormat(); * labelFormat.format = "hh:mm:ss"; * labelFormat.range = 1000; * this.xAxis.labelFormats.add(labelFormat); * labelFormat = new TimeAxisLabelFormat(); * labelFormat.format = "hh:mm"; * labelFormat.range = 60 * 1000; * this.xAxis.labelFormats.add(labelFormat); * labelFormat = new TimeAxisLabelFormat(); * labelFormat.format = "MMM-dd-yy"; * labelFormat.range = 24 * 60 * 60 * 1000; * this.xAxis.labelFormats.add(labelFormat); * labelFormat = new TimeAxisLabelFormat(); * labelFormat.format = "MMM yy"; * labelFormat.range = 365.24 * 24 * 60 * 60 * 1000; * this.xAxis.labelFormats.add(labelFormat); * labelFormat = new TimeAxisLabelFormat(); * labelFormat.format = "yyyy"; * labelFormat.range = 5 * 365 * 24 * 60 * 60 * 1000; * this.xAxis.labelFormats.add(labelFormat); * ``` * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * * <IgrOrdinalTimeXAxis name="xAxis" * label="Date" * labelFormats="labelFormats" /> * <IgrNumericYAxis name="yAxis" /> * </IgrDataChart> * ``` */ get labelFormats(): IgrTimeAxisLabelFormatCollection; set labelFormats(v: IgrTimeAxisLabelFormatCollection); /** * Sets the minimum DateTime value to be displayed on this axis. * This property can be used to constrain the items displayed on the axis, within the range of DateTimes in the ItemsSource. It will ignore any setting outside the actual range of data. */ get minimumValue(): Date; set minimumValue(v: Date); /** * Sets the maximum DateTime value to be displayed on this axis. * This property can be used to constrain the items displayed on the axis, within the range of DateTimes in the ItemsSource. It will ignore any setting outside the actual range of data. */ get maximumValue(): Date; set maximumValue(v: Date); findByName(name: string): any; getValueLabel(value: number): string; } export interface IIgrOrdinalTimeXAxisProps extends IIgrCategoryXAxisProps { /** * Gets or sets the DateTime mapping property for the axis. */ dateTimeMemberPath?: string; /** * Gets or sets the labelling mode to use when the automatic label formats are applied. */ labellingMode?: TimeAxisLabellingMode | string; /** * Sets the minimum DateTime value to be displayed on this axis. * This property can be used to constrain the items displayed on the axis, within the range of DateTimes in the ItemsSource. It will ignore any setting outside the actual range of data. */ minimumValue?: Date; /** * Sets the maximum DateTime value to be displayed on this axis. * This property can be used to constrain the items displayed on the axis, within the range of DateTimes in the ItemsSource. It will ignore any setting outside the actual range of data. */ maximumValue?: Date; }