1 | /**
|
2 | * Axis Bullet module.
|
3 | */
|
4 | /**
|
5 | * ============================================================================
|
6 | * IMPORTS
|
7 | * ============================================================================
|
8 | * @hidden
|
9 | */
|
10 | import { Container, IContainerAdapters, IContainerEvents, IContainerProperties } from "../../core/Container";
|
11 | import { AxisItemLocation, AxisDataItem, Axis } from "./Axis";
|
12 | /**
|
13 | * ============================================================================
|
14 | * REQUISITES
|
15 | * ============================================================================
|
16 | * @hidden
|
17 | */
|
18 | /**
|
19 | * Defines properties for [[AxisBullet]].
|
20 | */
|
21 | export interface IAxisBulletProperties extends IContainerProperties {
|
22 | /**
|
23 | * Relative position within cell/range.
|
24 | *
|
25 | * Value range is from from `0` (beginning) to `1` (end).
|
26 | *
|
27 | * @default 0.5
|
28 | */
|
29 | location?: number;
|
30 | /**
|
31 | * Draw inside plot area (`true`) or outside it (`false`).
|
32 | *
|
33 | * @default false
|
34 | */
|
35 | inside?: boolean;
|
36 | }
|
37 | /**
|
38 | * Defines events for [[AxisBullet]].
|
39 | */
|
40 | export interface IAxisBulletEvents extends IContainerEvents {
|
41 | }
|
42 | /**
|
43 | * Defines adapter for [[AxisBullet]].
|
44 | *
|
45 | * @see {@link Adapter}
|
46 | */
|
47 | export interface IAxisBulletAdapters extends IContainerAdapters, IAxisBulletProperties {
|
48 | }
|
49 | /**
|
50 | * ============================================================================
|
51 | * MAIN CLASS
|
52 | * ============================================================================
|
53 | * @hidden
|
54 | */
|
55 | /**
|
56 | * Used to draw a positioned bullet (element) on an Axis.
|
57 | *
|
58 | * ```TypeScript
|
59 | * let range = dateAxis.axisRanges.create();
|
60 | * range.date = new Date(2018, 0, 5);
|
61 | *
|
62 | * let flag = new am4plugins_bullets.FlagBullet();
|
63 | * flag.label.text = "Hello";
|
64 | *
|
65 | * range.bullet = flag;
|
66 | * ```
|
67 | * ```JavaScript
|
68 | * var range = dateAxis.axisRanges.create();
|
69 | * range.date = new Date(2018, 0, 5);
|
70 | *
|
71 | * var flag = new am4plugins_bullets.FlagBullet();
|
72 | * flag.label.text = "Hello";
|
73 | *
|
74 | * range.bullet = flag;
|
75 | * ```
|
76 | * ```JSON
|
77 | * {
|
78 | * // ...
|
79 | * "xAxes": [{
|
80 | * "type": "DateAxis",
|
81 | * // ...
|
82 | * "axisRanges": [{
|
83 | * "date": new Date(2018, 0, 5),
|
84 | * "bullet: {
|
85 | * "type": "FlagBullet",
|
86 | * "label": {
|
87 | * "text": "Hello"
|
88 | * }
|
89 | * }
|
90 | * }]
|
91 | * }]
|
92 | * }
|
93 | * ```
|
94 | *
|
95 | * @since 4.5.9
|
96 | * @see {@link IAxisBulletEvents} for a list of available events
|
97 | * @see {@link IAxisBulletAdapters} for a list of available Adapters
|
98 | * @important
|
99 | */
|
100 | export declare class AxisBullet extends Container {
|
101 | /**
|
102 | * Defines available properties
|
103 | */
|
104 | _properties: IAxisBulletProperties;
|
105 | /**
|
106 | * Defines available adapters
|
107 | */
|
108 | _adapter: IAxisBulletAdapters;
|
109 | /**
|
110 | * Defines available events.
|
111 | */
|
112 | _events: IAxisBulletEvents;
|
113 | /**
|
114 | * Data item.
|
115 | */
|
116 | _dataItem: AxisDataItem;
|
117 | /**
|
118 | * A referecent to Axis element this fill is applied to.
|
119 | */
|
120 | axis: Axis;
|
121 | constructor();
|
122 | /**
|
123 | * Relative position within cell/range.
|
124 | *
|
125 | * Value range is from from `0` (beginning) to `1` (end).
|
126 | *
|
127 | * NOTE: `location` is relative to the parent axis range's scope, i.e.
|
128 | * between its `date` and `endDate` for [[DateAxis]], or `value`/`endValue`
|
129 | * ([[ValueAxis]]), or `category`/`endCategory` ([[categoryAxis]]).
|
130 | *
|
131 | * ```TypeScript
|
132 | * let range = dateAxis.axisRanges.create();
|
133 | * range.date = new Date(2018, 0, 5);
|
134 | * range.endDate = new Date(2018, 0, 6);
|
135 | *
|
136 | * let bullet = new am4charts.AxisBullet();
|
137 | * bullet.location = 1;
|
138 | *
|
139 | * let flag = bullet.createChild(am4plugins_bullets.FlagBullet);
|
140 | * flag.label.text = "Hello";
|
141 | * ```
|
142 | * ```JavaScript
|
143 | * var range = dateAxis.axisRanges.create();
|
144 | * range.date = new Date(2018, 0, 5);
|
145 | * range.endDate = new Date(2018, 0, 6);
|
146 | *
|
147 | * var bullet = new am4charts.AxisBullet();
|
148 | * bullet.location = 1;
|
149 | *
|
150 | * var flag = bullet.createChild(am4plugins_bullets.FlagBullet);
|
151 | * flag.label.text = "Hello";
|
152 | * ```
|
153 | * ```JSON
|
154 | * {
|
155 | * // ...
|
156 | * "xAxes": [{
|
157 | * "type": "DateAxis",
|
158 | * // ...
|
159 | * "axisRanges": [{
|
160 | * "date": new Date(2018, 0, 5),
|
161 | * "endDate": new Date(2018, 0, 6),
|
162 | * "bullet: {
|
163 | * "type": "AxisBullet",
|
164 | * "location": 1,
|
165 | * "children": [{
|
166 | * "type": "FlagBullet",
|
167 | * "label": {
|
168 | * "text": "Hello"
|
169 | * }
|
170 | * }]
|
171 | * }
|
172 | * }]
|
173 | * }]
|
174 | * }
|
175 | * ```
|
176 | *
|
177 | * @default 0.5
|
178 | * @param value Location (0-1)
|
179 | */
|
180 | /**
|
181 | * @return Location (0-1)
|
182 | */
|
183 | location: AxisItemLocation;
|
184 | /**
|
185 | * @ignore
|
186 | */
|
187 | protected setDisabled(value: boolean): boolean;
|
188 | }
|
189 |
|
\ | No newline at end of file |