UNPKG

35.5 kBTypeScriptView Raw
1/**
2 * Base class for all Axis
3 */
4/**
5 * ============================================================================
6 * IMPORTS
7 * ============================================================================
8 * @hidden
9 */
10import { Component, IComponentProperties, IComponentDataFields, IComponentAdapters, IComponentEvents } from "../../core/Component";
11import { Container } from "../../core/Container";
12import { Sprite } from "../../core/Sprite";
13import { DataItem, IDataItemAdapters } from "../../core/DataItem";
14import { Grid } from "./Grid";
15import { AxisTick } from "./AxisTick";
16import { AxisLabel } from "./AxisLabel";
17import { AxisFill } from "./AxisFill";
18import { AxisBreak } from "./AxisBreak";
19import { AxisRenderer } from "./AxisRenderer";
20import { Chart } from "../Chart";
21import { XYSeries, XYSeriesDataItem } from "../series/XYSeries";
22import { IPoint, IOrientationPoint } from "../../core/defs/IPoint";
23import { Label } from "../../core/elements/Label";
24import { IRectangle } from "../../core/defs/IRectangle";
25import { PointerOrientation } from "../../core/elements/Tooltip";
26import { IRange } from "../../core/defs/IRange";
27import { Ordering } from "../../core/utils/Order";
28import { SortedListTemplate } from "../../core/utils/SortedList";
29import { List, ListTemplate, IListEvents } from "../../core/utils/List";
30import { IDisposer } from "../../core/utils/Disposer";
31import * as $iter from "../../core/utils/Iterator";
32/**
33 * ============================================================================
34 * DATA ITEM
35 * ============================================================================
36 * @hidden
37 */
38/**
39 * Defines a [[DataItem]] for [[Axis]].
40 *
41 * @see {@link DataItem}
42 */
43export declare class AxisDataItem extends DataItem {
44 /**
45 * Reference to a related [[Grid]] element.
46 */
47 protected _grid: Grid;
48 /**
49 * Reference to a related [[AxisTick]] element.
50 */
51 protected _tick: AxisTick;
52 /**
53 * Reference to a related [[AxisLabel]] element.
54 */
55 protected _label: AxisLabel;
56 /**
57 * Reference to a related [[AxisFill]] element.
58 */
59 protected _axisFill: AxisFill;
60 /**
61 * A mask for axis. We're using [[AxisFill]] since the mask, basically, has
62 * the same shape and features.
63 */
64 protected _mask: AxisFill;
65 /**
66 * Container which might be used to hold some extra items, like series
67 * segments when data item is used for axis range.
68 */
69 protected _contents: Container;
70 /**
71 * A text to be used as label for this data item.
72 */
73 protected _text: string;
74 /**
75 * Holds a physical position of the grid line associated with this data item,
76 * so that it can be used when measuring distance between points, and hiding
77 * some of them so they don't overlap.
78 */
79 point: IPoint;
80 /**
81 * If the data item is within an existing [[AxisBreak]] this property will
82 * hold a reference to that [[AxisBreak]].
83 */
84 _axisBreak: AxisBreak;
85 /**
86 * Defines a type of [[Component]] this data item is used for.
87 */
88 _component: Axis;
89 /**
90 * Used to distinguish from real data points and those data items that are
91 * used for ranges, like `series.axisRanges` or `axis.axisRanges`.
92 *
93 * @ignore Exclude from docs
94 */
95 isRange: boolean;
96 /**
97 * relative position of data item on axis
98 */
99 position: number;
100 /**
101 * @ignore
102 */
103 protected _bullet: Sprite;
104 /**
105 * Allows hiding axis item (tick, label, grid) if it is closer to axis
106 * beginning than this relative position (0-1).
107 *
108 * For axis labels it overrides `minLabelPosition` if set.
109 *
110 * ```TypeScript
111 * // Hide all ticks and labels closer than 20% to axis beginning.
112 * axis.dataItems.template.minPosition = 0.2;
113 * ```
114 * ```JavaScript
115 * // Hide all ticks and labels closer than 20% to axis beginning.
116 * axis.dataItems.template.minPosition = 0.2;
117 * ```
118 * ```JSON
119 * {
120 * // ...
121 * "xAxes": [{
122 * // ...
123 * // Hide all ticks and labels closer than 20% to axis beginning.
124 * "dataItems": {
125 * "minPosition": 0.2
126 * }
127 * }]
128 * }
129 * ```
130 *
131 * @since 4.5.11
132 */
133 minPosition?: number;
134 /**
135 * Allows hiding axis item (tick, label, grid) if it is closer to axis
136 * end than this relative position (0-1).
137 *
138 * For axis labels it overrides `maxLabelPosition` if set.
139 *
140 * ```TypeScript
141 * // Hide all ticks and labels closer than 20% to axis end.
142 * axis.dataItems.template.maxPosition = 0.8;
143 * ```
144 * ```JavaScript
145 * // Hide all ticks and labels closer than 20% to axis end.
146 * axis.dataItems.template.maxPosition = 0.8;
147 * ```
148 * ```JSON
149 * {
150 * // ...
151 * "xAxes": [{
152 * // ...
153 * // Hide all ticks and labels closer than 20% to axis end.
154 * "dataItems": {
155 * "maxPosition": 0.8
156 * }
157 * }]
158 * }
159 * ```
160 *
161 * @since 4.5.11
162 */
163 maxPosition?: number;
164 /**
165 * Constructor
166 */
167 constructor();
168 /**
169 * Actual index of the axis data item.
170 *
171 * @since 4.7.8
172 */
173 itemIndex: number;
174 /**
175 * A [[Grid]] element associated with this data item.
176 *
177 * If there is no grid element associated with data item, a new one is
178 * created and returned.
179 *
180 * @param grid Grid element
181 */
182 /**
183 * @return Grid element
184 */
185 grid: Grid;
186 /**
187 * An [[AxisTick]] element associated with this data item.
188 *
189 * If there is no tick element associated with data item, a new one is
190 * created and returned.
191 *
192 * @param tick Tick element
193 */
194 /**
195 * @return Tick element
196 */
197 tick: AxisTick;
198 /**
199 * An [[AxisLabel]] element associated with this data item.
200 *
201 * If there is no label element associated with data item, a new one is
202 * created and returned.
203 *
204 * @param label Label element
205 */
206 /**
207 * @return Label element
208 */
209 label: AxisLabel;
210 /**
211 * An [[AxisFill]] associated element with this data item.
212 *
213 * If there is no fill element associated with data item, a new one is
214 * created and returned.
215 *
216 * @param label Label element
217 */
218 /**
219 * @return Label element
220 */
221 axisFill: AxisFill;
222 /**
223 * Text to be used as data item's label.
224 *
225 * @param text Text label
226 */
227 /**
228 * @return Text label
229 */
230 text: string;
231 /**
232 * Data item's mask.
233 *
234 * @return Mask
235 */
236 readonly mask: AxisFill;
237 /**
238 * Returns a [[Container]] to place all visual elements, related to data item
239 * in.
240 *
241 * If there is no Container, a new one is created.
242 *
243 * @return Contents container
244 */
245 readonly contents: Container;
246 /**
247 * An [[AxisBreak]] this data item falls within.
248 *
249 * @param axisBreak Axis break
250 */
251 /**
252 * @return Axis break
253 */
254 axisBreak: this["_axisBreak"];
255 /**
256 * Re-draws the element.
257 *
258 * @ignore Exclude from docs
259 */
260 validate(): void;
261 /**
262 * Appends data item's elements to the parent [[Container]].
263 *
264 * @ignore Exclude from docs
265 */
266 appendChildren(): void;
267 /**
268 * Checks if data item has particular property set.
269 *
270 * @param prop Property name
271 * @return Property set?
272 */
273 protected hasProperty(prop: string): boolean;
274 /**
275 * Copies all parameters from another [[AxisDataItem]].
276 *
277 * @param source Source AxisDataItem
278 */
279 copyFrom(source: this): void;
280 /**
281 * Sets visibility of the Data Item.
282 *
283 * @param value Data Item
284 */
285 setVisibility(value: boolean, noChangeValues?: boolean): void;
286 /**
287 * Set it to an instance of any [[Sprite]]. It will be displayed as an axis
288 * bullet in the middle of the cell, or specific value.
289 *
290 * If you need position bullet relatively to the cell, use [[AxisBullet]]
291 * instead. It has a `location` property which can be used to indicate
292 * precise relative location within cell/range.
293 *
294 * Also, [[AxisBullet]] is a [[Container]] so you can push any other element
295 * into it.
296 *
297 * NOTE: `location` is relative to the parent axis range's scope, i.e.
298 * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`
299 * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).
300 *
301 * ```TypeScript
302 * let range = dateAxis.axisRanges.create();
303 * range.date = new Date(2018, 0, 5);
304 *
305 * let flag = new am4plugins_bullets.FlagBullet();
306 * flag.label.text = "Hello";
307 *
308 * range.bullet = flag;
309 * ```
310 * ```JavaScript
311 * var range = dateAxis.axisRanges.create();
312 * range.date = new Date(2018, 0, 5);
313 *
314 * var flag = new am4plugins_bullets.FlagBullet();
315 * flag.label.text = "Hello";
316 *
317 * range.bullet = flag;
318 * ```
319 * ```JSON
320 * {
321 * // ...
322 * "xAxes": [{
323 * "type": "DateAxis",
324 * // ...
325 * "axisRanges": [{
326 * "date": new Date(2018, 0, 5),
327 * "bullet: {
328 * "type": "FlagBullet",
329 * "label": {
330 * "text": "Hello"
331 * }
332 * }
333 * }]
334 * }]
335 * }
336 * ```
337 *
338 * @since 4.5.9
339 * @param value Bullet
340 */
341 /**
342 * @return Bullet
343 */
344 bullet: Sprite;
345}
346/**
347 * Defines adapters for [[AxisDataItem]]
348 * Includes both the [[DataItemAdapter]] definitions and properties
349 * @see {@link DataItemAdapter}
350 */
351export interface IAxisDataItemAdapters extends IDataItemAdapters {
352}
353/**
354 * ============================================================================
355 * REQUISITES
356 * ============================================================================
357 * @hidden
358 */
359/**
360 * Defines named positions for data item's location within [[Axis]].
361 */
362export declare enum AxisItemLocation {
363 Start = 0,
364 Middle = 0.5,
365 End = 1
366}
367/**
368 * Defines data fields for [[Axis]].
369 */
370export interface IAxisDataFields extends IComponentDataFields {
371}
372/**
373 * Defines properties for [[Axis]].
374 */
375export interface IAxisProperties extends IComponentProperties {
376 /**
377 * Axis start location.
378 *
379 * * 0 - None of the first cell is shown. (don't do that)
380 * * 0.5 - Half of the first cell is shown.
381 * * 1 - Full first cell is shown.
382 *
383 * @param value Location (0-1)
384 */
385 startLocation?: number;
386 /**
387 * Axis end location.
388 *
389 * * 0 - None of the last cell is shown. (don't do that)
390 * * 0.5 - Half of the last cell is shown.
391 * * 1 - Full last cell is shown.
392 *
393 * @param value Location (0-1)
394 */
395 endLocation?: number;
396 /**
397 * Indicates if cusor's tooltip should be shown on this Axis.
398 */
399 cursorTooltipEnabled?: boolean;
400 /**
401 * Normally, when axis is zoomed in, a zoom out button is shown by a chart,
402 * and vice versa: when axis is zoomed out completely, zoom out button is
403 * hidden.
404 *
405 * Setting this to `false` will disable this behavior. Zooming in our out
406 * this axis will not reveal or hide zoom out button.
407 *
408 * @default true
409 */
410 toggleZoomOutButton?: boolean;
411 /**
412 * Indicates if axis' tooltip should be hidden while axis range is animating
413 * (zooming)
414 *
415 * @since 4.7.16
416 * @default true
417 */
418 hideTooltipWhileZooming?: boolean;
419 zoomable?: boolean;
420}
421/**
422 * Defines events for [[Axis]].
423 */
424export interface IAxisEvents extends IComponentEvents {
425 /**
426 * Invoked when available axis lenght changes, e.g. after resizing the whole
427 * chart.
428 */
429 lengthchanged: {};
430}
431/**
432 * Defines adapters for [[Axis]].
433 *
434 * @see {@link Adapter}
435 */
436export interface IAxisAdapters extends IComponentAdapters, IAxisProperties {
437 /**
438 * Applied to the tooltip text before it is shown.
439 */
440 getTooltipText: string;
441}
442/**
443 * ============================================================================
444 * MAIN CLASS
445 * ============================================================================
446 * @hidden
447 */
448/**
449 * A base class for all Axis elements.
450 *
451 * @see {@link IAxisEvents} for a list of available Events
452 * @see {@link IAxisAdapters} for a list of available Adapters
453 */
454export declare class Axis<T extends AxisRenderer = AxisRenderer> extends Component {
455 /**
456 * Defines list of data fields.
457 */
458 _dataFields: IAxisDataFields;
459 /**
460 * Defines available properties.
461 */
462 _properties: IAxisProperties;
463 /**
464 * Defines available adapters.
465 */
466 _adapter: IAxisAdapters;
467 /**
468 * Defines the type of the [[DataItem]] used in the class.
469 */
470 _dataItem: AxisDataItem;
471 /**
472 * A list of Axis Ranges.
473 */
474 protected _axisRanges: ListTemplate<this["_dataItem"]>;
475 /**
476 * Defines the type of the axis breaks.
477 */
478 _axisBreak: AxisBreak;
479 /**
480 * Defines available events.
481 */
482 _events: IAxisEvents;
483 /**
484 * A [[Label]] instance that is used for Axis title label.
485 */
486 protected _title: Label;
487 /**
488 * "X", "Y", etc.
489 *
490 * This is needed so that Axis knows which of the values from series' data
491 * items it should use.
492 *
493 * @ignore Exclude from docs
494 */
495 axisLetter: string;
496 /**
497 * A reference to chart the axis is for.
498 */
499 protected _chart: Chart;
500 /**
501 * A type for renderer used for this Axis.
502 */
503 _renderer: T;
504 /**
505 * Number of Grid elements on the axis.
506 */
507 protected _gridCount: number;
508 /**
509 * A list of [[XYSeries]] that are using this Axis.
510 */
511 protected _series: List<XYSeries>;
512 /**
513 * Holds the length of the Axis, so that we can check if it changed after
514 * other changes and we need to update layouts.
515 */
516 protected _prevLength: number;
517 /**
518 * A list of Axis Breaks associated with this Axis.
519 */
520 protected _axisBreaks: SortedListTemplate<this["_axisBreak"]>;
521 /**
522 * A reference to the Iterator for Axis' data items.
523 */
524 protected _dataItemsIterator: $iter.ListIterator<this["_dataItem"]>;
525 /**
526 * A name of the data field this Axis looks for its data in, e.g. "category".
527 *
528 * @ignore Exclude from docs
529 */
530 axisFieldName: string;
531 /**
532 * [currentItemStartPoint description]
533 *
534 * @ignore Exclude from docs
535 */
536 currentItemStartPoint: IPoint;
537 /**
538 * [currentItemEndPoint description]
539 *
540 * @ignore Exclude from docs
541 */
542 currentItemEndPoint: IPoint;
543 protected _tooltipPosition: number;
544 /**
545 * @ignore
546 */
547 relativePositionSprite?: Sprite;
548 /**
549 * Holds reference to a function that accepts a DataItem and its index as
550 * parameters.
551 *
552 * It can either return a fill opacity for a fill, or manipulate data item
553 * directly, to create various highlighting scenarios.
554 *
555 * For example, you can set it up to highlight only weekends on a
556 * [[DateAxis]].
557 */
558 fillRule(dataItem: this["_dataItem"], index?: number): void;
559 /**
560 * Full length of the axis, in pixels.
561 *
562 * @readonly
563 */
564 axisFullLength: number;
565 /**
566 * Ghost label is used to prevent chart shrinking/expanding when zooming or
567 * when data is invalidated. You can set custom text on it so that it would
568 * be bigger/smaller,
569 */
570 ghostLabel: AxisLabel;
571 /**
572 * Specifies if axis should be automatically disposed when removing from
573 * chart's axis list.
574 *
575 * @default true
576 */
577 autoDispose: boolean;
578 /**
579 * @ignore
580 */
581 protected _axisItemCount: number;
582 /**
583 * Constructor
584 */
585 constructor();
586 /**
587 * Returns a new/empty DataItem of the type appropriate for this object.
588 *
589 * @see {@link DataItem}
590 * @return Data Item
591 */
592 protected createDataItem(): this["_dataItem"];
593 /**
594 * Invalidates layout.
595 *
596 * @ignore Exclude from docs
597 */
598 invalidateLayout(): void;
599 /**
600 * Invalidates series of this axis.
601 */
602 invalidateSeries(): void;
603 /**
604 * Override to cancel super call for data element validation.
605 * @ignore
606 */
607 validateDataElements(): void;
608 /**
609 * Recalculates the number of grid items on the axis.
610 */
611 protected updateGridCount(): void;
612 /**
613 * Redraws the element.
614 *
615 * @ignore Exclude from docs
616 */
617 validateLayout(): void;
618 /**
619 * Initializes Axis' renderer.
620 *
621 * @ignore Exclude from docs
622 */
623 initRenderer(): void;
624 /**
625 * Adds a data item to the Axis.
626 *
627 * @param dataItem Data item
628 */
629 appendDataItem(dataItem: this["_dataItem"]): void;
630 /**
631 * Redraws Axis' related items.
632 *
633 * @ignore Exclude from docs
634 */
635 validate(): void;
636 /**
637 * Redars Axis ranges.
638 *
639 * @ignore Exclude from docs
640 */
641 validateAxisRanges(): void;
642 /**
643 * Invalidates all axis breaks, so they are redrawn.
644 *
645 * @ignore Exclude from docs
646 */
647 validateBreaks(): void;
648 /**
649 * Associates an Axis break with this Axis, after it is inserted into
650 * `axisBreaks`.
651 *
652 * @ignore Exclude from docs
653 * @param event Event
654 */
655 processBreak(event: IListEvents<this["_axisBreak"]>["inserted"]): void;
656 /**
657 * Registers a [[XYSeries]] element with this Axis.
658 *
659 * Returns a [[Disposer]] for all events, added to Series for watching
660 * changes in Axis, and vice versa.
661 * @ignore
662 * @param series Series
663 * @return Event disposer
664 */
665 registerSeries(series: XYSeries): IDisposer;
666 /**
667 * An [[AxisRenderer]] to be used to render this Axis.
668 *
669 * Please note that most of the settings, related to Axis' appearance are set
670 * via its renderer. Not directly on the Axis.
671 *
672 * E.g.:
673 *
674 * ```TypeScript
675 * axis.renderer.inside = true;
676 * axis.renderer.minLabelPosition = 0.1;
677 * axis.renderer.maxLabelPosition = 0.9;
678 * ```
679 * ```JavaScript
680 * axis.renderer.inside = true;
681 * axis.renderer.minLabelPosition = 0.1;
682 * axis.renderer.maxLabelPosition = 0.9;
683 * ```
684 *
685 * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/} for more info
686 * @param renderer Renderer
687 */
688 /**
689 * @return Renderer
690 */
691 renderer: this["_renderer"];
692 /**
693 * Converts a relative position to angle. (for circular axes)
694 *
695 * @param position Position (0-1)
696 * @return Angle
697 */
698 positionToAngle(position: number): number;
699 /**
700 * Converts pixel coordinates to a relative position. (0-1)
701 *
702 * @param point Coorinates (px)
703 * @return Position (0-1)
704 */
705 pointToPosition(point: IPoint): number;
706 /**
707 * Converts relative position to coordinate.
708 *
709 * @since 4.7.15
710 * @param position (0-1)
711 * @return coordinate (px)
712 */
713 positionToCoordinate(position: number): number;
714 /**
715 * [getAnyRangePath description]
716 *
717 * @ignore Exclude from docs
718 * @todo Description
719 * @param start [description]
720 * @param end [description]
721 * @return [description]
722 */
723 getAnyRangePath(start: any, end: any): string;
724 /**
725 * Converts any positional parameter to a relative position on axis.
726 *
727 * @todo Description (review)
728 * @param value Pisition
729 * @return Position (0-1)
730 */
731 anyToPosition(value: any): number;
732 /**
733 * Converts any positional parameter to a relative position on axis.
734 *
735 * @todo Description (review)
736 * @param value Pisition
737 * @return Orientation point
738 */
739 anyToPoint(value: any): IOrientationPoint;
740 /**
741 * [getPositionRangePath description]
742 *
743 * @ignore Exclude from docs
744 * @todo Description
745 * @param startPosition [description]
746 * @param endPosition [description]
747 * @return [description]
748 */
749 getPositionRangePath(startPosition: number, endPosition: number): string;
750 /**
751 * Actual axis length in pixels.
752 *
753 * @return Axis length (px)
754 */
755 readonly axisLength: number;
756 /**
757 * Indicates if axis should display a tooltip for chart's cursor.
758 *
759 * @param value Display tooltip?
760 */
761 /**
762 * @return Display tooltip?
763 */
764 cursorTooltipEnabled: boolean;
765 /**
766 * Normally, when axis is zoomed in, a zoom out button is shown by a chart,
767 * and vice versa: when axis is zoomed out completely, zoom out button is
768 * hidden.
769 *
770 * Setting this to `false` will disable this behavior. Zooming in our out
771 * this axis will not reveal or hide zoom out button.
772 *
773 * @default true
774 * @since 4.6.2
775 * @param value Toggle zoom out button?
776 */
777 /**
778 * @return Toggle zoom out button?
779 */
780 toggleZoomOutButton: boolean;
781 /**
782 * Hides element's [[Tooltip]].
783 *
784 * @see {@link Tooltip}
785 */
786 hideTooltip(duration?: number): void;
787 /**
788 * Shows Axis tooltip at specific relative position within Axis. (0-1)
789 *
790 * @param position Position (0-1)
791 * @param local or global position
792 */
793 showTooltipAtPosition(position: number, local?: boolean): void;
794 /**
795 * Converts relative position (0-1) to Axis position with zoom level and
796 * inversed taken into account.
797 *
798 * @param position Global position (0-1)
799 * @return Position within Axis (0-1)
800 */
801 toAxisPosition(position: number): number;
802 /**
803 * Converts position on the axis with zoom level and
804 * inversed taken into account to global position.
805 *
806 * @param position Axis position (0-1)
807 * @return Global position (0-1)
808 */
809 toGlobalPosition(position: number): number;
810 /**
811 * Returns text to be used for cursor's Axis tooltip.
812 *
813 * This is a placeholder to override for extending classes.
814 *
815 * @ignore Exclude from docs
816 * @param position Position coordinate (px)
817 * @return Label text
818 */
819 getTooltipText(position: number): string;
820 /**
821 * Updates Axis' tooltip's position and possibly size, and pointer (stem)
822 * place.
823 *
824 * @ignore Exclude from docs
825 * @param pointerOrientation Pointer (stem) orientation
826 * @param boundingRectangle A rectangle for tooltip to fit within
827 */
828 updateTooltip(pointerOrientation: PointerOrientation, boundingRectangle: IRectangle): void;
829 /**
830 * [roundPosition description]
831 *
832 * @ignore Exclude from docs
833 * @todo Description
834 * @param position Relative position
835 * @param location Location on axis
836 * @return Rounded position
837 */
838 roundPosition(position: number, location: AxisItemLocation, axisLocation?: number): number;
839 /**
840 * [getCellStartPosition description]
841 *
842 * @ignore Exclude from docs
843 * @todo Description
844 * @param position [description]
845 * @return [description]
846 */
847 getCellStartPosition(position: number): number;
848 /**
849 * [getCellEndPosition description]
850 *
851 * @ignore Exclude from docs
852 * @todo Description
853 * @param position [description]
854 * @return [description]
855 */
856 getCellEndPosition(position: number): number;
857 /**
858 * A list of axis ranges for this Axis.
859 *
860 * @return Axis ranges
861 */
862 readonly axisRanges: ListTemplate<this["_dataItem"]>;
863 /**
864 * Decorates an axis range after it has been added to the axis range list.
865 *
866 * @param event Event
867 */
868 protected processAxisRange(event: IListEvents<this["_dataItem"]>["inserted"]): void;
869 /**
870 * A list of axis breaks on this Axis.
871 *
872 * @return Axis breaks.
873 */
874 readonly axisBreaks: SortedListTemplate<this["_axisBreak"]>;
875 /**
876 * Creates a new axis break.
877 *
878 * @return Axis break
879 */
880 protected createAxisBreak(): this["_axisBreak"];
881 /**
882 * A list of Series currently associated with this Axis.
883 *
884 * @return Series
885 */
886 readonly series: List<XYSeries>;
887 /**
888 * Processes Series' data items.
889 *
890 * This is a placeholder to override for extending classes.
891 *
892 * @ignore Exclude from docs
893 */
894 processSeriesDataItems(): void;
895 /**
896 * Processes Series' single data item.
897 *
898 * This is a placeholder to override for extending classes.
899 *
900 * @ignore Exclude from docs
901 * @param dataItem Data item
902 */
903 processSeriesDataItem(dataItem: XYSeriesDataItem, axisLetter?: string): void;
904 /**
905 * Post-processes Serie's data items.
906 *
907 * This is a placeholder to override for extending classes.
908 *
909 * @ignore Exclude from docs
910 */
911 postProcessSeriesDataItems(series?: XYSeries): void;
912 /**
913 * Post-processes Serie's single data item.
914 *
915 * This is a placeholder to override for extending classes.
916 *
917 * @ignore Exclude from docs
918 * @param dataItem Data item
919 */
920 postProcessSeriesDataItem(dataItem: XYSeriesDataItem): void;
921 /**
922 * Updates Axis based on all Series that might influence it.
923 *
924 * Called by Series after Series data is validated.
925 *
926 * This is a placeholder to override for extending classes.
927 *
928 * @ignore Exclude from docs
929 */
930 updateAxisBySeries(): void;
931 /**
932 * Hides unused data items.
933 *
934 * @ignore Exclude from docs
935 */
936 hideUnusedDataItems(): void;
937 /**
938 * Returns a Series' data item that corresponds to specific position on Axis.
939 *
940 * This is a placeholder to override for extending classes.
941 *
942 * @ignore Exclude from docs
943 * @param series Series
944 * @param position Position (0-1)
945 * @param findNearest Should axis try to find nearest tooltip if there is no data item at exact position
946 * @return Data item
947 */
948 getSeriesDataItem(series: XYSeries, position: number, findNearest?: boolean): XYSeriesDataItem;
949 /**
950 * Returns an angle that corresponds to specific position on axis.
951 *
952 * This is a placeholder to override for extending classes.
953 *
954 * @ignore Exclude from docs
955 * @todo Description (review)
956 * @param dataItem Data item
957 * @param key ???
958 * @param location Location
959 * @param stackKey ???
960 * @return Angle
961 */
962 getAngle(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
963 /**
964 * [getX description]
965 *
966 * This is a placeholder to override for extending classes.
967 *
968 * @ignore Exclude from docs
969 * @todo Description (review)
970 * @param dataItem [description]
971 * @param key [description]
972 * @param location [description]
973 * @param stackKey [description]
974 * @return [description]
975 */
976 getX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
977 /**
978 * [getX description]
979 *
980 * This is a placeholder to override for extending classes.
981 *
982 * @ignore Exclude from docs
983 * @todo Description (review)
984 * @param dataItem [description]
985 * @param key [description]
986 * @param location [description]
987 * @param stackKey [description]
988 * @return [description]
989 */
990 getPositionX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
991 /**
992 * [getY description]
993 *
994 * This is a placeholder to override for extending classes.
995 *
996 * @ignore Exclude from docs
997 * @todo Description (review)
998 * @param dataItem [description]
999 * @param key [description]
1000 * @param location [description]
1001 * @param stackKey [description]
1002 * @return [description]
1003 */
1004 getY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
1005 /**
1006 * [getY description]
1007 *
1008 * This is a placeholder to override for extending classes.
1009 *
1010 * @ignore Exclude from docs
1011 * @todo Description (review)
1012 * @param dataItem [description]
1013 * @param key [description]
1014 * @param location [description]
1015 * @param stackKey [description]
1016 * @return [description]
1017 */
1018 getPositionY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
1019 /**
1020 * Coordinates of the actual axis start.
1021 *
1022 * @ignore Exclude from docs
1023 * @return Base point coordinates
1024 */
1025 readonly basePoint: IPoint;
1026 /**
1027 * [dataChangeUpdate description]
1028 *
1029 * This is a placeholder to override for extending classes.
1030 *
1031 * @ignore Exclude from docs
1032 * @todo Description
1033 */
1034 dataChangeUpdate(): void;
1035 /**
1036 * [dataChangeUpdate description]
1037 *
1038 *
1039 * @ignore Exclude from docs
1040 * @todo Description
1041 */
1042 seriesDataChangeUpdate(series: XYSeries): void;
1043 /**
1044 * Removes axis breaks that fall between `min` and `max` (???)
1045 *
1046 * @ignore Exclude from docs
1047 * @todo Description (review)
1048 * @param min Start value
1049 * @param max End value
1050 * @return Spread o
1051 */
1052 protected adjustDifference(min: number, max: number): number;
1053 /**
1054 * Checks if specific value falls within a break.
1055 *
1056 * Returns [[AxisBreak]] the value falls into.
1057 *
1058 * @param value Value to check
1059 * @return Axis break
1060 */
1061 protected isInBreak(value: number): this["_axisBreak"];
1062 /**
1063 * [fixAxisBreaks description]
1064 *
1065 * @ignore Exclude from docs
1066 * @todo Description
1067 */
1068 protected fixAxisBreaks(): void;
1069 /**
1070 * We need start/end indexes of axes to be 0 - `dataItems.length`.
1071 *
1072 * Yes, also for category axis, this helps to avoid jumping of categories
1073 * while scrolling and does not do a lot of extra work as we use
1074 * protected `_startIndex` and `_endIndex` when working with items.
1075 *
1076 * @hidden
1077 */
1078 /**
1079 * [startIndex description]
1080 *
1081 * @ignore Exclude from docs
1082 * @todo Description
1083 * @param value [description]
1084 */
1085 /**
1086 * @ignore Exclude from docs
1087 * @return [description]
1088 */
1089 startIndex: number;
1090 /**
1091 * [endIndex description]
1092 *
1093 * @ignore Exclude from docs
1094 * @todo Description
1095 * @param value [description]
1096 */
1097 /**
1098 * @ignore Exclude from docs
1099 * @return [description]
1100 */
1101 endIndex: number;
1102 /**
1103 * Returns a formatted label based on position.
1104 *
1105 * Individual axis types should override this method to generate a label
1106 * that is relevant to axis type.
1107 *
1108 * Please note that `position` represents position within axis which may be
1109 * zoomed and not correspond to Cursor's `position`.
1110 *
1111 * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.
1112 *
1113 * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.
1114 * @param position Relative position on axis (0-1)
1115 * @return Position label
1116 */
1117 getPositionLabel(position: number): string;
1118 /**
1119 * A Chart this Axis belongs to.
1120 *
1121 * @param value Chart
1122 */
1123 /**
1124 * @return Chart
1125 */
1126 chart: Chart;
1127 /**
1128 * Creates a data item for a Series range.
1129 *
1130 * @param series Target Series
1131 * @return Range data item
1132 */
1133 createSeriesRange(series: XYSeries): this["_dataItem"];
1134 /**
1135 * Copies all properties and related data from a different instance of Axis.
1136 *
1137 * @param source Source Axis
1138 */
1139 copyFrom(source: this): void;
1140 /**
1141 * Resets internal iterator.
1142 */
1143 protected resetIterators(): void;
1144 /**
1145 * Processes JSON-based config before it is applied to the object.
1146 *
1147 * @ignore Exclude from docs
1148 * @param config Config
1149 */
1150 processConfig(config?: {
1151 [index: string]: any;
1152 }): void;
1153 /**
1154 * Ordering function used in JSON setup.
1155 *
1156 * @param a Item A
1157 * @param b Item B
1158 * @return Order
1159 */
1160 protected configOrder(a: string, b: string): Ordering;
1161 /**
1162 * Axis start location. Works on Date/Category axis, doesn't work on Value axis.
1163 *
1164 * * 0 - Full first cell is shown.
1165 * * 0.5 - Half of first cell is shown.
1166 * * 1 - None of the first cell is visible. (you probably don't want that)
1167 *
1168 * @param value Location (0-1)
1169 */
1170 /**
1171 * @return Location (0-1)
1172 */
1173 startLocation: number;
1174 /**
1175 * Axis end location. Works on Date/Category axis, doesn't work on Value axis.
1176 *
1177 * * 0 - None of the last cell is shown. (don't do that)
1178 * * 0.5 - Half of the last cell is shown.
1179 * * 1 - Full last cell is shown.
1180 *
1181 * @param value Location (0-1)
1182 */
1183 /**
1184 * @return Location (0-1)
1185 */
1186 endLocation: number;
1187 protected setDisabled(value: boolean): boolean;
1188 /**
1189 * A reference to a [[Label]] element which serves as a title to the axis.
1190 *
1191 * When axis is created it aleready has an element, so you can just modify
1192 * it.
1193 *
1194 * Or you can replace it with your own instance of `Label`.
1195 *
1196 * @param value Title label
1197 */
1198 /**
1199 * @return Title label
1200 */
1201 title: Label;
1202 /**
1203 * Indicates if axis' tooltip should be hidden while axis range is animating
1204 * (zooming)
1205 *
1206 * @default true
1207 * @since 4.7.16
1208 * @param value Hide tooltip while zooming?
1209 */
1210 /**
1211 * @return Hide tooltip while zooming?
1212 */
1213 hideTooltipWhileZooming: boolean;
1214 /**
1215 * Should the axis be zoomed with scrollbar/cursor?
1216 *
1217 * @default true
1218 * @since 4.9.28
1219 * @param value Zoomable?
1220 */
1221 /**
1222 * @return Zoomable?
1223 */
1224 zoomable: boolean;
1225}
1226
\No newline at end of file