1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import { ValueAxis, ValueAxisDataItem, IValueAxisProperties, IValueAxisDataFields, IValueAxisAdapters, IValueAxisEvents } from "./ValueAxis";
|
11 | import { AxisItemLocation } from "./Axis";
|
12 | import { AxisRenderer } from "./AxisRenderer";
|
13 | import { List } from "../../core/utils/List";
|
14 | import { Dictionary } from "../../core/utils/Dictionary";
|
15 | import { IPoint, IOrientationPoint } from "../../core/defs/IPoint";
|
16 | import { XYSeries, XYSeriesDataItem } from "../series/XYSeries";
|
17 | import { LineSeriesDataItem } from "../series/LineSeries";
|
18 | import { TimeUnit } from "../../core/defs/TimeUnit";
|
19 | import { ITimeInterval } from "../../core/defs/ITimeInterval";
|
20 | import { IMinMaxStep } from "./ValueAxis";
|
21 | import { DateAxisBreak } from "./DateAxisBreak";
|
22 | import { IRange } from "../../core/defs/IRange";
|
23 | import { DateFormatter } from "../../core/formatters/DateFormatter";
|
24 | import { Animation } from "../../core/utils/Animation";
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | export declare class DateAxisDataItem extends ValueAxisDataItem {
|
37 | |
38 |
|
39 |
|
40 | _component: DateAxis;
|
41 | |
42 |
|
43 |
|
44 | constructor();
|
45 | /**
|
46 | * Date position of the data item.
|
47 | *
|
48 | * @param date Date
|
49 | */
|
50 | /**
|
51 | * @return Date
|
52 | */
|
53 | date: Date;
|
54 | /**
|
55 | * End date for data item.
|
56 | *
|
57 | * @param date End date
|
58 | */
|
59 | /**
|
60 | * @return End date
|
61 | */
|
62 | endDate: Date;
|
63 | }
|
64 | /**
|
65 | * ============================================================================
|
66 | * REQUISITES
|
67 | * ============================================================================
|
68 | * @hidden
|
69 | */
|
70 | /**
|
71 | * Defines data fields for [[DateAxis]].
|
72 | */
|
73 | export interface IDateAxisDataFields extends IValueAxisDataFields {
|
74 | |
75 |
|
76 |
|
77 | date?: string;
|
78 | }
|
79 |
|
80 |
|
81 |
|
82 | export interface IDateAxisProperties extends IValueAxisProperties {
|
83 | |
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | skipEmptyPeriods?: boolean;
|
90 | |
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 | markUnitChange?: boolean;
|
98 | |
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 | snapTooltip?: boolean;
|
105 | |
106 |
|
107 |
|
108 |
|
109 |
|
110 | tooltipDateFormat?: string | Intl.DateTimeFormatOptions;
|
111 | |
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 | groupData?: boolean;
|
119 | |
120 |
|
121 |
|
122 |
|
123 |
|
124 |
|
125 |
|
126 | groupCount?: number;
|
127 | |
128 |
|
129 |
|
130 |
|
131 |
|
132 |
|
133 | groupInterval?: ITimeInterval;
|
134 | |
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 | timezoneOffset?: number;
|
144 | |
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 | timezone?: string;
|
154 | }
|
155 |
|
156 |
|
157 |
|
158 | export interface IDateAxisEvents extends IValueAxisEvents {
|
159 | |
160 |
|
161 |
|
162 | groupperiodchanged: IDateAxisEvents;
|
163 | }
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 | export interface IDateAxisAdapters extends IValueAxisAdapters, IDateAxisProperties {
|
170 | }
|
171 |
|
172 |
|
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 |
|
180 |
|
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 |
|
188 |
|
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 |
|
204 |
|
205 |
|
206 |
|
207 |
|
208 | export declare class DateAxis<T extends AxisRenderer = AxisRenderer> extends ValueAxis<T> {
|
209 | |
210 |
|
211 |
|
212 | _dataFields: IDateAxisDataFields;
|
213 | |
214 |
|
215 |
|
216 | _properties: IDateAxisProperties;
|
217 | |
218 |
|
219 |
|
220 | _adapter: IDateAxisAdapters;
|
221 | |
222 |
|
223 |
|
224 | _events: IDateAxisEvents;
|
225 | |
226 |
|
227 |
|
228 | _dataItem: DateAxisDataItem;
|
229 | |
230 |
|
231 |
|
232 | _axisBreak: DateAxisBreak;
|
233 | protected _gapBreaks: boolean;
|
234 | |
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
|
251 |
|
252 |
|
253 |
|
254 |
|
255 |
|
256 |
|
257 |
|
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 |
|
280 |
|
281 |
|
282 |
|
283 | gridIntervals: List<ITimeInterval>;
|
284 | |
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 |
|
295 |
|
296 |
|
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 |
|
315 |
|
316 |
|
317 |
|
318 | groupIntervals: List<ITimeInterval>;
|
319 | |
320 |
|
321 |
|
322 |
|
323 |
|
324 |
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
|
330 |
|
331 |
|
332 |
|
333 |
|
334 |
|
335 |
|
336 |
|
337 |
|
338 |
|
339 |
|
340 |
|
341 |
|
342 |
|
343 |
|
344 |
|
345 | dateFormats: Dictionary<TimeUnit, string | Intl.DateTimeFormatOptions>;
|
346 | |
347 |
|
348 |
|
349 |
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
|
355 |
|
356 |
|
357 |
|
358 |
|
359 |
|
360 |
|
361 |
|
362 |
|
363 |
|
364 |
|
365 | periodChangeDateFormats: Dictionary<TimeUnit, string | Intl.DateTimeFormatOptions>;
|
366 | |
367 |
|
368 |
|
369 | protected _gridInterval: ITimeInterval;
|
370 | |
371 |
|
372 |
|
373 |
|
374 |
|
375 | protected _intervalDuration: number;
|
376 | |
377 |
|
378 |
|
379 |
|
380 |
|
381 | protected _gridDate: Date;
|
382 | |
383 |
|
384 |
|
385 |
|
386 |
|
387 | protected _nextGridUnit: TimeUnit;
|
388 | |
389 |
|
390 |
|
391 | protected _baseInterval: ITimeInterval;
|
392 | |
393 |
|
394 |
|
395 | protected _mainBaseInterval: ITimeInterval;
|
396 | |
397 |
|
398 |
|
399 | protected _groupInterval: ITimeInterval;
|
400 | |
401 |
|
402 |
|
403 | protected _baseIntervalReal: ITimeInterval;
|
404 | |
405 |
|
406 | protected _prevSeriesTime: {
|
407 | [index: string]: number;
|
408 | };
|
409 | |
410 |
|
411 |
|
412 |
|
413 |
|
414 | protected _minDifference: {
|
415 | [index: string]: number;
|
416 | };
|
417 | |
418 |
|
419 |
|
420 |
|
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 | fillRule(dataItem: this["_dataItem"]): void;
|
427 | |
428 |
|
429 |
|
430 | protected _firstWeekDay: number;
|
431 | |
432 |
|
433 |
|
434 | protected _df: DateFormatter;
|
435 | |
436 |
|
437 |
|
438 |
|
439 |
|
440 |
|
441 |
|
442 | groupMin: {
|
443 | [index: string]: number;
|
444 | };
|
445 | |
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 | groupMax: {
|
453 | [index: string]: number;
|
454 | };
|
455 | |
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 | tooltipDate: Date;
|
462 | |
463 |
|
464 |
|
465 | constructor();
|
466 | /**
|
467 | * Sets defaults that instantiate some objects that rely on parent, so they
|
468 | * cannot be set in constructor.
|
469 | */
|
470 | protected applyInternalDefaults(): void;
|
471 | /**
|
472 | * Returns a new/empty [[DataItem]] of the type appropriate for this object.
|
473 | *
|
474 | * @see {@link DataItem}
|
475 | * @return Data Item
|
476 | */
|
477 | protected createDataItem(): this["_dataItem"];
|
478 | /**
|
479 | * Returns a new/empty [[AxisBreak]] of the appropriate type.
|
480 | *
|
481 | * @return Axis break
|
482 | */
|
483 | protected createAxisBreak(): this["_axisBreak"];
|
484 | /**
|
485 | * Validates Axis' data items.
|
486 | *
|
487 | * @ignore Exclude from docs
|
488 | */
|
489 | validateDataItems(): void;
|
490 | /**
|
491 | * Handles process after zoom.
|
492 | *
|
493 | * @ignore Exclude from docs
|
494 | * @todo Does nothing?
|
495 | */
|
496 | handleSelectionExtremesChange(): void;
|
497 | /**
|
498 | * Calculates all positions, related to axis as per current zoom.
|
499 | *
|
500 | * @ignore Exclude from docs
|
501 | */
|
502 | calculateZoom(): void;
|
503 | protected findFirst(dataItem: XYSeriesDataItem, time: number, key: string): XYSeriesDataItem;
|
504 | /**
|
505 | * (Re)validates data.
|
506 | *
|
507 | * @ignore Exclude from docs
|
508 | */
|
509 | validateData(): void;
|
510 | /**
|
511 | * @ignore
|
512 | */
|
513 | readonly minDifference: number;
|
514 | /**
|
515 | * [dataChangeUpdate description]
|
516 | *
|
517 | *
|
518 | * @ignore Exclude from docs
|
519 | * @todo Description
|
520 | */
|
521 | seriesDataChangeUpdate(series: XYSeries): void;
|
522 | /**
|
523 | * [postProcessSeriesDataItems description]
|
524 | *
|
525 | * @ignore Exclude from docs
|
526 | * @todo Description
|
527 | */
|
528 | postProcessSeriesDataItems(series?: XYSeries): void;
|
529 | protected seriesGroupUpdate(series: XYSeries): void;
|
530 | /**
|
531 | * Calculates series group data.
|
532 | *
|
533 | * @param series Series
|
534 | * @ignore
|
535 | */
|
536 | groupSeriesData(series: XYSeries): void;
|
537 | /**
|
538 | * @ignore
|
539 | */
|
540 | protected getDFFormatter(): void;
|
541 | /**
|
542 | * [postProcessSeriesDataItem description]
|
543 | *
|
544 | * @ignore Exclude from docs
|
545 | * @todo Description
|
546 | * @param dataItem Data item
|
547 | */
|
548 | postProcessSeriesDataItem(dataItem: XYSeriesDataItem, interval?: ITimeInterval): void;
|
549 | /**
|
550 | * Collapses empty stretches of date/time scale by creating [[AxisBreak]]
|
551 | * elements for them.
|
552 | *
|
553 | * Can be used to automatically remove strethes without data, like weekends.
|
554 | *
|
555 | * No, need to call this manually. It will automatically be done if
|
556 | * `skipEmptyPeriods = true`.
|
557 | *
|
558 | * @ignore Exclude from docs
|
559 | */
|
560 | protected addEmptyUnitsBreaks(): void;
|
561 | /**
|
562 | * Updates positioning of Axis breaks after something changes.
|
563 | *
|
564 | * @ignore Exclude from docs
|
565 | */
|
566 | fixAxisBreaks(): void;
|
567 | /**
|
568 | * @ignore
|
569 | */
|
570 | protected getFirstWeekDay(): number;
|
571 | /**
|
572 | * [getGridDate description]
|
573 | *
|
574 | * @ignore Exclude from docs
|
575 | * @todo Description
|
576 | * @param date [description]
|
577 | * @param intervalCount [description]
|
578 | * @return [description]
|
579 | */
|
580 | getGridDate(date: Date, intervalCount: number): Date;
|
581 | /**
|
582 | * [getBreaklessDate description]
|
583 | *
|
584 | * @ignore Exclude from docs
|
585 | * @todo Description
|
586 | * @param axisBreak [description]
|
587 | * @param timeUnit [description]
|
588 | * @param count [description]
|
589 | * @return [description]
|
590 | */
|
591 | getBreaklessDate(axisBreak: DateAxisBreak, timeUnit: TimeUnit, count: number): Date;
|
592 | /**
|
593 | * (Re)validates all Axis elements.
|
594 | *
|
595 | * @ignore Exclude from docs
|
596 | * @todo Description (review)
|
597 | */
|
598 | validateAxisElements(): void;
|
599 | /**
|
600 | * Validates Axis data item.
|
601 | *
|
602 | * @ignore Exclude from docs
|
603 | * @param dataItem Data item
|
604 | */
|
605 | validateDataElement(dataItem: this["_dataItem"]): void;
|
606 | /**
|
607 | * A duration in milliseconds of the `baseInterval`.
|
608 | *
|
609 | * @return Duration (ms)
|
610 | */
|
611 | readonly baseDuration: number;
|
612 | /**
|
613 | * Adjusts min/max values.
|
614 | *
|
615 | * @ignore Exclude from docs.
|
616 | * @todo Description (review)
|
617 | * @param min Min timestamp
|
618 | * @param max Max timestamp
|
619 | * @return Adjusted min/max step
|
620 | */
|
621 | adjustMinMax(min: number, max: number): IMinMaxStep;
|
622 | /**
|
623 | * Adjusts the minimum timestamp as per cell start location.
|
624 | *
|
625 | * @param value Value
|
626 | * @return Adjusted value
|
627 | */
|
628 | protected fixMin(value: number): number;
|
629 | /**
|
630 | * Adjusts the maximum timestamp as per cell start location.
|
631 | *
|
632 | * @param value Value
|
633 | * @return Adjusted value
|
634 | */
|
635 | protected fixMax(value: number): number;
|
636 | /**
|
637 | * [chooseInterval description]
|
638 | *
|
639 | * @ignore Exclude from docs.
|
640 | * @todo Description
|
641 | * @param index [description]
|
642 | * @param duration [description]
|
643 | * @param gridCount [description]
|
644 | * @return [description]
|
645 | */
|
646 | chooseInterval(index: number, duration: number, gridCount: number, intervals?: List<ITimeInterval>): ITimeInterval;
|
647 | /**
|
648 | * Formats the value according to axis' own [[DateFormatter]].
|
649 | *
|
650 | * @param value Source value
|
651 | * @return Formatted value
|
652 | */
|
653 | formatLabel(value: number): string;
|
654 | /**
|
655 | * Converts a Date to an asbolute pixel position within Axis.
|
656 | *
|
657 | * @param date Date
|
658 | * @return Position (px)
|
659 | */
|
660 | dateToPosition(date: Date): number;
|
661 | /**
|
662 | * Converts a numeric timestamp or a `Date` to a relative position on axis.
|
663 | *
|
664 | * @param date Date or a timestamp
|
665 | * @return Relative position
|
666 | */
|
667 | anyToPosition(date: Date | number): number;
|
668 | /**
|
669 | * Converts date to orientation point (x, y, angle) on axis
|
670 | *
|
671 | * @param date Date
|
672 | * @return IOrientationPoint
|
673 | */
|
674 | dateToPoint(date: Date): IOrientationPoint;
|
675 | /**
|
676 | * Converts a numeric value to orientation (x, y, angle) point on axis
|
677 | *
|
678 | * @param value Value
|
679 | * @return Orientation point
|
680 | */
|
681 | anyToPoint(date: Date | number): IOrientationPoint;
|
682 | /**
|
683 | * Converts pixel position within Axis to a corresponding Date.
|
684 | *
|
685 | * @param position Position (px)
|
686 | * @return Date
|
687 | */
|
688 | positionToDate(position: number): Date;
|
689 | /**
|
690 | * Returns the relative position on axis for series' data item's value.
|
691 | *
|
692 | * @since 4.5.14
|
693 | * @param dataItem Data item
|
694 | * @param key Data field to get value from
|
695 | * @param location Location (0-1)
|
696 | * @return Relative position
|
697 | */
|
698 | getPositionX(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
|
699 | /**
|
700 | * Returns relative position on axis for series' data item's value.
|
701 | *
|
702 | * @since 4.5.14
|
703 | * @param dataItem Data item
|
704 | * @param key Data field to get value from
|
705 | * @param location Location (0-1)
|
706 | * @return Relative position
|
707 | */
|
708 | getPositionY(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
|
709 | /**
|
710 | * Returns an angle for series data item.
|
711 | *
|
712 | * @ignore Exclude from docs
|
713 | * @todo Description (review)
|
714 | * @param dataItem Data item
|
715 | * @param key Data field to get value from
|
716 | * @param location Location (0-1)
|
717 | * @param stackKey Stack ID
|
718 | * @param range Range to fit in
|
719 | * @return Angle
|
720 | */
|
721 | getAngle(dataItem: XYSeriesDataItem, key: string, location?: number, stackKey?: string, range?: IRange): number;
|
722 | /**
|
723 | * [getTimeByLocation description]
|
724 | *
|
725 | * @ignore Exclude from docs
|
726 | * @todo Description
|
727 | * @param dataItem [description]
|
728 | * @param key [description]
|
729 | * @param location [description]
|
730 | * @return [description]
|
731 | */
|
732 | protected getTimeByLocation(dataItem: XYSeriesDataItem, key: string, location: number): number;
|
733 | /**
|
734 | * Processes a related series' data item.
|
735 | *
|
736 | * @ignore Exclude from docs
|
737 | * @todo Description
|
738 | * @param dataItem Data item
|
739 | */
|
740 | processSeriesDataItem(dataItem: XYSeriesDataItem, axisLetter?: string): void;
|
741 | /**
|
742 | * [updateAxisBySeries description]
|
743 | *
|
744 | * @ignore Exclude from docs
|
745 | * @todo Description
|
746 | */
|
747 | updateAxisBySeries(): void;
|
748 | /**
|
749 | * A base interval (granularity) of data.
|
750 | *
|
751 | * Used to indicate what are the base units of your data.
|
752 | *
|
753 | * For example, if you have a data set that has a data point every 5 minutes,
|
754 | * you may want to set this to `{ timeUnit: "minute", count: 5 }`.
|
755 | *
|
756 | * If not set, the Axis will try to determine the setting by its own, looking
|
757 | * at actual data.
|
758 | *
|
759 | * For best results, try to follow these values for `count`:
|
760 | *
|
761 | * When unit is "month", use 12 / count = round number
|
762 | * When unit is "hour", use 24 / count = round number
|
763 | * When unit is "second" and "minute", use 60 / count = round number
|
764 | *
|
765 | * @param timeInterval base interval
|
766 | */
|
767 | /**
|
768 | * @return Base interval
|
769 | */
|
770 | baseInterval: ITimeInterval;
|
771 | /**
|
772 | * Indicates granularity of the data of source (unaggregated) data.
|
773 | *
|
774 | * @since 4.7.0
|
775 | * @return Granularity of the main data set
|
776 | */
|
777 | readonly mainBaseInterval: ITimeInterval;
|
778 | /**
|
779 | * If enabled, axis will automatically collapse empty (without data points)
|
780 | * periods of time, i.e. weekends.
|
781 | *
|
782 | * An "empty" period is considered a stretch of time in the length of current
|
783 | * `baseInterval` without a single data point in it.
|
784 | *
|
785 | * For each such empty period, axis will automatically create an
|
786 | * [[AxisBreak]]. By default they will be invisible. You can still configure
|
787 | * them by accessing `axis.breaks.template`.
|
788 | *
|
789 | * [More info about breaks](https://www.amcharts.com/docs/v4/concepts/axes/#Breaks).
|
790 | *
|
791 | * Important notes:
|
792 | * * If you set this property to `true`, you can not add your custom axis breaks to this axis anymore.
|
793 | * * Using this feature affects performance. Use only if you need it.
|
794 | * * Setting this to `true` will reset appearance of breaks. If you want to modify appearance, do it *after* you set `skipEmptyPeriods`.
|
795 | * * Some axis label overlapping might happen.
|
796 | * * This setting is not compatible with `groupData = true`.
|
797 | *
|
798 | * @default false
|
799 | * @param value Remove empty stretches of time?
|
800 | */
|
801 | /**
|
802 | * @return Remove empty stretches of time?
|
803 | */
|
804 | skipEmptyPeriods: boolean;
|
805 | /**
|
806 | * A special date format to apply axis tooltips.
|
807 | *
|
808 | * Will use same format as for labels, if not set.
|
809 | *
|
810 | * @param value Date format
|
811 | */
|
812 | /**
|
813 | * @return Date format
|
814 | */
|
815 | tooltipDateFormat: string | Intl.DateTimeFormatOptions;
|
816 | /**
|
817 | * Use `periodChangeDateFormats` to apply different formats to the first
|
818 | * label in bigger time unit.
|
819 | *
|
820 | * @default true
|
821 | * @param value Use different format for period beginning?
|
822 | */
|
823 | /**
|
824 | * @return Use different format for period beginning?
|
825 | */
|
826 | markUnitChange: boolean;
|
827 | /**
|
828 | * Returns text to show in a tooltip, based on specific relative position
|
829 | * within axis.
|
830 | *
|
831 | * The label will be formatted as per [[DateFormatter]] set for the whole
|
832 | * chart, or explicitly for this Axis.
|
833 | *
|
834 | * @ignore Exclude from docs
|
835 | * @param position Position
|
836 | * @return Label (formatted date)
|
837 | */
|
838 | getTooltipText(position: number): string;
|
839 | /**
|
840 | * Takes an absolute position within axis and adjust it to a specific position within base interval. (cell)
|
841 | *
|
842 | * @ignore Exclude from docs
|
843 | * @param position Source position
|
844 | * @param location Location in the cell
|
845 | * @return Adjusted position
|
846 | */
|
847 | roundPosition(position: number, location?: AxisItemLocation, axisLocation?: number): number;
|
848 | /**
|
849 | * Returns an relative position of the start of the cell (period), that specific position value falls into.
|
850 | *
|
851 | * @ignore Exclude from docs
|
852 | * @todo Description (review)
|
853 | * @param position Relative position
|
854 | * @return Cell start relative position
|
855 | */
|
856 | getCellStartPosition(position: number): number;
|
857 | /**
|
858 | * Returns an relative position of the end of the cell (period), that specific position value falls into.
|
859 | *
|
860 | * @ignore Exclude from docs
|
861 | * @todo Description (review)
|
862 | * @param position Relative position
|
863 | * @return Cell end relative position
|
864 | */
|
865 | getCellEndPosition(position: number): number;
|
866 | /**
|
867 | * Returns a Series data item that corresponds to the specific pixel position
|
868 | * of the Axis.
|
869 | *
|
870 | * If `findNearest` (third parameter) is set to `true`, the method will try
|
871 | * to locate nearest available data item if none is found directly under
|
872 | * `position`.
|
873 | *
|
874 | * @param series Series
|
875 | * @param position Position (px)
|
876 | * @param findNearest Should axis try to find nearest tooltip if there is no data item at exact position
|
877 | * @return Data item
|
878 | */
|
879 | getSeriesDataItem(series: XYSeries, position: number, findNearest?: boolean): XYSeriesDataItem;
|
880 | /**
|
881 | * Returns a formatted date based on position in axis scale.
|
882 | *
|
883 | * Please note that `position` represents position within axis which may be
|
884 | * zoomed and not correspond to Cursor's `position`.
|
885 | *
|
886 | * To convert Cursor's `position` to Axis' `position` use `toAxisPosition()` method.
|
887 | *
|
888 | * @see {@link https://www.amcharts.com/docs/v4/tutorials/tracking-cursors-position-via-api/#Tracking_Cursor_s_position} For more information about cursor tracking.
|
889 | * @param position Relative position on axis (0-1)
|
890 | * @return Position label
|
891 | */
|
892 | getPositionLabel(position: number): string;
|
893 | /**
|
894 | * Returns label date format based on currently used time units
|
895 | *
|
896 | * @return Format
|
897 | */
|
898 | protected getCurrentLabelFormat(): string | Intl.DateTimeFormatOptions;
|
899 | /**
|
900 | * Initializes an Axis renderer.
|
901 | *
|
902 | * @ignore Exclude from docs
|
903 | */
|
904 | initRenderer(): void;
|
905 | /**
|
906 | * Coordinates of the actual axis start.
|
907 | *
|
908 | * @ignore Exclude from docs
|
909 | * @return Base point
|
910 | */
|
911 | readonly basePoint: IPoint;
|
912 | /**
|
913 | * @ignore
|
914 | */
|
915 | protected animateMinMax(min: number, max: number): Animation;
|
916 | /**
|
917 | * Invalidates axis data items when series extremes change
|
918 | */
|
919 | protected handleExtremesChange(): void;
|
920 | /**
|
921 | * Zooms axis to specific Dates.
|
922 | *
|
923 | * @param startDate Start date
|
924 | * @param endValue End date
|
925 | * @param skipRangeEvent Do not invoke events
|
926 | * @param instantly Do not play zoom animations
|
927 | */
|
928 | zoomToDates(startDate: Date, endDate: Date, skipRangeEvent?: boolean, instantly?: boolean, adjust?: boolean): void;
|
929 | /**
|
930 | * Zooms axis to specific values.
|
931 | *
|
932 | * @param startValue Start value
|
933 | * @param endValue End value
|
934 | * @param skipRangeEvent Do not invoke events
|
935 | * @param instantly Do not play zoom animations
|
936 | */
|
937 | zoomToValues(startValue: number, endValue: number, skipRangeEvent?: boolean, instantly?: boolean, adjust?: boolean): void;
|
938 | /**
|
939 | * Adds `baseInterval` to "as is" fields.
|
940 | *
|
941 | * @param field Field name
|
942 | * @return Assign as is?
|
943 | */
|
944 | protected asIs(field: string): boolean;
|
945 | /**
|
946 | * Copies all properties and related data from a different instance of Axis.
|
947 | *
|
948 | * @param source Source Axis
|
949 | */
|
950 | copyFrom(source: this): void;
|
951 | /**
|
952 | * Shows Axis tooltip at specific relative position within Axis. (0-1)
|
953 | *
|
954 | * @param position Position (0-1)
|
955 | * @param local or global position
|
956 | */
|
957 | showTooltipAtPosition(position: number, local?: boolean): void;
|
958 | /**
|
959 | * Should the nearest tooltip be shown if no data item is found on the
|
960 | * current cursor position.
|
961 | *
|
962 | * @default true
|
963 | * @param value Should snap?
|
964 | */
|
965 | /**
|
966 | * @return Should snap?
|
967 | */
|
968 | snapTooltip: boolean;
|
969 | /**
|
970 | * Indicates if data should be aggregated to composide data items if there
|
971 | * are more data items in selected range than `groupCount`.
|
972 | *
|
973 | * Grouping will occur automatically, based on current selection range, and
|
974 | * will change dynamically when user zooms in/out the chart.
|
975 | *
|
976 | * NOTE: This works only if [[DateAxis]] is base axis of an [[XYSeries]].
|
977 | *
|
978 | * The related [[XYSeries]] also needs to be set up to take advantage of, by
|
979 | * setting its [`groupFields`](https://www.amcharts.com/docs/v4/reference/xyseries/#groupFields_property).
|
980 | *
|
981 | * The group intervals to aggregate data to is defined by `groupIntervals`
|
982 | * property.
|
983 | *
|
984 | * ```TypeScript
|
985 | * let dateAxis = chart.xAxes.push(new am4charts.DateAxis());
|
986 | * dateAxis.groupData = true;
|
987 | *
|
988 | * let valueAxis = chart.xAxes.push(new am4charts.valueAxis());
|
989 | *
|
990 | * let series = chart.series.push(new am4charts.LineSeries());
|
991 | * series.dataFields.dateX = "date";
|
992 | * series.dataFields.valueY = "value";
|
993 | * series.groupFields.valueY = "average";
|
994 | * ```
|
995 | * ```JavaScript
|
996 | * var dateAxis = chart.xAxes.push(new am4charts.DateAxis());
|
997 | * dateAxis.groupData = true;
|
998 | *
|
999 | * var valueAxis = chart.xAxes.push(new am4charts.valueAxis());
|
1000 | *
|
1001 | * var series = chart.series.push(new am4charts.LineSeries());
|
1002 | * series.dataFields.dateX = "date";
|
1003 | * series.dataFields.valueY = "value";
|
1004 | * series.groupFields.valueY = "average";
|
1005 | * ```
|
1006 | * ```JSON
|
1007 | * {
|
1008 | *
|
1009 | * "xAxes": [{
|
1010 | * "type": "DateAxis",
|
1011 | * "groupData": true
|
1012 | * }],
|
1013 | * "yAxes": [{
|
1014 | * "type": "ValueAxis"
|
1015 | * }],
|
1016 | * "series": [{
|
1017 | * "type": "LineSeries",
|
1018 | * "dataFields": {
|
1019 | * "dateX": "date",
|
1020 | * "valueY": "value"
|
1021 | * },
|
1022 | * "groupFields": {
|
1023 | * "valueY": "average"
|
1024 | * }
|
1025 | * }]
|
1026 | * }
|
1027 | * ```
|
1028 | *
|
1029 | * @default false
|
1030 | * @see {@link https://www.amcharts.com/docs/v4/concepts/axes/date-axis/#Dynamic_data_item_grouping} for more information about dynamic data item grouping.
|
1031 | * @since 4.7.0
|
1032 | * @param value Group data points?
|
1033 | */
|
1034 | /**
|
1035 | * @return Group data points?
|
1036 | */
|
1037 | groupData: boolean;
|
1038 | /**
|
1039 | * Disables automatic selection of data grouping intervals and always uses
|
1040 | * `groupInterval` if set. Works only if `groupData = true`.
|
1041 | *
|
1042 | * @since 4.9.24
|
1043 | * @param value Interval
|
1044 | */
|
1045 | /**
|
1046 | * @return Interval
|
1047 | */
|
1048 | groupInterval: ITimeInterval;
|
1049 | /**
|
1050 | * Indicates threshold of data items in selected range at which to start
|
1051 | * aggregating data items if `groupData = true`.
|
1052 | *
|
1053 | * @default 200
|
1054 | * @since 4.7.0
|
1055 | * @param value Number of data items
|
1056 | */
|
1057 | /**
|
1058 | * @return Number of data items
|
1059 | */
|
1060 | groupCount: number;
|
1061 | /**
|
1062 | * If set will recalculate all timestamps in data by applying specific offset
|
1063 | * in minutes.
|
1064 | *
|
1065 | * IMPORTANT: do not set `timezoneOffset` on both `DateAxis` and `dateFormatter`. It
|
1066 | * will skew your results by applying offset twice.
|
1067 | *
|
1068 | * @since 4.8.5
|
1069 | * @param value Time zone offset in minutes
|
1070 | */
|
1071 | /**
|
1072 | * @todo Timezone offset in minutes
|
1073 | */
|
1074 | timezoneOffset: number;
|
1075 | /**
|
1076 | * If set will recalculate all timestamps in data to specific named timezone,
|
1077 | * e.g. `"America/Vancouver"`, `"Australia/Sydney"`, `"UTC"`, etc.
|
1078 | *
|
1079 | * IMPORTANT: it is no longer recommended to use this setting. Please
|
1080 | * set`timezone` on `dateFormatter`.
|
1081 | *
|
1082 | * @deprecated
|
1083 | * @since 4.10.1
|
1084 | * @param value Time zone
|
1085 | */
|
1086 | /**
|
1087 | * @return Timezone
|
1088 | */
|
1089 | timezone: string;
|
1090 | /**
|
1091 | * Current grid interval.
|
1092 | *
|
1093 | * @return Grid interval
|
1094 | */
|
1095 | readonly gridInterval: ITimeInterval;
|
1096 | /**
|
1097 | * @ignore
|
1098 | */
|
1099 | makeGap(dataItem: LineSeriesDataItem, previous: LineSeriesDataItem): boolean;
|
1100 | /**
|
1101 | * @return base value
|
1102 | */
|
1103 | readonly baseValue: number;
|
1104 | }
|
1105 |
|
\ | No newline at end of file |