• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * DataPanelType enum
18 *
19 * @enum { number }
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 8
22 */
23/**
24 * DataPanelType enum
25 *
26 * @enum { number }
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @since 9
29 * @form
30 */
31/**
32 * DataPanelType enum
33 *
34 * @enum { number }
35 * @syscap SystemCapability.ArkUI.ArkUI.Full
36 * @crossplatform
37 * @since 10
38 * @form
39 */
40declare enum DataPanelType {
41  /**
42   * Line Type
43   *
44   * @syscap SystemCapability.ArkUI.ArkUI.Full
45   * @since 8
46   */
47  /**
48   * Line Type
49   *
50   * @syscap SystemCapability.ArkUI.ArkUI.Full
51   * @since 9
52   * @form
53   */
54  /**
55   * Line Type
56   *
57   * @syscap SystemCapability.ArkUI.ArkUI.Full
58   * @crossplatform
59   * @since 10
60   * @form
61   */
62  Line,
63
64  /**
65   * Line Rainbow
66   *
67   * @syscap SystemCapability.ArkUI.ArkUI.Full
68   * @since 8
69   */
70  /**
71   * Line Rainbow
72   *
73   * @syscap SystemCapability.ArkUI.ArkUI.Full
74   * @since 9
75   * @form
76   */
77  /**
78   * Line Rainbow
79   *
80   * @syscap SystemCapability.ArkUI.ArkUI.Full
81   * @crossplatform
82   * @since 10
83   * @form
84   */
85  Circle,
86}
87
88/**
89 * ColorStop type
90 * @syscap SystemCapability.ArkUI.ArkUI.Full
91 * @crossplatform
92 * @since 10
93 */
94declare type ColorStop = {
95  /**
96   * Color property.
97   * @type { ResourceColor } color - the color value.
98   * @syscap SystemCapability.ArkUI.ArkUI.Full
99   * @crossplatform
100   * @since 10
101   */
102  color: ResourceColor;
103
104  /**
105   * Offset property.
106   * @type { Length } offset - the color offset.
107   * @syscap SystemCapability.ArkUI.ArkUI.Full
108   * @crossplatform
109   * @since 10
110   */
111  offset: Length;
112}
113
114/**
115 * LinearGradient class
116 *
117 * @syscap SystemCapability.ArkUI.ArkUI.Full
118 * @crossplatform
119 * @since 10
120 */
121declare class LinearGradient {
122  /**
123   * Constructor.
124   *
125   * @param { ColorStop[] } colorStops - the LinearGradient constructor parameter.
126   * @syscap SystemCapability.ArkUI.ArkUI.Full
127   * @crossplatform
128   * @since 10
129   */
130  constructor(colorStops: ColorStop[]);
131}
132
133/**
134 * Defines the options of Shadow.
135 *
136 * @interface DataPanelShadowOptions
137 * @syscap SystemCapability.ArkUI.ArkUI.Full
138 * @crossplatform
139 * @since 10
140 */
141declare interface DataPanelShadowOptions {
142  /**
143   * Current shadow radius.
144   *
145   * @type { ?(number | Resource) }
146   * @default 5
147   * @syscap SystemCapability.ArkUI.ArkUI.Full
148   * @crossplatform
149   * @since 10
150   */
151  radius?: number | Resource;
152
153  /**
154   * Current shadow colors.
155   *
156   * @type { ?Array<ResourceColor | LinearGradient> }
157   * @default Consistent with valueColors
158   * @syscap SystemCapability.ArkUI.ArkUI.Full
159   * @crossplatform
160   * @since 10
161   */
162  colors?: Array<ResourceColor | LinearGradient>;
163
164  /**
165   * Current shadow offsetX.
166   *
167   * @type { ?(number | Resource) }
168   * @default 5
169   * @syscap SystemCapability.ArkUI.ArkUI.Full
170   * @crossplatform
171   * @since 10
172   */
173  offsetX?: number | Resource;
174
175  /**
176   * Current shadow offsetY
177   *
178   * @type { ?(number | Resource) }
179   * @default 5
180   * @syscap SystemCapability.ArkUI.ArkUI.Full
181   * @crossplatform
182   * @since 10
183   */
184  offsetY?: number | Resource;
185}
186
187/**
188 * Defines the options of DataPanel.
189 *
190 * @interface DataPanelOptions
191 * @syscap SystemCapability.ArkUI.ArkUI.Full
192 * @since 7
193 */
194/**
195 * Defines the options of DataPanel.
196 *
197 * @interface DataPanelOptions
198 * @syscap SystemCapability.ArkUI.ArkUI.Full
199 * @since 9
200 * @form
201 */
202/**
203 * Defines the options of DataPanel.
204 *
205 * @interface DataPanelOptions
206 * @syscap SystemCapability.ArkUI.ArkUI.Full
207 * @crossplatform
208 * @since 10
209 * @form
210 */
211declare interface DataPanelOptions {
212  /**
213   * Current data value. the max length is 9.
214   *
215   * @type { number[] }
216   * @syscap SystemCapability.ArkUI.ArkUI.Full
217   * @since 7
218   */
219  /**
220   * Current data value. the max length is 9.
221   *
222   * @type { number[] }
223   * @syscap SystemCapability.ArkUI.ArkUI.Full
224   * @since 9
225   * @form
226   */
227  /**
228   * Current data value. the max length is 9.
229   *
230   * @type { number[] }
231   * @syscap SystemCapability.ArkUI.ArkUI.Full
232   * @crossplatform
233   * @since 10
234   * @form
235   */
236  values: number[];
237
238  /**
239   * Maximum value of the current data.
240   *
241   * @type { ?number }
242   * @syscap SystemCapability.ArkUI.ArkUI.Full
243   * @since 7
244   */
245  /**
246   * Maximum value of the current data.
247   *
248   * @type { ?number }
249   * @syscap SystemCapability.ArkUI.ArkUI.Full
250   * @since 9
251   * @form
252   */
253  /**
254   * Maximum value of the current data.
255   *
256   * @type { ?number }
257   * @syscap SystemCapability.ArkUI.ArkUI.Full
258   * @crossplatform
259   * @since 10
260   * @form
261   */
262  max?: number;
263
264  /**
265   * DataPanel Type
266   *
267   * @type { ?DataPanelType }
268   * @syscap SystemCapability.ArkUI.ArkUI.Full
269   * @since 8
270   */
271  /**
272   * DataPanel Type
273   *
274   * @type { ?DataPanelType }
275   * @syscap SystemCapability.ArkUI.ArkUI.Full
276   * @since 9
277   * @form
278   */
279  /**
280   * DataPanel Type
281   *
282   * @type { ?DataPanelType }
283   * @syscap SystemCapability.ArkUI.ArkUI.Full
284   * @crossplatform
285   * @since 10
286   * @form
287   */
288  type?: DataPanelType;
289}
290
291/**
292 * Defines the DataPanel component.
293 *
294 * @interface DataPanelInterface
295 * @syscap SystemCapability.ArkUI.ArkUI.Full
296 * @since 7
297 */
298/**
299 * Defines the DataPanel component.
300 *
301 * @interface DataPanelInterface
302 * @syscap SystemCapability.ArkUI.ArkUI.Full
303 * @since 9
304 * @form
305 */
306/**
307 * Defines the DataPanel component.
308 *
309 * @interface DataPanelInterface
310 * @syscap SystemCapability.ArkUI.ArkUI.Full
311 * @crossplatform
312 * @since 10
313 * @form
314 */
315interface DataPanelInterface {
316  /**
317   * Return a DataPanel.
318   *
319   * @param { DataPanelOptions } options
320   * @returns { DataPanelAttribute }
321   * @syscap SystemCapability.ArkUI.ArkUI.Full
322   * @since 7
323   */
324  /**
325   * Return a DataPanel.
326   *
327   * @param { DataPanelOptions } options
328   * @returns { DataPanelAttribute }
329   * @syscap SystemCapability.ArkUI.ArkUI.Full
330   * @since 9
331   * @form
332   */
333  /**
334   * Return a DataPanel.
335   *
336   * @param { DataPanelOptions } options
337   * @returns { DataPanelAttribute }
338   * @syscap SystemCapability.ArkUI.ArkUI.Full
339   * @crossplatform
340   * @since 10
341   * @form
342   */
343  (options: DataPanelOptions): DataPanelAttribute;
344}
345
346/**
347 * Defines the DataPanel attribute functions.
348 *
349 * @extends CommonMethod
350 * @syscap SystemCapability.ArkUI.ArkUI.Full
351 * @since 7
352 */
353/**
354 * Defines the DataPanel attribute functions.
355 *
356 * @extends CommonMethod
357 * @syscap SystemCapability.ArkUI.ArkUI.Full
358 * @since 9
359 * @form
360 */
361/**
362 * Defines the DataPanel attribute functions.
363 *
364 * @extends CommonMethod
365 * @syscap SystemCapability.ArkUI.ArkUI.Full
366 * @crossplatform
367 * @since 10
368 * @form
369 */
370declare class DataPanelAttribute extends CommonMethod<DataPanelAttribute> {
371  /**
372   * Disable the special effect of the data ratio chart.
373   *
374   * @param { boolean } value
375   * @returns { DataPanelAttribute }
376   * @syscap SystemCapability.ArkUI.ArkUI.Full
377   * @since 7
378   */
379  /**
380   * Disable the special effect of the data ratio chart.
381   *
382   * @param { boolean } value
383   * @returns { DataPanelAttribute }
384   * @syscap SystemCapability.ArkUI.ArkUI.Full
385   * @since 9
386   * @form
387   */
388  /**
389   * Disable the special effect of the data ratio chart.
390   *
391   * @param { boolean } value
392   * @returns { DataPanelAttribute }
393   * @syscap SystemCapability.ArkUI.ArkUI.Full
394   * @crossplatform
395   * @since 10
396   * @form
397   */
398  closeEffect(value: boolean): DataPanelAttribute;
399
400  /**
401   * Set the value colors of the data ratio chart.
402   *
403   * @param { Array<ResourceColor | LinearGradient> } value - the value colors of the data ratio chart.
404   * @returns { DataPanelAttribute }
405   * @syscap SystemCapability.ArkUI.ArkUI.Full
406   * @crossplatform
407   * @since 10
408   */
409  valueColors(value: Array<ResourceColor | LinearGradient>): DataPanelAttribute;
410
411  /**
412   * Set track background color of the data ratio chart.
413   *
414   * @param { ResourceColor } value - track background color of the data ratio chart.
415   * @returns { DataPanelAttribute }
416   * @syscap SystemCapability.ArkUI.ArkUI.Full
417   * @crossplatform
418   * @since 10
419   */
420  trackBackgroundColor(value: ResourceColor): DataPanelAttribute;
421
422  /**
423   * Set the stroke width of the data ratio chart.
424   *
425   * @param { Length } value - the stroke width of the data ratio chart.
426   * @returns { DataPanelAttribute }
427   * @syscap SystemCapability.ArkUI.ArkUI.Full
428   * @crossplatform
429   * @since 10
430   */
431  strokeWidth(value: Length): DataPanelAttribute;
432
433  /**
434   * Set the shadow width of the data ratio chart.
435   *
436   * @param { DataPanelShadowOptions } value - the track shadow width of the data ratio chart.
437   * @returns { DataPanelAttribute }
438   * @syscap SystemCapability.ArkUI.ArkUI.Full
439   * @crossplatform
440   * @since 10
441   */
442  trackShadow(value: DataPanelShadowOptions): DataPanelAttribute;
443}
444
445/**
446 * Defines DataPanel Component.
447 *
448 * @syscap SystemCapability.ArkUI.ArkUI.Full
449 * @since 7
450 */
451/**
452 * Defines DataPanel Component.
453 *
454 * @syscap SystemCapability.ArkUI.ArkUI.Full
455 * @since 9
456 * @form
457 */
458/**
459 * Defines DataPanel Component.
460 *
461 * @syscap SystemCapability.ArkUI.ArkUI.Full
462 * @crossplatform
463 * @since 10
464 * @form
465 */
466declare const DataPanel: DataPanelInterface
467
468/**
469 * Defines DataPanel Component instance.
470 *
471 * @syscap SystemCapability.ArkUI.ArkUI.Full
472 * @since 7
473 */
474/**
475 * Defines DataPanel Component instance.
476 *
477 * @syscap SystemCapability.ArkUI.ArkUI.Full
478 * @since 9
479 * @form
480 */
481/**
482 * Defines DataPanel Component instance.
483 *
484 * @syscap SystemCapability.ArkUI.ArkUI.Full
485 * @crossplatform
486 * @since 10
487 * @form
488 */
489declare const DataPanelInstance: DataPanelAttribute;
490