1 | /// <reference types="zrender" />
|
2 | /// <reference path="./options/index.d.ts" />
|
3 |
|
4 | declare namespace echarts {
|
5 | /**
|
6 | * Creates an ECharts instance, and returns an echartsInstance. You shall
|
7 | * not initialize multiple ECharts instances on a single container.
|
8 | *
|
9 | * @param {HTMLDivElement | HTMLCanvasElement} dom Instance container,
|
10 | * usually is a `div` element with height and width defined.
|
11 | * @param {object | string} [theme] Theme to be applied.
|
12 | * This can be a configuring object of a theme, or a theme name
|
13 | * registered through [echarts.registerTheme](https://echarts.apache.org/api.html#echarts.registerTheme).
|
14 | * @param {object} [opts] Chart configurations.
|
15 | * @param {number} [opts.devicePixelRatio] Ratio of one physical pixel to
|
16 | * the size of one device independent pixels. Browser's
|
17 | * `window.devicePixelRatio` is used by default.
|
18 | * @param {string} [opts.renderer] Supports `'canvas'` or `'svg'`.
|
19 | * See [Render by Canvas or SVG](https://echarts.apache.org/tutorial.html#Render%20by%20Canvas%20or%20SVG).
|
20 | * @param {number} [opts.width] Specify width explicitly, in pixel.
|
21 | * If setting to `null`/`undefined`/`'auto'`, width of `dom`
|
22 | * (instance container) will be used.
|
23 | * @param {number} [opts.height] Specify height explicitly, in pixel.
|
24 | * If setting to `null`/`undefined`/`'auto'`, height of `dom`
|
25 | * (instance container) will be used.
|
26 | */
|
27 | function init(
|
28 | dom: HTMLDivElement | HTMLCanvasElement,
|
29 | theme?: object | string,
|
30 | opts?: {
|
31 | devicePixelRatio?: number | undefined;
|
32 | renderer?: string | undefined;
|
33 | width?: number | string | undefined;
|
34 | height?: number | string | undefined;
|
35 | },
|
36 | ): ECharts;
|
37 |
|
38 | /**
|
39 | * Connects interaction of multiple chart series. For example:
|
40 | *
|
41 | ```js
|
42 | // set group id of each instance respectively.
|
43 | chart1.group = 'group1';
|
44 | chart2.group = 'group1';
|
45 | echarts.connect('group1');
|
46 | // or incoming instance array that need to be linked.
|
47 | echarts.connect([chart1, chart2]);
|
48 | ```
|
49 | *
|
50 | * @param group Group id in string, or array of chart instance.
|
51 | */
|
52 | function connect(group: string | ECharts[]): void;
|
53 |
|
54 | /**
|
55 | * Disconnects interaction of multiple chart series. To have one single
|
56 | * instance to be removed, you can set `group` of chart instance to be null.
|
57 | *
|
58 | * @param {string} group Group id in string.
|
59 | */
|
60 | function disConnect(group: string): void;
|
61 |
|
62 | /**
|
63 | * Destroys chart instance, after which the instance cannot be used any
|
64 | * more.
|
65 | *
|
66 | * @param target Chart instance or container.
|
67 | */
|
68 | function dispose(target: ECharts | HTMLDivElement | HTMLCanvasElement): void;
|
69 |
|
70 | /**
|
71 | * Returns chart instance of dom container.
|
72 | *
|
73 | * @param target Chart container.
|
74 | */
|
75 | function getInstanceByDom(target: HTMLDivElement | HTMLCanvasElement): ECharts;
|
76 |
|
77 | /**
|
78 | * Registers available maps. This can only be used after including
|
79 | * [geo](https://echarts.apache.org/option.html#geo)
|
80 | * component or chart series of
|
81 | * [map](https://echarts.apache.org/option.html#series-map).
|
82 | *
|
83 | * @param {string} mapName Map name, referring to `map` value set in
|
84 | * [geo](https://echarts.apache.org/option.html#geo)
|
85 | * component or
|
86 | * [map](https://echarts.apache.org/option.html#series-map).
|
87 | * @param {object} geoJson Data in GeoJson format. See
|
88 | * [http://geojson.org/](http://geojson.org/) for more format information.
|
89 | * @param {object} [specialAreas] Zoomed part of a specific area in the map
|
90 | * for better visual effect.
|
91 | * See [USA Population Estimates example](https://echarts.apache.org/examples/en/editor.html?c=map-usa).
|
92 | */
|
93 | function registerMap(mapName: string, geoJson: object, specialAreas?: object): void;
|
94 |
|
95 | /**
|
96 | * Registers a theme, should be specified when
|
97 | * [initialize the chart instance](https://echarts.apache.org/api.html#echarts.init).
|
98 | *
|
99 | * @param {string} themeName Theme name.
|
100 | * @param {object} theme Theme configurations.
|
101 | */
|
102 | function registerTheme(themeName: string, theme: object): void;
|
103 |
|
104 | interface MapObj {
|
105 | /**
|
106 | * geoJson data for map
|
107 | */
|
108 | geoJson: object;
|
109 | /**
|
110 | * special areas fro map
|
111 | */
|
112 | specialAreas: object;
|
113 | }
|
114 |
|
115 | /**
|
116 | * Get a registed map.
|
117 | *
|
118 | * @param {string} mapName Map name.
|
119 | * @return {MapObj} Map data.
|
120 | */
|
121 | function getMap(mapName: string): MapObj;
|
122 |
|
123 | /**
|
124 | * Util methods about graphics.
|
125 | */
|
126 | const graphic: Graphic;
|
127 |
|
128 | interface Graphic {
|
129 | /**
|
130 | * x, y, x2, y2 are all percent from 0 to 1
|
131 | */
|
132 | LinearGradient: zrender.LinearGradient;
|
133 |
|
134 | /**
|
135 | * Create a new shape class.
|
136 | *
|
137 | * @param {number[][]} opt
|
138 | * @return {zrender.graphic.Path}
|
139 | */
|
140 | extendShape(opt: zrender.graphic.Path): zrender.graphic.Path;
|
141 |
|
142 | /**
|
143 | * Register a user defined shape.
|
144 | *
|
145 | * @param {string} name
|
146 | * @param {zrender.graphic.Path} ShapeClass
|
147 | */
|
148 | registerShape(name: string, ShapeClass: zrender.graphic.Path): void;
|
149 |
|
150 | /**
|
151 | * Get the registered shape class.
|
152 | *
|
153 | * @param {string} name
|
154 | * @return {zrender.graphic.Path}
|
155 | */
|
156 | getShapeClass(name: string): zrender.graphic.Path;
|
157 |
|
158 | /**
|
159 | * Clip the given points by the given rectangular.
|
160 | *
|
161 | * @param {number[][]} points The points to be clipped,
|
162 | * like [[23, 44], [12, 15], ...].
|
163 | * @param {ERectangle} rect The rectangular that is used to clip points.
|
164 | */
|
165 | clipPointsByRect(points: number[][], rect: ERectangle): number[][];
|
166 |
|
167 | /**
|
168 | * Clip the first input rectangular by the second input rectangular.
|
169 | *
|
170 | * @param {ERectangle} targetRect The rectangular to be clipped.
|
171 | * @param {ERectangle} rect The rectangular that is used to clip
|
172 | * targetRect.
|
173 | */
|
174 | clipRectByRect(targetRect: ERectangle, rect: ERectangle): ERectangle;
|
175 | }
|
176 |
|
177 | interface ECharts {
|
178 | /**
|
179 | * Group name to be used in chart connection
|
180 | */
|
181 | group: string;
|
182 |
|
183 | /**
|
184 | * Configuration item, data, universal interface, all parameters and
|
185 | * data can all be modified through `setOption`. ECharts will merge
|
186 | * new parameters and data, and then refresh chart.
|
187 | *
|
188 | * @param {EChartOption} option Configuration item and data. Please
|
189 | * refer to [configuration item manual](https://echarts.apache.org/option.html)
|
190 | * for more information.
|
191 | * @param {boolean} [notMerge=false] Whether not to merge with previous
|
192 | * `option`
|
193 | * @param {boolean} [lazyUpdate=false] Whether not to update chart
|
194 | * immediately
|
195 | */
|
196 | setOption(option: EChartOption | EChartsResponsiveOption, notMerge?: boolean, lazyUpdate?: boolean): void;
|
197 |
|
198 | /**
|
199 | * Configuration item, data, universal interface, all parameters and
|
200 | * data can all be modified through `setOption`. ECharts will merge
|
201 | * new parameters and data, and then refresh chart.
|
202 | *
|
203 | * @param {EChartOption} option Configuration item and data. Please
|
204 | * refer to [configuration item manual](https://echarts.apache.org/option.html)
|
205 | * for more information.
|
206 | * @param {EChartsOptionConfig} [opts] Options about how to setOption
|
207 | */
|
208 | setOption(option: EChartOption, opts?: EChartsOptionConfig): void;
|
209 |
|
210 | /**
|
211 | * Gets width of ECharts instance container.
|
212 | *
|
213 | * @return {number} Width.
|
214 | */
|
215 | getWidth(): number;
|
216 |
|
217 | /**
|
218 | * Gets height of ECharts instance container.
|
219 | *
|
220 | * @return {number} Height.
|
221 | */
|
222 | getHeight(): number;
|
223 |
|
224 | /**
|
225 | * Gets DOM element of ECharts instance container.
|
226 | *
|
227 | * @return {HTMLCanvasElement|HTMLDivElement} DOM container.
|
228 | */
|
229 | getDom(): HTMLCanvasElement | HTMLDivElement;
|
230 |
|
231 | /**
|
232 | * Gets `option` object maintained in current instance, which contains
|
233 | * configuration item and data merged from previous `setOption`
|
234 | * operations by users, along with user interaction states.
|
235 | * For example, switching of legend, zooming area of data zoom,
|
236 | * and so on. Therefore, a new instance that is exactly the same
|
237 | * can be recovered from this option.
|
238 | */
|
239 | getOption(): EChartOption;
|
240 |
|
241 | /**
|
242 | * Resizes chart, which should be called manually when container size
|
243 | * changes. When `opts` is not provided, DOM size is used.
|
244 | *
|
245 | * @param {EChartsResizeOption} opts Specify parameters explicitly.
|
246 | */
|
247 | resize(opts?: EChartsResizeOption): void;
|
248 |
|
249 | /**
|
250 | * Triggers chart action, like chart switch `legendToggleSelect`,
|
251 | * zoom data area `dataZoom`, show tooltip `showTip` and so on.
|
252 | * See [action](https://echarts.apache.org/api.html#action) and
|
253 | * [events](https://echarts.apache.org/api.html#events)
|
254 | * for more information.
|
255 | *
|
256 | * @param payload Trigger multiple actions through `batch` attribute.
|
257 | */
|
258 | dispatchAction(payload: object): void;
|
259 |
|
260 | /**
|
261 | * Binds event-handling function.
|
262 | * There are two kinds of events in ECharts, one of which is mouse
|
263 | * events, which will be triggered when the mouse clicks certain
|
264 | * element in the chart, the other kind will be triggered after
|
265 | * `dispatchAction` is called. Every action has a corresponding
|
266 | * event.
|
267 | * If event is triggered externally by `dispatchAction`, and there
|
268 | * is batch attribute in action to trigger batch action, then the
|
269 | * corresponding response event parameters be in batch.
|
270 | *
|
271 | * @param {string} eventName Event names are all in lower-cases,
|
272 | * for example, `'click'`, `'mousemove'`, `'legendselected'`
|
273 | * @param {Function} handler Event-handling function, whose format
|
274 | * is as following:
|
275 | ```js
|
276 | (event: object)
|
277 | ```
|
278 | * @param {object} [context] context of callback function, what
|
279 | * `this` refers to.
|
280 | */
|
281 | on(eventName: string, handler: Function, context?: object): void;
|
282 |
|
283 | /**
|
284 | * Binds event-handling function.
|
285 | * There are two kinds of events in ECharts, one of which is mouse
|
286 | * events, which will be triggered when the mouse clicks certain
|
287 | * element in the chart, the other kind will be triggered after
|
288 | * `dispatchAction` is called. Every action has a corresponding
|
289 | * event.
|
290 | * If event is triggered externally by `dispatchAction`, and there
|
291 | * is batch attribute in action to trigger batch action, then the
|
292 | * corresponding response event parameters be in batch.
|
293 | *
|
294 | * @param {string} eventName Event names are all in lower-cases,
|
295 | * for example, `'click'`, `'mousemove'`, `'legendselected'`
|
296 | * @param {string | Object} query Condition for filtering, optional.
|
297 | * `query` enables only call handlers on graphic elements of
|
298 | * specified components. Can be `string` or `Object`.
|
299 | * If `string`, the formatter can be 'mainType' or 'mainType.subType'.
|
300 | * For example:
|
301 | * ```ts
|
302 | * chart.on('click', 'series', function () {...});
|
303 | * chart.on('click', 'series.line', function () {...});
|
304 | * chart.on('click', 'dataZoom', function () {...});
|
305 | * chart.on('click', 'xAxis.category', function () {...});
|
306 | * ```
|
307 | * If `Object`, one or more properties below can be included,
|
308 | * and any of them is optional.
|
309 | * ```ts
|
310 | * {
|
311 | * <mainType>Index: number // component index
|
312 | * <mainType>Name: string // component name
|
313 | * <mainType>Id: string // component id
|
314 | * dataIndex: number // data item index
|
315 | * name: string // data item name
|
316 | * dataType: string // data item type, e.g.,
|
317 | * // 'node' and 'edge' in graph.
|
318 | * element: string // element name in custom series
|
319 | * }
|
320 | * ```
|
321 | * For example:
|
322 | * ```ts
|
323 | * chart.setOption({
|
324 | * // ...
|
325 | * series: [{
|
326 | * name: 'uuu'
|
327 | * // ...
|
328 | * }]
|
329 | * });
|
330 | * chart.on('mouseover', {seriesName: 'uuu'}, function () {
|
331 | * // When the graphic elements in the series with name 'uuu' mouse
|
332 | * // overed, this method is called.
|
333 | * });
|
334 | * ```
|
335 | * For example:
|
336 | * ```ts
|
337 | * chart.setOption({
|
338 | * // ...
|
339 | * series: [{
|
340 | * type: 'graph',
|
341 | * nodes: [{name: 'a', value: 10}, {name: 'b', value: 20}],
|
342 | * edges: [{source: 0, target: 1}]
|
343 | * }]
|
344 | * });
|
345 | * chart.on('click', {dataType: 'node'}, function () {
|
346 | * // When the nodes of the graph clicked, this method is called.
|
347 | * });
|
348 | * chart.on('click', {dataType: 'edge'}, function () {
|
349 | * // When the edges of the graph clicked, this method is called.
|
350 | * });
|
351 | * ```
|
352 | * For example
|
353 | * ```ts
|
354 | * chart.setOption({
|
355 | * // ...
|
356 | * series: {
|
357 | * // ...
|
358 | * type: 'custom',
|
359 | * renderItem: function (params, api) {
|
360 | * return {
|
361 | * type: 'group',
|
362 | * children: [{
|
363 | * type: 'circle',
|
364 | * name: 'my_el',
|
365 | * // ...
|
366 | * }, {
|
367 | * // ...
|
368 | * }]
|
369 | * }
|
370 | * },
|
371 | * data: [[12, 33]]
|
372 | * }
|
373 | * })
|
374 | * chart.on('click', {targetName: 'my_el'}, function () {
|
375 | * // When the element with name 'my_el' clicked, this method is called.
|
376 | * });
|
377 | * ```
|
378 | * @param {Function} handler Event-handling function, whose format
|
379 | * is as following:
|
380 | ```js
|
381 | (event: object)
|
382 | ```
|
383 | * @param {object} [context] context of callback function, what
|
384 | * `this` refers to.
|
385 | */
|
386 | on(eventName: string, query: string | Object, handler: Function, context?: object): void;
|
387 |
|
388 | /**
|
389 | * Unbind event-handler function.
|
390 | *
|
391 | * @param {string} eventName Event names are all in lower-cases,
|
392 | * for example, `'click'`, `'mousemove'`, `'legendselected'`
|
393 | * @param {Function} [handler] The function to be unbound could be
|
394 | * passed. Otherwise, all event functions of this type will be
|
395 | * unbound.
|
396 | */
|
397 | off(eventName: string, handler?: Function): void;
|
398 |
|
399 | /**
|
400 | * Convert a point from logical coordinate (e.g., in geo, cartesian,
|
401 | * graph, ...) to pixel coordinate.
|
402 | *
|
403 | * @param {EChartsConvertFinder} finder Indicate in which coordinate
|
404 | * system conversion is performed.
|
405 | * Generally, index or id or name can be used to specify
|
406 | * coordinate system.
|
407 | * @param {string | any[]} value The value to be converted.
|
408 | */
|
409 | convertToPixel(finder: EChartsConvertFinder, value: string | any[]): string | any[];
|
410 |
|
411 | /**
|
412 | * Convert a point from pixel coordinate to logical coordinate
|
413 | * (e.g., in geo, cartesian, graph, ...).
|
414 | *
|
415 | * @param {EChartsConvertFinder} finder Indicate in which coordinate
|
416 | * system conversion is performed.
|
417 | * Generally, index or id or name can be used to specify
|
418 | * coordinate system.
|
419 | * @param {string | any[]} value The value to be converted.
|
420 | */
|
421 | convertFromPixel(finder: EChartsConvertFinder, value: any[] | string): any[] | string;
|
422 |
|
423 | /**
|
424 | * Determine whether the given point is in the given coordinate systems or series.
|
425 | *
|
426 | * @param {EChartsConvertFinder} finder Indicate in which coordinate
|
427 | * system conversion is performed.
|
428 | * Generally, index or id or name can be used to specify
|
429 | * coordinate system.
|
430 | * @param {string | any[]} value The value to be judged, in pixel
|
431 | * coordinate system.
|
432 | */
|
433 | containPixel(finder: EChartsConvertFinder, value: any[]): boolean;
|
434 |
|
435 | /**
|
436 | * Shows loading animation. You can call this interface manually before
|
437 | * data is loaded, and call `hideLoading` to hide loading animation
|
438 | * after data is loaded.
|
439 | *
|
440 | * @param {string} [type='default']
|
441 | * @param {EChartsLoadingOption} [opts]
|
442 | */
|
443 | showLoading(type?: string, opts?: EChartsLoadingOption): void;
|
444 |
|
445 | /**
|
446 | * Hides animation loading effect.
|
447 | */
|
448 | hideLoading(): void;
|
449 |
|
450 | /**
|
451 | * Exports chart image; returns a base64 URL; can be set to `src` of
|
452 | * `Image`.
|
453 | *
|
454 | * @param opts Options.
|
455 | */
|
456 | getDataURL(opts: {
|
457 | // Exporting format, can be either png, or jpeg
|
458 | type?: string | undefined;
|
459 | // Resolution ratio of exporting image, 1 by default.
|
460 | pixelRatio?: number | undefined;
|
461 | // Background color of exporting image, use backgroundColor in
|
462 | // option by default.
|
463 | backgroundColor?: string | undefined;
|
464 | // Excluded components list. e.g. ['toolbox']
|
465 | excludeComponents?: string[] | undefined;
|
466 | }): string;
|
467 |
|
468 | /**
|
469 | * Exports connected chart image; returns a base64 url; can be set to
|
470 | * `src` of `Image`. Position of charts in exported image are
|
471 | * related to that of the container.
|
472 | *
|
473 | * @param opts Options.
|
474 | */
|
475 | getConnectedDataURL(opts: {
|
476 | // Exporting format, can be either png, or jpeg
|
477 | type: string;
|
478 | // Resolution ratio of exporting image, 1 by default.
|
479 | pixelRatio: number;
|
480 | // Background color of exporting image, use backgroundColor in
|
481 | // option by default.
|
482 | backgroundColor: string;
|
483 | // Excluded components list. e.g. ['toolbox']
|
484 | excludeComponents?: string[] | undefined;
|
485 | }): string;
|
486 |
|
487 | /**
|
488 | * The method is used in rendering millions of data
|
489 | * (e.g. rendering geo data). In these scenario, the entire size of
|
490 | * data is probably up to 10 or 100 MB, even using binary format.
|
491 | * So chunked load data and rendering is required. When using
|
492 | * `appendData`, the graphic elements that have been rendered will
|
493 | * not be cleared, but keep rendering new graphic elements.
|
494 | *
|
495 | * @param opts Data options.
|
496 | */
|
497 | appendData(opts: {
|
498 | // Specify which series the data will be appended to.
|
499 | seriesIndex?: string | undefined;
|
500 | // The data to be appended.
|
501 | data?: any[] | TypedArray | undefined;
|
502 | }): void;
|
503 |
|
504 | /**
|
505 | * Clears current instance; removes all components and charts in
|
506 | * current instance.
|
507 | */
|
508 | clear(): void;
|
509 |
|
510 | /**
|
511 | * Returns whether current instance has been disposed.
|
512 | *
|
513 | * @return {boolean} Whether has been disposed.
|
514 | */
|
515 | isDisposed(): boolean;
|
516 |
|
517 | /**
|
518 | * Disposes instance. Once disposed, the instance can not be used again.
|
519 | */
|
520 | dispose(): void;
|
521 | }
|
522 |
|
523 | type TypedArray =
|
524 | | Int8Array
|
525 | | Uint8Array
|
526 | | Int16Array
|
527 | | Uint16Array
|
528 | | Int32Array
|
529 | | Uint32Array
|
530 | | Uint8ClampedArray
|
531 | | Float32Array
|
532 | | Float64Array;
|
533 |
|
534 | interface EChartsConvertFinder {
|
535 | seriesIndex?: number | undefined;
|
536 | seriesId?: string | undefined;
|
537 | seriesName?: string | undefined;
|
538 | geoIndex?: number | undefined;
|
539 | geoId?: string | undefined;
|
540 | geoName?: string | undefined;
|
541 | xAxisIndex?: number | undefined;
|
542 | xAxisId?: string | undefined;
|
543 | xAxisName?: string | undefined;
|
544 | yAxisIndex?: number | undefined;
|
545 | yAxisId?: string | undefined;
|
546 | yAxisName?: string | undefined;
|
547 | gridIndex?: number | undefined;
|
548 | gridId?: string | undefined;
|
549 | gridName?: string | undefined;
|
550 | }
|
551 |
|
552 | interface ERectangle {
|
553 | x: number;
|
554 | y: number;
|
555 | width: number;
|
556 | height: number;
|
557 | }
|
558 |
|
559 | type EChartsSeriesType =
|
560 | | "line"
|
561 | | "bar"
|
562 | | "pie"
|
563 | | "scatter"
|
564 | | "effectScatter"
|
565 | | "radar"
|
566 | | "tree"
|
567 | | "treemap"
|
568 | | "sunburst"
|
569 | | "boxplot"
|
570 | | "candlestick"
|
571 | | "heatmap"
|
572 | | "map"
|
573 | | "parallel"
|
574 | | "lines"
|
575 | | "graph"
|
576 | | "sankey"
|
577 | | "funnel"
|
578 | | "gauge"
|
579 | | "pictorialBar"
|
580 | | "themeRiver"
|
581 | | "custom";
|
582 |
|
583 | interface EChartOption<TSeries = EChartOption.Series> {
|
584 | /**
|
585 | * Title component, including main title and subtitle.
|
586 | * In ECharts 2.x, a single instance of ECharts could contains
|
587 | * one title component at most.
|
588 | * However, in ECharts 3, there could be one or more
|
589 | * than one title components.
|
590 | * It is more useful when multiple diagrams in one instance all need titles.
|
591 | *
|
592 | * @see https://echarts.apache.org/en/option.html#title
|
593 | */
|
594 | title?: EChartTitleOption | EChartTitleOption[] | undefined;
|
595 |
|
596 | /**
|
597 | * Legend component.
|
598 | * Legend component shows symbol, color and name of different series.
|
599 | * You can click legends to toggle displaying series in the chart.
|
600 | * In ECharts 3, a single echarts instance may contain multiple
|
601 | * legend components, which makes it easier for the layout of multiple
|
602 | * legend components.
|
603 | * If there have to be too many legend items, `vertically scrollable` legend
|
604 | * or `horizontally scrollable` legend are options to paginate them.
|
605 | * Check `legend.type` please.
|
606 | *
|
607 | * @see https://echarts.apache.org/en/option.html#legend
|
608 | */
|
609 | legend?: EChartOption.Legend | undefined;
|
610 |
|
611 | /**
|
612 | * Drawing grid in rectangular coordinate.
|
613 | * In a single grid, at most two X and Y axes each is allowed.
|
614 | * `Line chart`, `bar chart`, and `scatter chart (bubble chart)`
|
615 | * can be drawn in grid.
|
616 | * In ECharts 2.x, there could only be one single grid component
|
617 | * at most in a single echarts instance.
|
618 | * But in ECharts 3, there is no limitation.
|
619 | *
|
620 | * @see https://echarts.apache.org/en/option.html#grid
|
621 | */
|
622 | grid?: EChartOption.Grid | EChartOption.Grid[] | undefined;
|
623 |
|
624 | /**
|
625 | * The x axis in cartesian(rectangular) coordinate.
|
626 | * Usually a single grid component can place at most 2 x axis,
|
627 | * one on the bottom and another on the top.
|
628 | * offset can be used to avoid overlap when you need to put more
|
629 | * than two x axis.
|
630 | *
|
631 | * @see https://echarts.apache.org/en/option.html#xAxis
|
632 | */
|
633 | xAxis?: EChartOption.XAxis | EChartOption.XAxis[] | undefined;
|
634 |
|
635 | /**
|
636 | * The y axis in cartesian(rectangular) coordinate.
|
637 | * Usually a single grid component can place at most 2 y axis,
|
638 | * one on the left and another on the right. offset can be used
|
639 | * to avoid overlap when you need to put more than two y axis.
|
640 | *
|
641 | * @see https://echarts.apache.org/en/option.html#yAxis
|
642 | */
|
643 | yAxis?: EChartOption.YAxis | EChartOption.YAxis[] | undefined;
|
644 |
|
645 | /**
|
646 | * Polar coordinate can be used in scatter and line chart.
|
647 | * Every polar coordinate has an `angleAxis` and a `radiusAxis`.
|
648 | *
|
649 | * @see https://echarts.apache.org/en/option.html#polar
|
650 | */
|
651 | polar?: object | undefined;
|
652 |
|
653 | /**
|
654 | * Radial axis of polar coordinate.
|
655 | *
|
656 | * @see https://echarts.apache.org/en/option.html#radiusAxis
|
657 | */
|
658 | radiusAxis?: object | undefined;
|
659 |
|
660 | /**
|
661 | * The angle axis in Polar Coordinate.
|
662 | *
|
663 | * @see https://echarts.apache.org/en/option.html#angleAxis
|
664 | */
|
665 | angleAxis?: object | undefined;
|
666 |
|
667 | /**
|
668 | * Coordinate for `radar charts`.
|
669 | * This component is equal to the polar component in ECharts 2.
|
670 | * Because the polar component in the echarts 3 is reconstructed
|
671 | * to be the standard polar coordinate component,
|
672 | * this component is renamed to be radar to avoid confusion.
|
673 | * Radar chart coordinate is different from polar coordinate,
|
674 | * in that every axis indicator of the radar chart coordinate
|
675 | * is an individual dimension.
|
676 | * The style of indicator coordinate axis could be configured
|
677 | * through the following configuration items,
|
678 | * including `name`, `axisLine`, `axisTick`, `axisLabel`,
|
679 | * `splitLine`, `splitArea`.
|
680 | *
|
681 | * @see https://echarts.apache.org/en/option.html#radar
|
682 | */
|
683 | radar?: object | undefined;
|
684 |
|
685 | /**
|
686 | * `dataZoom` component is used for zooming a specific area,
|
687 | * which enables user to investigate data in detail,
|
688 | * or get an overview of the data,
|
689 | * or get rid of outlier points.
|
690 | * These types of `dataZoom` component are supported:
|
691 | * + `dataZoomInside`: Data zoom functionalities is embeded
|
692 | * inside coordinate systems, enable user to zoom
|
693 | * or roam coordinate system by mouse dragging,
|
694 | * mouse move or finger touch (in touch screen).
|
695 | * + `dataZoomSlider`: A special slider bar is provided,
|
696 | * on which coordinate systems can be zoomed or roamed
|
697 | * by mouse dragging or finger touch (in touch screen).
|
698 | * + `dataZoomSelect`: A marquee tool is provided for zooming
|
699 | * or roaming coordinate system.
|
700 | * That is `toolbox.feature.dataZoom`, which can only be configured
|
701 | * in toolbox.
|
702 | *
|
703 | * @see https://echarts.apache.org/en/option.html#dataZoom
|
704 | */
|
705 | dataZoom?: EChartOption.DataZoom[] | undefined;
|
706 |
|
707 | /**
|
708 | * `visualMap` is a type of component for visual encoding,
|
709 | * which maps the data to visual channels, including:
|
710 | * + symbol: Type of symbol.
|
711 | * + symbolSize: Symbol size.
|
712 | * + color: Symbol color.
|
713 | * + colorAlpha: Symbol alpha channel.
|
714 | * + opacity: Opacity of symbol and others (like labels).
|
715 | * + colorLightness: Lightness in HSL.
|
716 | * + colorSaturation: Saturation in HSL.
|
717 | * + colorHue: Hue in HSL.
|
718 | * Myltiple `visualMap` component could be defined in a chart instance,
|
719 | * which enable that different dimensions
|
720 | * of a series data are mapped to different visual channels.
|
721 | * `visualMap` could be defined as `Piecewise (visualMapPiecewise)`
|
722 | * or `Continuous (visualMapContinuous)`,
|
723 | * which is distinguished by the property type.
|
724 | *
|
725 | * @example
|
726 | * option = {
|
727 | * visualMap: [
|
728 | * { // the first visualMap component
|
729 | * type: 'continuous', // defined to be continuous viusalMap
|
730 | * ...
|
731 | * },
|
732 | * { // the sencond visualMap component
|
733 | * type: 'piecewise', // defined to be piecewise visualMap
|
734 | * ...
|
735 | * }
|
736 | * ],
|
737 | * ...
|
738 | * };
|
739 | *
|
740 | * @see https://echarts.apache.org/en/option.html#visualMap
|
741 | */
|
742 | visualMap?: EChartOption.VisualMap[] | undefined;
|
743 |
|
744 | /**
|
745 | * Tooltip component.
|
746 | * It can be configured on different places:
|
747 | * + Configured on global: `tooltip`
|
748 | * + Configured in a coordinate system: `grid.tooltip`,
|
749 | * `polar.tooltip`, `single.tooltip`
|
750 | * + Configured in a series: `series.tooltip`
|
751 | * + Configured in each item of `series.data`: `series.data.tooltip`
|
752 | *
|
753 | * @see https://echarts.apache.org/en/option.html#tooltip
|
754 | */
|
755 | tooltip?: EChartOption.Tooltip | undefined;
|
756 |
|
757 | /**
|
758 | * `axisPointer` is a tool for displaying reference line and axis value
|
759 | * under mouse pointer.
|
760 | *
|
761 | * @see https://echarts.apache.org/en/option.html#axisPointer
|
762 | */
|
763 | axisPointer?: EChartOption.AxisPointer | undefined;
|
764 |
|
765 | /**
|
766 | * A group of utility tools, which includes `export`, `data view`,
|
767 | * `dynamic type switching`, `data area zooming`, and `reset`.
|
768 | *
|
769 | * @see https://echarts.apache.org/en/option.html#toolbox
|
770 | */
|
771 | toolbox?: object | undefined;
|
772 |
|
773 | /**
|
774 | * `brush` is an area-selecting component, with which user can select
|
775 | * part of data from a chart to display in detail, or doing calculations
|
776 | * with them.
|
777 | *
|
778 | * @see https://echarts.apache.org/en/option.html#brush
|
779 | */
|
780 | brush?: object | undefined;
|
781 |
|
782 | /**
|
783 | * Geographic coorinate system component.
|
784 | * Geographic coorinate system component is used to draw maps,
|
785 | * which also supports `scatter series`, and `line series`.
|
786 | *
|
787 | * @see https://echarts.apache.org/en/option.html#geo
|
788 | */
|
789 | geo?: object | undefined;
|
790 |
|
791 | /**
|
792 | * `Parallel Coordinates` is a common way of visualizing high-dimensional
|
793 | * geometry and analyzing multivariate data.
|
794 | * For example, `series-parallel.data` is the following data:
|
795 | *
|
796 | * @example
|
797 | * [
|
798 | * [1, 55, 9, 56, 0.46, 18, 6, 'good'],
|
799 | * [2, 25, 11, 21, 0.65, 34, 9, 'excellent'],
|
800 | * [3, 56, 7, 63, 0.3, 14, 5, 'good'],
|
801 | * [4, 33, 7, 29, 0.33, 16, 6, 'excellent'],
|
802 | * { // Data item can also be an Object,
|
803 | * // so that perticular settings of its line can be set here.
|
804 | * value: [5, 42, 24, 44, 0.76, 40, 16, 'excellent']
|
805 | * lineStyle: {...},
|
806 | * }
|
807 | * ...
|
808 | * ]
|
809 | *
|
810 | * @see https://echarts.apache.org/en/option.html#parallel
|
811 | */
|
812 | parallel?: object | undefined;
|
813 |
|
814 | /**
|
815 | * This component is the coordinate axis for parallel coordinate.
|
816 | *
|
817 | * @see https://echarts.apache.org/en/option.html#parallelAxis
|
818 | */
|
819 | parallelAxis?: object | undefined;
|
820 |
|
821 | /**
|
822 | * An axis with a single dimension. It can be used to display data
|
823 | * in one dimension.
|
824 | *
|
825 | * @see https://echarts.apache.org/en/option.html#singleAxis
|
826 | */
|
827 | singleAxis?: EChartOption.SingleAxis | EChartOption.SingleAxis[] | undefined;
|
828 |
|
829 | /**
|
830 | * `timeline` component, which provides functions like switching and playing
|
831 | * between multiple ECharts `options`.
|
832 | *
|
833 | * @see https://echarts.apache.org/en/option.html#timeline
|
834 | */
|
835 | timeline?: object | undefined;
|
836 |
|
837 | /**
|
838 | * `graphic` component enable creating graphic elements in echarts.
|
839 | * Those graphic type are supported.
|
840 | * `image`, `text`, `circle`, `sector`, `ring`, `polygon`,
|
841 | * `polyline`, `rect`, `line`, `bezierCurve`, `arc`, `group`,
|
842 | *
|
843 | * @see https://echarts.apache.org/en/option.html#graphic
|
844 | */
|
845 | graphic?: object | object[] | undefined;
|
846 |
|
847 | /**
|
848 | * Calendar coordinates.
|
849 | * In ECharts, we are very creative to achieve the calendar chart,
|
850 | * by using the calendar coordinates
|
851 | * to achieve the calendar chart, as shown in the following example,
|
852 | * we can use calendar coordinates
|
853 | * in `heatmap`, `scatter`, `effectScatter`, and `graph`.
|
854 |
|
855 | * @see https://echarts.apache.org/en/option.html#calendar
|
856 | */
|
857 | calendar?: EChartOption.Calendar | EChartOption.Calendar[] | undefined;
|
858 |
|
859 | /**
|
860 | * @see https://echarts.apache.org/en/option.html#dataset
|
861 | */
|
862 | dataset?: EChartOption.Dataset | EChartOption.Dataset[] | undefined;
|
863 |
|
864 | /**
|
865 | * `dataset` component is published since ECharts 4.
|
866 | * `dataset` brings convenience in data management separated with styles
|
867 | * and enables data reuse by different series.
|
868 | * More importantly, is enables data encoding from data to visual,
|
869 | * which brings convenience in some scenarios.
|
870 | * More details about `dataset` can be checked in the tutorial.
|
871 | * @see https://echarts.apache.org/en/option.html#aria
|
872 | */
|
873 | aria?: object | undefined;
|
874 |
|
875 | /**
|
876 | * @see https://echarts.apache.org/en/option.html#series
|
877 | */
|
878 | series?: TSeries[] | undefined;
|
879 |
|
880 | /**
|
881 | * The color list of palette.
|
882 | * If no color is set in series, the colors would be adopted sequentially
|
883 | * and circularly from this list
|
884 | * as the colors of series.
|
885 | * @default
|
886 | * [
|
887 | * '#c23531','#2f4554','#61a0a8','#d48265','#91c7ae',
|
888 | * '#749f83', '#ca8622','#bda29a','#6e7074','#546570',
|
889 | * '#c4ccd3'
|
890 | * ]
|
891 | *
|
892 | * @see https://echarts.apache.org/en/option.html#color
|
893 | */
|
894 | color?: string[] | undefined;
|
895 |
|
896 | /**
|
897 | * Background color. Defaults to have no background.
|
898 | *
|
899 | * @see https://echarts.apache.org/en/option.html#backgroundColor
|
900 | */
|
901 | backgroundColor?: EChartOption.Color | undefined;
|
902 |
|
903 | /**
|
904 | * Global font style.
|
905 | *
|
906 | * @see https://echarts.apache.org/en/option.html#textStyle
|
907 | */
|
908 | textStyle?: (EChartOption.BaseTextStyle & EChartOption.BaseTextStyleWithRich) | undefined;
|
909 |
|
910 | /**
|
911 | * Whether to enable animation.
|
912 | *
|
913 | * @see https://echarts.apache.org/en/option.html#animation
|
914 | */
|
915 | animation?: boolean | undefined;
|
916 |
|
917 | /**
|
918 | * Whether to set graphic number threshold to animation.
|
919 | * Animation will be disabled when graphic number is larger than threshold.
|
920 | *
|
921 | * @see https://echarts.apache.org/en/option.html#animationThreshold
|
922 | */
|
923 | animationThreshold?: number | undefined;
|
924 |
|
925 | /**
|
926 | * Duration of the first animation, which supports callback function
|
927 | * for different data to have different animation effect
|
928 | *
|
929 | * @example
|
930 | * animationDuration: function (idx) {
|
931 | * // delay for later data is larger
|
932 | * return idx * 100;
|
933 | * }
|
934 | * @see https://echarts.apache.org/en/option.html#animationDuration
|
935 | */
|
936 | animationDuration?: number | undefined;
|
937 |
|
938 | /**
|
939 | * Easing method used for the first animation.
|
940 | * Varied easing effects can be found at `easing effect example`.
|
941 | *
|
942 | * @see https://echarts.apache.org/en/option.html#animationEasing
|
943 | */
|
944 | animationEasing?: string | undefined;
|
945 |
|
946 | /**
|
947 | * Delay before updating the first animation, which supports
|
948 | * callback function for different data
|
949 | * to have different animation effect.
|
950 | *
|
951 | * @example
|
952 | * animationDelay: function (idx) {
|
953 | * // delay for later data is larger
|
954 | * return idx * 100;
|
955 | * }
|
956 | * @see https://echarts.apache.org/en/option.html#animationDelay
|
957 | */
|
958 | animationDelay?: number | Function | undefined;
|
959 |
|
960 | /**
|
961 | * Time for animation to complete, which supports callback function
|
962 | * for different data to have different animation effect
|
963 | *
|
964 | * @example
|
965 | * animationDurationUpdate: function (idx) {
|
966 | * // delay for later data is larger
|
967 | * return idx * 100;
|
968 | * }
|
969 | * @see https://echarts.apache.org/en/option.html#animationDurationUpdate
|
970 | */
|
971 | animationDurationUpdate?: number | Function | undefined;
|
972 |
|
973 | /**
|
974 | * Easing method used for animation.
|
975 | *
|
976 | * @see https://echarts.apache.org/en/option.html#animationEasingUpdate
|
977 | */
|
978 | animationEasingUpdate?: string | undefined;
|
979 |
|
980 | /**
|
981 | * Delay before updating animation, which supports callback function
|
982 | * for different data to have different animation effect.
|
983 | *
|
984 | * @example
|
985 | * animationDelayUpdate: function (idx) {
|
986 | * // delay for later data is larger
|
987 | * return idx * 100;
|
988 | * }
|
989 | * @see https://echarts.apache.org/en/option.html#animationDelayUpdate
|
990 | */
|
991 | animationDelayUpdate?: number | Function | undefined;
|
992 |
|
993 | /**
|
994 | * Configuration for progressive/incremental rendering
|
995 | *
|
996 | * @default 400
|
997 | */
|
998 | progressive?: number | undefined;
|
999 |
|
1000 | /**
|
1001 | * Configuration for progressive/incremental rendering
|
1002 | *
|
1003 | * @default 3000
|
1004 | */
|
1005 | progressiveThreshold?: number | undefined;
|
1006 |
|
1007 | /**
|
1008 | * Equal to CanvasRenderingContext2D.globalCompositeOperation
|
1009 | *
|
1010 | * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
|
1011 | */
|
1012 | blendMode?: string | undefined;
|
1013 |
|
1014 | /**
|
1015 | * Threshold of if use single hover layer to optimize.
|
1016 | * It is recommended that `hoverLayerThreshold` is equivalent to or less than
|
1017 | * `progressiveThreshold`, otherwise hover will cause restart of progressive,
|
1018 | * which is unexpected.
|
1019 | * see example <echarts/test/heatmap-large.html>.
|
1020 | *
|
1021 | * @default 3000
|
1022 | */
|
1023 | hoverLayerThreshold?: number | undefined;
|
1024 |
|
1025 | /**
|
1026 | * Whether to use UTC in display.
|
1027 | * - `true`: When `axis.type` is `'time'`, ticks is determined
|
1028 | * according to UTC, and `axisLabel` and `tooltip` use UTC by default.
|
1029 | * - `false`: When `axis.type` is `'time'`, ticks is determined
|
1030 | * according to local time, and `axisLabel` and `tooltip` use local time
|
1031 | * by default.
|
1032 | *
|
1033 | * The default value of useUTC is false, for sake of considering:
|
1034 | * - In many cases, labels should be displayed in local time
|
1035 | * (whether the time is stored in server in local time or UTC).
|
1036 | * - If user uses time string (like '2012-01-02') in data,
|
1037 | * it usually means local time if time zone is not specified.
|
1038 | * Time should be displayed in its original time zone by default.
|
1039 | *
|
1040 | * Notice: the setting only effects 'display time', but not 'parse time'.
|
1041 | * About how time value (like `1491339540396`, `'2013-01-04'`, ...)
|
1042 | * is parsed in echarts, see `the time part in date`.
|
1043 | *
|
1044 | * @see https://echarts.apache.org/en/option.html#useUTC
|
1045 | */
|
1046 | useUTC?: boolean | undefined;
|
1047 | }
|
1048 |
|
1049 | type EChartsMediaOption = {
|
1050 | query: {
|
1051 | width?: number | undefined;
|
1052 | height?: number | undefined;
|
1053 | aspectRatio?: number | undefined;
|
1054 | minWidth?: number | undefined;
|
1055 | minHeight?: number | undefined;
|
1056 | minAspectRatio?: number | undefined;
|
1057 | maxWidth?: number | undefined;
|
1058 | maxHeight?: number | undefined;
|
1059 | maxAspectRatio?: number | undefined;
|
1060 | };
|
1061 | option: EChartOption;
|
1062 | };
|
1063 |
|
1064 | interface EChartsResponsiveOption {
|
1065 | baseOption?: EChartOption | undefined;
|
1066 | media?: EChartsMediaOption[] | undefined;
|
1067 | }
|
1068 |
|
1069 | interface EChartsOptionConfig {
|
1070 | notMerge?: boolean | undefined;
|
1071 | lazyUpdate?: boolean | undefined;
|
1072 | silent?: boolean | undefined;
|
1073 | }
|
1074 |
|
1075 | interface EChartsResizeOption {
|
1076 | /**
|
1077 | * Chart width.
|
1078 | */
|
1079 | width?: number | string | undefined;
|
1080 |
|
1081 | /**
|
1082 | * Chart height.
|
1083 | */
|
1084 | height?: number | string | undefined;
|
1085 |
|
1086 | /**
|
1087 | * Specify whether or not to prevent triggering events.
|
1088 | */
|
1089 | silent?: boolean | undefined;
|
1090 | }
|
1091 |
|
1092 | interface EChartTitleOption {
|
1093 | show?: boolean | undefined;
|
1094 | text?: string | undefined;
|
1095 | link?: string | undefined;
|
1096 | target?: string | undefined;
|
1097 | textStyle?: EChartOption.TextStyleWithRich | undefined;
|
1098 | subtext?: string | undefined;
|
1099 | sublink?: string | undefined;
|
1100 | subtarget?: string | undefined;
|
1101 | subtextStyle?: EChartOption.TextStyleWithRich | undefined;
|
1102 | textAlign?: string | undefined;
|
1103 | textVerticalAlign?: string | undefined;
|
1104 | triggerEvent?: boolean | undefined;
|
1105 | /**
|
1106 | * Title space around content. The unit is `px`.
|
1107 | * Default values for each position are 5.
|
1108 | * And they can be set to different values with left, right, top, and bottom.
|
1109 | */
|
1110 | padding?: number | number[] | undefined;
|
1111 | itemGap?: number | undefined;
|
1112 | zlevel?: number | undefined;
|
1113 | z?: number | undefined;
|
1114 | left?: string | number | undefined;
|
1115 | top?: string | number | undefined;
|
1116 | right?: string | number | undefined;
|
1117 | bottom?: string | number | undefined;
|
1118 | backgroundColor?: string | undefined;
|
1119 | borderColor?: string | undefined;
|
1120 | borderWidth?: number | undefined;
|
1121 | borderRadius?: number | number[] | undefined;
|
1122 | shadowBlur?: number | undefined;
|
1123 | shadowColor?: number | undefined;
|
1124 | shadowOffsetX?: number | undefined;
|
1125 | shadowOffsetY?: number | undefined;
|
1126 | }
|
1127 |
|
1128 | /**
|
1129 | * Options for `echartsInstance.showLoading` method
|
1130 | * {@link https://echarts.apache.org/en/api.html#echartsInstance.showLoading}
|
1131 | */
|
1132 | interface EChartsLoadingOption {
|
1133 | /**
|
1134 | * Loading text.
|
1135 | * @default 'loading'
|
1136 | */
|
1137 | text?: string | undefined;
|
1138 |
|
1139 | /**
|
1140 | * Loading circle color.
|
1141 | * @default '#c23531'
|
1142 | */
|
1143 | color?: string | undefined;
|
1144 |
|
1145 | /**
|
1146 | * Loading text color.
|
1147 | * @default '#000'
|
1148 | */
|
1149 | textColor?: string | undefined;
|
1150 |
|
1151 | /**
|
1152 | * Mask background color.
|
1153 | * @default 'rgba(255, 255, 255, 0.8)'
|
1154 | */
|
1155 | maskColor?: string | undefined;
|
1156 |
|
1157 | /**
|
1158 | * Zlevel of loading. If not 0, it creates a new canvas for loading.
|
1159 | * @default 0
|
1160 | */
|
1161 | zlevel?: number | undefined;
|
1162 |
|
1163 | /**
|
1164 | * Font size.
|
1165 | * @default 12
|
1166 | * @since 4.8.0
|
1167 | */
|
1168 | fontSize?: number | undefined;
|
1169 |
|
1170 | /**
|
1171 | * Show an animated "spinner" or not.
|
1172 | * @default true
|
1173 | * @since 4.8.0
|
1174 | */
|
1175 | showSpinner?: boolean | undefined;
|
1176 |
|
1177 | /**
|
1178 | * Radius of the "spinner".
|
1179 | * @default 10
|
1180 | * @since 4.8.0
|
1181 | */
|
1182 | spinnerRadius?: number | undefined;
|
1183 |
|
1184 | /**
|
1185 | * Line width of the "spinner".
|
1186 | * @default 5
|
1187 | * @since 4.8.0
|
1188 | */
|
1189 | lineWidth?: number | undefined;
|
1190 | }
|
1191 |
|
1192 | namespace EChartOption {
|
1193 | type Series =
|
1194 | | SeriesLine
|
1195 | | SeriesBar
|
1196 | | SeriesPie
|
1197 | | SeriesScatter
|
1198 | | SeriesEffectScatter
|
1199 | | SeriesRadar
|
1200 | | SeriesTree
|
1201 | | SeriesTreemap
|
1202 | | SeriesSunburst
|
1203 | | SeriesBoxplot
|
1204 | | SeriesCandlestick
|
1205 | | SeriesHeatmap
|
1206 | | SeriesMap
|
1207 | | SeriesParallel
|
1208 | | SeriesLines
|
1209 | | SeriesGraph
|
1210 | | SeriesSankey
|
1211 | | SeriesFunnel
|
1212 | | SeriesGauge
|
1213 | | SeriesPictorialBar
|
1214 | | SeriesThemeRiver
|
1215 | | SeriesCustom;
|
1216 |
|
1217 | namespace BasicComponents {
|
1218 | /**
|
1219 | * @todo describe
|
1220 | */
|
1221 | interface Line {
|
1222 | show?: boolean | undefined;
|
1223 | onZero?: boolean | undefined;
|
1224 | onZeroAxisIndex?: number | undefined;
|
1225 | symbol?: string | string[] | undefined;
|
1226 | symbolSize?: number[] | undefined;
|
1227 | symbolOffset?: number[] | undefined;
|
1228 | lineStyle?: LineStyle | undefined;
|
1229 | }
|
1230 |
|
1231 | interface CartesianAxis {
|
1232 | /**
|
1233 | * Component ID, not specified by default.
|
1234 | * If specified, it can be used to refer the component in option or API.
|
1235 | */
|
1236 | id?: string | undefined;
|
1237 |
|
1238 | /**
|
1239 | * If show this axis.
|
1240 | *
|
1241 | * @default 'true'
|
1242 | */
|
1243 | show?: boolean | undefined;
|
1244 |
|
1245 | /**
|
1246 | * The index of grid which this axis belongs to.
|
1247 | * Defaults to be in the first grid.
|
1248 | *
|
1249 | * @default 0
|
1250 | */
|
1251 | gridIndex?: number | undefined;
|
1252 |
|
1253 | /**
|
1254 | * Offset of this axis relative to default position.
|
1255 | * Useful when multiple axis of this type has same position value.
|
1256 | *
|
1257 | * @default 0
|
1258 | * @see https://echarts.apache.org/en/option.html#yAxis.offset
|
1259 | */
|
1260 | offset?: number | undefined;
|
1261 |
|
1262 | /**
|
1263 | * Name of axis.
|
1264 | */
|
1265 | name?: string | undefined;
|
1266 |
|
1267 | /**
|
1268 | * Location of axis name.
|
1269 | *
|
1270 | * @default 'start'
|
1271 | */
|
1272 | nameLocation?: "start" | "middle" | "center" | "end" | undefined;
|
1273 |
|
1274 | /**
|
1275 | * Text style of axis name.
|
1276 | *
|
1277 | * @see https://echarts.apache.org/en/option.html#yAxis.nameTextStyle
|
1278 | */
|
1279 | nameTextStyle?: TextStyleWithRich | undefined;
|
1280 |
|
1281 | /**
|
1282 | * Gap between axis name and axis line.
|
1283 | *
|
1284 | * @default 15
|
1285 | */
|
1286 | nameGap?: number | undefined;
|
1287 |
|
1288 | /**
|
1289 | * Rotation of axis name.
|
1290 | *
|
1291 | * @default null
|
1292 | */
|
1293 | nameRotate?: number | undefined;
|
1294 |
|
1295 | /**
|
1296 | * Whether axis is inversed. New option from ECharts 3.
|
1297 | *
|
1298 | * @default false
|
1299 | */
|
1300 | inverse?: boolean | undefined;
|
1301 |
|
1302 | /**
|
1303 | * The boundary gap on both sides of a coordinate axis.
|
1304 | * The setting and behavior of category axes and non-category axes are
|
1305 | * different. The `boundaryGap` of category axis can be set to either
|
1306 | * `true` or `false`. Default value is set to be `true`, in which case
|
1307 | * `axisTick` is served only as a separation line, and labels and data
|
1308 | * appear only in the center part of two axis ticks, which is called
|
1309 | * band. For non-category axis, including time, numerical value, and
|
1310 | * log axes, `boundaryGap` is an array of two values, representing the
|
1311 | * spanning range between minimum and maximum value.
|
1312 | * The value can be set in numeric value or relative percentage,
|
1313 | * which becomes invalid after setting `min` and `max`.
|
1314 | *
|
1315 | * @example
|
1316 | * boundaryGap: ['20%', '20%']
|
1317 | *
|
1318 | * @see https://echarts.apache.org/en/option.html#yAxis.boundaryGap
|
1319 | */
|
1320 | boundaryGap?: boolean | Array<string | number> | undefined;
|
1321 |
|
1322 | /**
|
1323 | * The minimun value of axis.
|
1324 | * It can be set to a special value `'dataMin'` so that
|
1325 | * the minimum value on this axis is set to be the minimum label.
|
1326 | * It will be automatically computed to make sure axis tick is equally
|
1327 | * distributed when not set. In category axis, it can also be set
|
1328 | * as the ordinal number.
|
1329 | * For example, if a catergory axis has
|
1330 | * `data: ['categoryA', 'categoryB', 'categoryC']`
|
1331 | * , and the ordinal `2` represents `'categoryC'`.
|
1332 | * Moreover, it can be set as negative number, like `-3`.
|
1333 | *
|
1334 | * @default null
|
1335 | * @see https://echarts.apache.org/option.html#yAxis.min
|
1336 | */
|
1337 | min?: number | string | ((value: { min: number; max: number }) => number) | undefined;
|
1338 |
|
1339 | /**
|
1340 | * The maximum value of axis.
|
1341 | * It can be set to a special value `'dataMax'` so that
|
1342 | * the minimum value on this axis is set to be the maximum label.
|
1343 | * It will be automatically computed to make sure axis tick is equally
|
1344 | * distributed when not set.
|
1345 | * In category axis, it can also be set as the ordinal number.
|
1346 | * For example, if a catergory axis has
|
1347 | * `data: ['categoryA', 'categoryB', 'categoryC']`
|
1348 | * , and the ordinal `2` represents `'categoryC'`.
|
1349 | * Moreover, it can be set as negative number, like `-3`.
|
1350 | *
|
1351 | * @default null
|
1352 | * @see https://echarts.apache.org/option.html#yAxis.max
|
1353 | */
|
1354 | max?: number | string | ((value: { min: number; max: number }) => number) | undefined;
|
1355 |
|
1356 | /**
|
1357 | * It is available only in numerical axis, i.e., type: `'value'`.
|
1358 | * It specifies whether not to contain zero position
|
1359 | * of axis compulsively.
|
1360 | * When it is set to be `true`, the axis may not contain zero position,
|
1361 | * which is useful in the scatter chart for both value axes.
|
1362 | * This configuration item is unavailable when the `min` and `max`
|
1363 | * are set.
|
1364 | *
|
1365 | * @default false
|
1366 | * @see https://echarts.apache.org/en/option.html#yAxis.scale
|
1367 | */
|
1368 | scale?: boolean | undefined;
|
1369 |
|
1370 | /**
|
1371 | * Number of segments that the axis is split into.
|
1372 | * Note that this number serves only as a recommendation,
|
1373 | * and the true segments may be adjusted based on readability.
|
1374 | * This is unavailable for category axis.
|
1375 | *
|
1376 | * @default 5
|
1377 | * @see https://echarts.apache.org/en/option.html#yAxis.splitNumber
|
1378 | */
|
1379 | splitNumber?: number | undefined;
|
1380 |
|
1381 | /**
|
1382 | * Maximum gap between split lines.
|
1383 | * For example, in time axis (type is `'time'`),
|
1384 | * it can be set to be `3600 * 24 * 1000` to make sure
|
1385 | * that the gap between axis labels is less than or equal to one day.
|
1386 | * @example
|
1387 | * {
|
1388 | * maxInterval: 3600 * 1000 * 24
|
1389 | * }
|
1390 | * It is available only for axis of type `'value'` or `'time'`.
|
1391 | * @see https://echarts.apache.org/en/option.html#yAxis.minInterval
|
1392 | */
|
1393 | minInterval?: any;
|
1394 |
|
1395 | /**
|
1396 | * Compulsively set segmentation interval for axis.
|
1397 | * As splitNumber is a recommendation value,
|
1398 | * the calculated tick may not be the same as expected.
|
1399 | * In this case, interval should be used along with min and max
|
1400 | * to compulsively set tickings.
|
1401 | * But in most cases, we do not suggest using this,
|
1402 | * out automatic calculation is enough for most situations.
|
1403 | * This is unavailable for category axis.
|
1404 | * Timestamp should be passed for type: `'time'` axis.
|
1405 | * Logged value should be passed for type: `'log'` axis.
|
1406 | *
|
1407 | * @see https://echarts.apache.org/en/option.html#yAxis.interval
|
1408 | */
|
1409 | interval?: number | undefined;
|
1410 |
|
1411 | /**
|
1412 | * Base of logarithm, which is valid only for numeric axes with type:
|
1413 | * `'log'`.
|
1414 | *
|
1415 | * @default 10
|
1416 | * @see https://echarts.apache.org/en/option.html#yAxis.logBase
|
1417 | */
|
1418 | logBase?: number | undefined;
|
1419 |
|
1420 | /**
|
1421 | * True for axis that cannot be interacted with.
|
1422 | *
|
1423 | * @default false
|
1424 | */
|
1425 | silent?: boolean | undefined;
|
1426 |
|
1427 | /**
|
1428 | * Whether the labels of axis triggers and reacts to mouse events.
|
1429 | * Parameters of event includes:
|
1430 | *
|
1431 | * @example
|
1432 | * {
|
1433 | * // Component type: xAxis, yAxis, radiusAxis, angleAxis
|
1434 | * // Each of which has an attribute for index, e.g., xAxisIndex for xAxis
|
1435 | * componentType: string,
|
1436 | * // Value on axis before being formatted.
|
1437 | * // Click on value label to trigger event.
|
1438 | * value: '',
|
1439 | * // Name of axis.
|
1440 | * // Click on laben name to trigger event.
|
1441 | * name: ''
|
1442 | * }
|
1443 | *
|
1444 | * @default false
|
1445 | */
|
1446 | triggerEvent?: boolean | undefined;
|
1447 |
|
1448 | /**
|
1449 | * Settings related to axis line.
|
1450 | *
|
1451 | * @see https://echarts.apache.org/en/option.html#yAxis.axisLine
|
1452 | */
|
1453 | axisLine?: Line | undefined;
|
1454 |
|
1455 | /**
|
1456 | * Settings related to axis tick.
|
1457 | *
|
1458 | * @see https://echarts.apache.org/en/option.html#yAxis.axisTick
|
1459 | */
|
1460 | axisTick?: CartesianAxis.Tick | undefined;
|
1461 |
|
1462 | /**
|
1463 | * Settings related to axis minor tick.
|
1464 | *
|
1465 | * @see https://echarts.apache.org/en/option.html#yAxis.minorTick
|
1466 | */
|
1467 | minorTick?: CartesianAxis.MinorTick | undefined;
|
1468 |
|
1469 | /**
|
1470 | * Settings related to axis label.
|
1471 | *
|
1472 | * @see https://echarts.apache.org/en/option.html#yAxis.axisLabel
|
1473 | */
|
1474 |
|
1475 | axisLabel?: CartesianAxis.Label | undefined;
|
1476 |
|
1477 | /**
|
1478 | * SplitLine of axis in grid area.
|
1479 | *
|
1480 | * @see https://echarts.apache.org/en/option.html#yAxis.splitLine
|
1481 | */
|
1482 | splitLine?: CartesianAxis.SplitLine | undefined;
|
1483 |
|
1484 | /**
|
1485 | * Minor SplitLine of axis in grid area.
|
1486 | *
|
1487 | * @see https://echarts.apache.org/en/option.html#yAxis.minorSplitLine
|
1488 | */
|
1489 | minorSplitLine?: CartesianAxis.MinorSplitLine | undefined;
|
1490 |
|
1491 | /**
|
1492 | * Split area of axis in grid area, not shown by default.
|
1493 | *
|
1494 | * @see https://echarts.apache.org/en/option.html#yAxis.splitArea
|
1495 | */
|
1496 | splitArea?: CartesianAxis.SplitArea | undefined;
|
1497 |
|
1498 | /**
|
1499 | * Category data, available in type: `'category'` axis.
|
1500 | * If `type` is not specified, but `axis.data` is specified,
|
1501 | * the `type` is auto set as `'category'`.
|
1502 | * If type is specified as `'category'`,
|
1503 | * but axis.data is not specified, `axis.data` will be
|
1504 | * auto collected from `series.data`.
|
1505 | * It brings convenience, but we should notice that
|
1506 | * `axis.data` provides then value range of the `'category'` axis.
|
1507 | * If it is auto collected from `series.data`,
|
1508 | * Only the values appearing in series.data can be collected.
|
1509 | * For example, if series.data is empty, nothing will be collected.
|
1510 | *
|
1511 | * @example
|
1512 | * // Name list of all categories
|
1513 | * data: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
1514 | * // Each item could also be a specific configuration item.
|
1515 | * // In this case, `value` is used as the category name.
|
1516 | * data: [{
|
1517 | * value: 'Monday',
|
1518 | * // Highlight Monday
|
1519 | * textStyle: {
|
1520 | * fontSize: 20,
|
1521 | * color: 'red'
|
1522 | * }
|
1523 | * }, 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
1524 | *
|
1525 | * @see https://echarts.apache.org/en/option.html#yAxis.data
|
1526 | */
|
1527 | data?: Array<string | number | CartesianAxis.DataObject> | undefined;
|
1528 |
|
1529 | /**
|
1530 | * axisPointer settings on the axis.
|
1531 | *
|
1532 | * @see https://echarts.apache.org/en/option.html#yAxis.axisPointer
|
1533 | */
|
1534 | axisPointer?: CartesianAxis.Pointer | undefined;
|
1535 |
|
1536 | /**
|
1537 | * `zlevel` value of all graghical elements in this axis.
|
1538 | * `zlevel` is used to make layers with Canvas.
|
1539 | * Graphical elements with different `zlevel` values will be placed
|
1540 | * in different Canvases, which is a common optimization technique.
|
1541 | * We can put those frequently changed elements
|
1542 | * (like those with animations) to a seperate `zlevel`.
|
1543 | * Notice that too many Canvases will increase memory cost,
|
1544 | * and should be used carefully on mobile phones to avoid crash.
|
1545 | * Canvases with bigger `zlevel` will be placed on Canvases
|
1546 | * with smaller `zlevel`.
|
1547 | *
|
1548 | * @default 0
|
1549 | * @see https://echarts.apache.org/en/option.html#yAxis.zlevel
|
1550 | */
|
1551 | zlevel?: number | undefined;
|
1552 |
|
1553 | /**
|
1554 | * z value of all graghical elements in this axis,
|
1555 | * which controls order of drawing graphical components.
|
1556 | * Components with smaller z values may be overwritten by those
|
1557 | * with larger z values.
|
1558 | * z has a lower priority to zlevel, and will not create new Canvas.
|
1559 | *
|
1560 | * @see https://echarts.apache.org/en/option.html#yAxis.z
|
1561 | */
|
1562 | z?: number | undefined;
|
1563 | }
|
1564 |
|
1565 | namespace CartesianAxis {
|
1566 | type Type = "value" | "category" | "time" | "log";
|
1567 |
|
1568 | /**
|
1569 | * @todo describe
|
1570 | */
|
1571 | interface Tick {
|
1572 | show?: boolean | undefined;
|
1573 | alignWithLabel?: boolean | undefined;
|
1574 | interval?: number | Function | undefined;
|
1575 | inside?: boolean | undefined;
|
1576 | length?: number | undefined;
|
1577 | lineStyle?: LineStyle | undefined;
|
1578 | }
|
1579 |
|
1580 | /**
|
1581 | * @todo describe
|
1582 | */
|
1583 | interface MinorTick {
|
1584 | show?: boolean | undefined;
|
1585 | splitNumber?: number | undefined;
|
1586 | length?: number | undefined;
|
1587 | lineStyle?: LineStyle | undefined;
|
1588 | }
|
1589 |
|
1590 | /**
|
1591 | * @todo describe
|
1592 | */
|
1593 | interface Label extends Omit<TextStyleWithRich, "color"> {
|
1594 | color?: string | ((val: string) => EChartOption.Color) | undefined;
|
1595 | show?: boolean | undefined;
|
1596 | interval?: number | Function | undefined;
|
1597 | inside?: boolean | undefined;
|
1598 | rotate?: number | undefined;
|
1599 | margin?: number | undefined;
|
1600 | formatter?: string | Function | undefined;
|
1601 | showMinLabel?: boolean | undefined;
|
1602 | showMaxLabel?: boolean | undefined;
|
1603 | }
|
1604 |
|
1605 | /**
|
1606 | * @todo describe
|
1607 | */
|
1608 | interface SplitLine {
|
1609 | show?: boolean | undefined;
|
1610 | interval?: number | Function | undefined;
|
1611 | lineStyle?: LineStyle | undefined;
|
1612 | }
|
1613 |
|
1614 | /**
|
1615 | * @todo describe
|
1616 | */
|
1617 | interface MinorSplitLine {
|
1618 | show?: boolean | undefined;
|
1619 | lineStyle?: LineStyle | undefined;
|
1620 | }
|
1621 |
|
1622 | /**
|
1623 | * @todo describe
|
1624 | */
|
1625 | interface SplitArea {
|
1626 | interval?: number | Function | undefined;
|
1627 | show?: boolean | undefined;
|
1628 | areaStyle?: {
|
1629 | color?: string[] | undefined;
|
1630 | shadowBlur?: number | undefined;
|
1631 | shadowColor?: string | undefined;
|
1632 | shadowOffsetX?: number | undefined;
|
1633 | shadowOffsetY?: number | undefined;
|
1634 | opacity?: number | undefined;
|
1635 | } | undefined;
|
1636 | }
|
1637 |
|
1638 | /**
|
1639 | * @todo describe
|
1640 | */
|
1641 | interface DataObject {
|
1642 | value?: string | number | undefined;
|
1643 | textStyle?: TextStyleWithRich | undefined;
|
1644 | }
|
1645 |
|
1646 | /**
|
1647 | * @todo describe
|
1648 | */
|
1649 | interface Pointer {
|
1650 | show?: boolean | undefined;
|
1651 | type?: "line" | "shadow" | "none" | undefined;
|
1652 | snap?: boolean | undefined;
|
1653 | z?: number | undefined;
|
1654 | label?: PointerLabel | undefined;
|
1655 | lineStyle?: LineStyle | undefined;
|
1656 | shadowStyle?: {
|
1657 | color?: EChartOption.Color | undefined;
|
1658 | shadowBlur?: number | undefined;
|
1659 | shadowColor?: EChartOption.Color | undefined;
|
1660 | shadowOffsetX?: number | undefined;
|
1661 | shadowOffsetY?: number | undefined;
|
1662 | opacity?: number | undefined;
|
1663 | } | undefined;
|
1664 | triggerTooltip?: boolean | undefined;
|
1665 | value?: number | undefined;
|
1666 | status?: boolean | undefined;
|
1667 | handle?: {
|
1668 | show?: boolean | undefined;
|
1669 | icon?: any;
|
1670 | size?: number | number[] | undefined;
|
1671 | margin?: number | undefined;
|
1672 | color?: string | undefined;
|
1673 | throttle?: number | undefined;
|
1674 | shadowBlur?: number | undefined;
|
1675 | shadowColor?: string | undefined;
|
1676 | shadowOffsetX?: number | undefined;
|
1677 | shadowOffsetY?: number | undefined;
|
1678 | } | undefined;
|
1679 | }
|
1680 |
|
1681 | interface PointerLabel {
|
1682 | show?: boolean | undefined;
|
1683 | precision?: number | string | undefined;
|
1684 | formatter?: string | Function | undefined;
|
1685 | margin?: number | undefined;
|
1686 | color?: string | undefined;
|
1687 | fontStyle?: "normal" | "italic" | "oblique" | undefined;
|
1688 | fontWeight?:
|
1689 | | "normal"
|
1690 | | "bold"
|
1691 | | "bolder"
|
1692 | | "lighter"
|
1693 | | 100
|
1694 | | 200
|
1695 | | 300
|
1696 | | 400
|
1697 | | 500
|
1698 | | 600
|
1699 | | 700
|
1700 | | 800
|
1701 | | 900
|
1702 | | undefined;
|
1703 | fontFamily?: string | undefined;
|
1704 | fontSize?: number | undefined;
|
1705 | lineHeight?: number | undefined;
|
1706 | backgroundColor?: string | object | undefined;
|
1707 | borderColor?: string | undefined;
|
1708 | borderWidth?: number | undefined;
|
1709 | borderRadius?: number | undefined;
|
1710 | padding?: number | number[] | undefined;
|
1711 | shadowColor?: string | undefined;
|
1712 | shadowBlur?: number | undefined;
|
1713 | shadowOffsetX?: number | undefined;
|
1714 | shadowOffsetY?: number | undefined;
|
1715 | width?: number | string | undefined;
|
1716 | height?: number | string | undefined;
|
1717 | textBorderColor?: string | undefined;
|
1718 | textBorderWidth?: number | undefined;
|
1719 | textShadowColor?: string | undefined;
|
1720 | textShadowBlur?: number | undefined;
|
1721 | textShadowOffsetX?: number | undefined;
|
1722 | textShadowOffsetY?: number | undefined;
|
1723 | }
|
1724 | }
|
1725 | }
|
1726 | }
|
1727 | }
|
1728 |
|
1729 | declare module "echarts" {
|
1730 | export = echarts;
|
1731 | }
|
1732 |
|
1733 | declare module "echarts/lib/echarts" {
|
1734 | export = echarts;
|
1735 | }
|
1736 |
|
\ | No newline at end of file |