billboard.js 3.6.3 → 3.7.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +6 -1
- package/dist/billboard.js +1704 -843
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +3819 -2263
- package/dist/billboard.pkgd.min.js +6 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +62 -23
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +62 -23
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +48 -14
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +48 -14
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1087 -1031
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1171 -1112
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1222 -1169
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1159 -1105
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1365 -1319
- package/dist/theme/datalab.css +6 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +6 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +6 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +942 -277
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -5
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +10 -9
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +10 -9
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -5
- package/package.json +44 -38
- package/src/Chart/api/chart.ts +13 -4
- package/src/Chart/api/export.ts +159 -14
- package/src/Chart/api/legend.ts +1 -0
- package/src/Chart/api/load.ts +1 -0
- package/src/Chart/api/tooltip.ts +11 -2
- package/src/ChartInternal/Axis/Axis.ts +1 -1
- package/src/ChartInternal/ChartInternal.ts +35 -25
- package/src/ChartInternal/data/IData.ts +9 -0
- package/src/ChartInternal/data/convert.helper.ts +35 -21
- package/src/ChartInternal/data/data.ts +26 -5
- package/src/ChartInternal/data/load.ts +3 -0
- package/src/ChartInternal/interactions/interaction.ts +42 -33
- package/src/ChartInternal/internals/class.ts +3 -4
- package/src/ChartInternal/internals/clip.ts +13 -10
- package/src/ChartInternal/internals/domain.ts +11 -4
- package/src/ChartInternal/internals/format.ts +1 -1
- package/src/ChartInternal/internals/grid.ts +1 -1
- package/src/ChartInternal/internals/legend.ts +3 -2
- package/src/ChartInternal/internals/redraw.ts +12 -5
- package/src/ChartInternal/internals/scale.ts +7 -2
- package/src/ChartInternal/internals/size.ts +41 -26
- package/src/ChartInternal/internals/text.ts +60 -32
- package/src/ChartInternal/internals/tooltip.ts +12 -8
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +6 -1
- package/src/ChartInternal/shape/arc.ts +145 -68
- package/src/ChartInternal/shape/area.ts +3 -0
- package/src/ChartInternal/shape/bar.ts +4 -1
- package/src/ChartInternal/shape/line.ts +12 -15
- package/src/ChartInternal/shape/radar.ts +2 -2
- package/src/ChartInternal/shape/shape.ts +10 -5
- package/src/ChartInternal/shape/treemap.ts +293 -0
- package/src/config/Options/common/tooltip.ts +11 -8
- package/src/config/Options/data/data.ts +6 -3
- package/src/config/Options/shape/arc.ts +47 -0
- package/src/config/Options/shape/gauge.ts +2 -2
- package/src/config/Options/shape/pie.ts +1 -1
- package/src/config/Options/shape/polar.ts +1 -1
- package/src/config/Options/shape/radar.ts +1 -1
- package/src/config/Options/shape/spline.ts +1 -1
- package/src/config/Options/shape/treemap.ts +53 -0
- package/src/config/Store/State.ts +1 -0
- package/src/config/classes.ts +7 -0
- package/src/config/const.ts +4 -2
- package/src/config/resolver/shape.ts +22 -5
- package/src/index.esm.ts +2 -1
- package/src/module/util.ts +1 -1
- package/src/scss/billboard.scss +6 -0
- package/src/scss/theme/datalab.scss +6 -0
- package/src/scss/theme/graph.scss +6 -0
- package/src/scss/theme/insight.scss +6 -0
- package/types/bb.d.ts +1 -0
- package/types/chart.d.ts +7 -0
- package/types/index.d.ts +1 -0
- package/types/options.d.ts +42 -624
- package/types/options.shape.d.ts +664 -0
- package/types/types.d.ts +4 -3
package/types/options.d.ts
CHANGED
|
@@ -3,12 +3,28 @@
|
|
|
3
3
|
* billboard.js project is licensed under the MIT license
|
|
4
4
|
*/
|
|
5
5
|
import {Axis} from "./axis";
|
|
6
|
-
import {ChartTypes, d3Selection, DataItem,
|
|
6
|
+
import {ChartTypes, d3Selection, DataItem, PrimitiveArray} from "./types";
|
|
7
7
|
import Bubblecompare from "./plugin/bubblecompare/index";
|
|
8
8
|
import Stanford from "./plugin/stanford/index";
|
|
9
9
|
import TextOverlap from "./plugin/textoverlap/index";
|
|
10
10
|
import {Chart} from "./chart";
|
|
11
11
|
import {IArcData, IData, IDataRow} from "../src/ChartInternal/data/IData";
|
|
12
|
+
import {
|
|
13
|
+
ArcOptions,
|
|
14
|
+
AreaOptions,
|
|
15
|
+
BarOptions,
|
|
16
|
+
BubbleOptions,
|
|
17
|
+
CandlestickOptions,
|
|
18
|
+
DonutOptions,
|
|
19
|
+
GaugeOptions,
|
|
20
|
+
LineOptions,
|
|
21
|
+
PieOptions,
|
|
22
|
+
PolarOptions,
|
|
23
|
+
RadarOptions,
|
|
24
|
+
ScatterOptions,
|
|
25
|
+
SplineOptions,
|
|
26
|
+
TreemapOptions
|
|
27
|
+
} from "./options.shape";
|
|
12
28
|
|
|
13
29
|
export interface ChartOptions {
|
|
14
30
|
/**
|
|
@@ -242,600 +258,20 @@ export interface ChartOptions {
|
|
|
242
258
|
|
|
243
259
|
point?: PointOptions;
|
|
244
260
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Set if min or max value will be 0 on line chart.
|
|
263
|
-
*/
|
|
264
|
-
zerobased?: boolean;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* If set, used to set a css class on each line.
|
|
268
|
-
*/
|
|
269
|
-
classes?: string[];
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Set to false to not draw points on linecharts. Or pass an array of line ids to draw points for.
|
|
273
|
-
*/
|
|
274
|
-
point?: boolean | string[];
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
scatter?: {
|
|
278
|
-
/**
|
|
279
|
-
* Set if min or max value will be 0 on scatter chart.
|
|
280
|
-
*/
|
|
281
|
-
zerobased?: boolean;
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
area?: {
|
|
285
|
-
/**
|
|
286
|
-
* Set background area above the data chart line.
|
|
287
|
-
*/
|
|
288
|
-
above?: boolean;
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Set background area `below` the data chart line.
|
|
292
|
-
* - **NOTE**: Can't be used along with `above` option. When above & below options are set to true, `above` will be prioritized.
|
|
293
|
-
*/
|
|
294
|
-
below?: boolean;
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Set area node to be positioned over line node.
|
|
298
|
-
*/
|
|
299
|
-
front?: boolean;
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* Set the linear gradient on area.<br><br>
|
|
303
|
-
* Or customize by giving below object value:
|
|
304
|
-
* - x {Array}: `x1`, `x2` value
|
|
305
|
-
* - y {Array}: `y1`, `y2` value
|
|
306
|
-
* - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
|
|
307
|
-
*/
|
|
308
|
-
linearGradient?: boolean | LinearGradientOptions;
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Set if min or max value will be 0 on area chart.
|
|
312
|
-
*/
|
|
313
|
-
zerobased?: boolean;
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
bar?: {
|
|
317
|
-
/**
|
|
318
|
-
* Set threshold ratio to show/hide labels.
|
|
319
|
-
*/
|
|
320
|
-
label?: {
|
|
321
|
-
threshold?: number;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Remove nullish data on bar indices positions.
|
|
326
|
-
*/
|
|
327
|
-
indices?: {
|
|
328
|
-
removeNull?: boolean;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Set the linear gradient on bar.<br><br>
|
|
333
|
-
* Or customize by giving below object value:
|
|
334
|
-
* - x {Array}: `x1`, `x2` value
|
|
335
|
-
* - y {Array}: `y1`, `y2` value
|
|
336
|
-
* - stops {Array}: Each item should be having `[offset, stop-color, stop-opacity]` values.
|
|
337
|
-
*/
|
|
338
|
-
linearGradient?: boolean | LinearGradientOptions;
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Bars will be rendered at same position, which will be overlapped each other. (for non-grouped bars only)
|
|
342
|
-
*/
|
|
343
|
-
orverlap?: boolean;
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* The padding pixel value between each bar.
|
|
347
|
-
*/
|
|
348
|
-
padding?: number;
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Set the radius of bar edge in pixel.
|
|
352
|
-
* - NOTE: Only for non-stacking bars.
|
|
353
|
-
*/
|
|
354
|
-
radius?: number | {
|
|
355
|
-
/**
|
|
356
|
-
* Set the radius ratio of bar edge in relative the bar's width.
|
|
357
|
-
*/
|
|
358
|
-
ratio?: number;
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* The senstivity offset value for interaction boundary.
|
|
363
|
-
*/
|
|
364
|
-
sensitivity?: number;
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio.
|
|
368
|
-
*/
|
|
369
|
-
width?: number | {
|
|
370
|
-
/**
|
|
371
|
-
* Set the width of each bar by ratio
|
|
372
|
-
*/
|
|
373
|
-
ratio: number;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Set max width of each bar
|
|
377
|
-
*/
|
|
378
|
-
max?: number;
|
|
379
|
-
} | {
|
|
380
|
-
/**
|
|
381
|
-
* Set the width option for specific dataset
|
|
382
|
-
*/
|
|
383
|
-
[key: string]: number | {
|
|
384
|
-
ratio: number;
|
|
385
|
-
max: number;
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* Set if min or max value will be 0 on bar chart.
|
|
391
|
-
*/
|
|
392
|
-
zerobased?: boolean;
|
|
393
|
-
};
|
|
394
|
-
|
|
395
|
-
bubble?: {
|
|
396
|
-
/**
|
|
397
|
-
* Set the max bubble radius value
|
|
398
|
-
*/
|
|
399
|
-
maxR?: ((this: Chart, d: {}) => number) | number;
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Set if min or max value will be 0 on bubble chart.
|
|
403
|
-
*/
|
|
404
|
-
zerobased?: boolean;
|
|
405
|
-
};
|
|
406
|
-
|
|
407
|
-
candlestick?: {
|
|
408
|
-
/**
|
|
409
|
-
* Change the width of bar chart. If ratio is specified, change the width of bar chart by ratio.
|
|
410
|
-
*/
|
|
411
|
-
width?: number | {
|
|
412
|
-
/**
|
|
413
|
-
* Set the width of each bar by ratio
|
|
414
|
-
*/
|
|
415
|
-
ratio: number;
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Set max width of each bar
|
|
419
|
-
*/
|
|
420
|
-
max?: number;
|
|
421
|
-
} | {
|
|
422
|
-
/**
|
|
423
|
-
* Set the width option for specific dataset
|
|
424
|
-
*/
|
|
425
|
-
[key: string]: number | {
|
|
426
|
-
ratio: number;
|
|
427
|
-
max: number;
|
|
428
|
-
}
|
|
429
|
-
};
|
|
430
|
-
|
|
431
|
-
color?: {
|
|
432
|
-
/**
|
|
433
|
-
* Change down value color.
|
|
434
|
-
*/
|
|
435
|
-
down: string | {
|
|
436
|
-
/**
|
|
437
|
-
* Change down value color for indicated dataset only.
|
|
438
|
-
*/
|
|
439
|
-
[key: string]: string;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
radar?: {
|
|
445
|
-
axis?: {
|
|
446
|
-
/**
|
|
447
|
-
* The max value of axis. If not given, it'll take the max value from the given data.
|
|
448
|
-
*/
|
|
449
|
-
max?: number;
|
|
450
|
-
|
|
451
|
-
line?: {
|
|
452
|
-
/**
|
|
453
|
-
* Show or hide axis line.
|
|
454
|
-
*/
|
|
455
|
-
show?: boolean;
|
|
456
|
-
};
|
|
457
|
-
|
|
458
|
-
text?: {
|
|
459
|
-
position?: {
|
|
460
|
-
/**
|
|
461
|
-
* x coordinate position, relative the original
|
|
462
|
-
*/
|
|
463
|
-
x?: number;
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* y coordinate position, relative the original
|
|
467
|
-
*/
|
|
468
|
-
y?: number;
|
|
469
|
-
};
|
|
470
|
-
|
|
471
|
-
/**
|
|
472
|
-
* Show or hide axis text.
|
|
473
|
-
*/
|
|
474
|
-
show?: boolean;
|
|
475
|
-
};
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
direction?: {
|
|
479
|
-
/**
|
|
480
|
-
* Set the direction to be drawn.
|
|
481
|
-
*/
|
|
482
|
-
clockwise?: boolean;
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
level?: {
|
|
486
|
-
/**
|
|
487
|
-
* Set the level depth.
|
|
488
|
-
*/
|
|
489
|
-
depth?: number;
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Show or hide level.
|
|
493
|
-
*/
|
|
494
|
-
show?: boolean;
|
|
495
|
-
|
|
496
|
-
text?: {
|
|
497
|
-
/**
|
|
498
|
-
* Set format function for the level value.
|
|
499
|
-
*/
|
|
500
|
-
format?: (this: Chart, x: string) => string;
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Show or hide level text.
|
|
504
|
-
*/
|
|
505
|
-
show?: boolean;
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
size?: {
|
|
510
|
-
/**
|
|
511
|
-
* Set size ratio.
|
|
512
|
-
*/
|
|
513
|
-
ratio?: number;
|
|
514
|
-
}
|
|
515
|
-
};
|
|
516
|
-
|
|
517
|
-
polar?: {
|
|
518
|
-
label?: {
|
|
519
|
-
/**
|
|
520
|
-
* Show or hide label on each polar piece.
|
|
521
|
-
*/
|
|
522
|
-
show?: boolean;
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Set threshold ratio to show/hide labels.
|
|
526
|
-
*/
|
|
527
|
-
threshold?: number;
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Set formatter for the label on each polar piece.
|
|
531
|
-
*/
|
|
532
|
-
format?(this: Chart, value: number, ratio: number, id: string): string;
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Set ratio of labels position.
|
|
536
|
-
*/
|
|
537
|
-
ratio?: ((this: Chart, d: DataItem, radius: number, h: number) => void) | number
|
|
538
|
-
};
|
|
539
|
-
level?: {
|
|
540
|
-
/**
|
|
541
|
-
* Set the level depth.
|
|
542
|
-
*/
|
|
543
|
-
depth?: number;
|
|
544
|
-
|
|
545
|
-
/**
|
|
546
|
-
* Set level max value.
|
|
547
|
-
*/
|
|
548
|
-
max?: number;
|
|
549
|
-
|
|
550
|
-
/**
|
|
551
|
-
* Show or hide level.
|
|
552
|
-
*/
|
|
553
|
-
show?: boolean;
|
|
554
|
-
|
|
555
|
-
text?: {
|
|
556
|
-
/**
|
|
557
|
-
* Set label text's background color.
|
|
558
|
-
*/
|
|
559
|
-
backgroundColor?: string;
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* Set format function for the level value.
|
|
563
|
-
*/
|
|
564
|
-
format?: (this: Chart, x: string) => string;
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Show or hide level text.
|
|
568
|
-
*/
|
|
569
|
-
show?: boolean;
|
|
570
|
-
}
|
|
571
|
-
};
|
|
572
|
-
|
|
573
|
-
/**
|
|
574
|
-
* Set padding between data.
|
|
575
|
-
*/
|
|
576
|
-
padAngle?: number;
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* Sets the gap between pie arcs.
|
|
580
|
-
*/
|
|
581
|
-
padding?: number;
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* Set starting angle where data draws.
|
|
585
|
-
*/
|
|
586
|
-
startAngle?: number;
|
|
587
|
-
};
|
|
588
|
-
|
|
589
|
-
pie?: {
|
|
590
|
-
label?: {
|
|
591
|
-
/**
|
|
592
|
-
* Show or hide label on each pie piece.
|
|
593
|
-
*/
|
|
594
|
-
show?: boolean;
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
* Set threshold ratio to show/hide labels.
|
|
598
|
-
*/
|
|
599
|
-
threshold?: number;
|
|
600
|
-
|
|
601
|
-
/**
|
|
602
|
-
* Set formatter for the label on each pie piece.
|
|
603
|
-
*/
|
|
604
|
-
format?(this: Chart, value: number, ratio: number, id: string): string;
|
|
605
|
-
|
|
606
|
-
/**
|
|
607
|
-
* Set ratio of labels position.
|
|
608
|
-
*/
|
|
609
|
-
ratio?: ((this: Chart, d: DataItem, radius: number, h: number) => void) | number
|
|
610
|
-
};
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Enable or disable expanding pie pieces.
|
|
614
|
-
*/
|
|
615
|
-
expand?: boolean | {
|
|
616
|
-
/**
|
|
617
|
-
* Set expand transition time in ms.
|
|
618
|
-
*/
|
|
619
|
-
duration?: number;
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* Set expand rate.
|
|
623
|
-
*/
|
|
624
|
-
rate?: number;
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
/**
|
|
628
|
-
* Sets the inner radius of pie arc.
|
|
629
|
-
*/
|
|
630
|
-
innerRadius?: number | {
|
|
631
|
-
[key: string]: number
|
|
632
|
-
};
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Sets the outer radius of pie arc.
|
|
636
|
-
*/
|
|
637
|
-
outerRadius?: number | {
|
|
638
|
-
[key: string]: number
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
/**
|
|
642
|
-
* Set padding between data.
|
|
643
|
-
*/
|
|
644
|
-
padAngle?: number;
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* Sets the gap between pie arcs.
|
|
648
|
-
*/
|
|
649
|
-
padding?: number;
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* Set starting angle where data draws.
|
|
653
|
-
*/
|
|
654
|
-
startingAngle?: number;
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
donut?: {
|
|
658
|
-
label?: {
|
|
659
|
-
/**
|
|
660
|
-
* Show or hide label on each donut piece.
|
|
661
|
-
*/
|
|
662
|
-
show?: boolean;
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Set formatter for the label on each donut piece.
|
|
666
|
-
*/
|
|
667
|
-
format?: (this: Chart, value: number, ratio: number, id: string) => string;
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Set ratio of labels position.
|
|
671
|
-
*/
|
|
672
|
-
ratio?: number | ((this: Chart, d: DataItem, radius: number, h: number) => number)
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Set threshold ratio to show/hide labels.
|
|
676
|
-
*/
|
|
677
|
-
threshold?: number;
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Enable or disable expanding donut pieces.
|
|
682
|
-
*/
|
|
683
|
-
expand?: boolean | {
|
|
684
|
-
/**
|
|
685
|
-
* Set expand transition time in ms.
|
|
686
|
-
*/
|
|
687
|
-
duration?: number;
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* Set expand rate.
|
|
691
|
-
*/
|
|
692
|
-
rate?: number;
|
|
693
|
-
};
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* Set padding between data.
|
|
697
|
-
*/
|
|
698
|
-
padAngle?: number;
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* Set starting angle where data draws.
|
|
702
|
-
*/
|
|
703
|
-
startingAngle?: number;
|
|
704
|
-
|
|
705
|
-
/**
|
|
706
|
-
* Set width of donut chart.
|
|
707
|
-
*/
|
|
708
|
-
width?: number;
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* Set title of donut chart.
|
|
712
|
-
*/
|
|
713
|
-
title?: string;
|
|
714
|
-
};
|
|
715
|
-
|
|
716
|
-
gauge?: {
|
|
717
|
-
/**
|
|
718
|
-
* Set background color. (The `.bb-chart-arcs-background` element)
|
|
719
|
-
*/
|
|
720
|
-
background?: string;
|
|
721
|
-
|
|
722
|
-
/**
|
|
723
|
-
* Whether this should be displayed
|
|
724
|
-
* as a full circle instead of a
|
|
725
|
-
* half circle.
|
|
726
|
-
*/
|
|
727
|
-
fullCircle?: boolean;
|
|
728
|
-
|
|
729
|
-
label?: {
|
|
730
|
-
/**
|
|
731
|
-
* Show or hide label on gauge.
|
|
732
|
-
*/
|
|
733
|
-
show?: boolean;
|
|
734
|
-
|
|
735
|
-
/**
|
|
736
|
-
* Set formatter for the label on gauge.
|
|
737
|
-
*/
|
|
738
|
-
format?(this: Chart, value: any, ratio: number): string;
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Set customized min/max label text.
|
|
742
|
-
*/
|
|
743
|
-
extents?(this: Chart, value: number, isMax: boolean): string | number;
|
|
744
|
-
|
|
745
|
-
/**
|
|
746
|
-
* Set threshold ratio to show/hide labels.
|
|
747
|
-
*/
|
|
748
|
-
threshold?: number;
|
|
749
|
-
};
|
|
750
|
-
|
|
751
|
-
/**
|
|
752
|
-
* Enable or disable expanding gauge pieces.
|
|
753
|
-
*/
|
|
754
|
-
expand?: boolean | {
|
|
755
|
-
/**
|
|
756
|
-
* Set expand transition time in ms.
|
|
757
|
-
*/
|
|
758
|
-
duration?: number;
|
|
759
|
-
|
|
760
|
-
/**
|
|
761
|
-
* Set expand rate.
|
|
762
|
-
*/
|
|
763
|
-
rate?: number;
|
|
764
|
-
};
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* Set type of the gauge.
|
|
768
|
-
*/
|
|
769
|
-
type?: GaugeTypes;
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* Set min value of the gauge.
|
|
773
|
-
*/
|
|
774
|
-
min?: number;
|
|
775
|
-
|
|
776
|
-
/**
|
|
777
|
-
* Set max value of the gauge.
|
|
778
|
-
*/
|
|
779
|
-
max?: number;
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
* Set starting angle where data draws.
|
|
783
|
-
*/
|
|
784
|
-
startingAngle?: number;
|
|
785
|
-
|
|
786
|
-
/**
|
|
787
|
-
* Set title of gauge chart. Use `\n` character to enter line break.
|
|
788
|
-
*/
|
|
789
|
-
title?: string;
|
|
790
|
-
|
|
791
|
-
/**
|
|
792
|
-
* Set units of the gauge.
|
|
793
|
-
*/
|
|
794
|
-
units?: string;
|
|
795
|
-
|
|
796
|
-
/**
|
|
797
|
-
* Set width of gauge chart.
|
|
798
|
-
*/
|
|
799
|
-
width?: number;
|
|
800
|
-
|
|
801
|
-
/**
|
|
802
|
-
* Set minimal width of gauge arcs until the innerRadius disappears.
|
|
803
|
-
*/
|
|
804
|
-
arcs?: {
|
|
805
|
-
minWidth?: number;
|
|
806
|
-
};
|
|
807
|
-
|
|
808
|
-
/**
|
|
809
|
-
* Set the length of the arc to be drawn in percent from -100 to 100.
|
|
810
|
-
* Negative value will draw the arc **counterclockwise**.
|
|
811
|
-
*/
|
|
812
|
-
arcLength?: number;
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
spline?: {
|
|
816
|
-
interpolation?: {
|
|
817
|
-
/**
|
|
818
|
-
* Set custom spline interpolation
|
|
819
|
-
*/
|
|
820
|
-
type?: "basis"
|
|
821
|
-
| "basis-open"
|
|
822
|
-
| "bundle"
|
|
823
|
-
| "cardinal"
|
|
824
|
-
| "cardinal-closed"
|
|
825
|
-
| "cardinal-open"
|
|
826
|
-
| "catmull-rom"
|
|
827
|
-
| "catmull-rom-closed"
|
|
828
|
-
| "catmull-rom-open"
|
|
829
|
-
| "monotone-x"
|
|
830
|
-
| "monotone-y"
|
|
831
|
-
| "natural"
|
|
832
|
-
| "linear-closed"
|
|
833
|
-
| "linear"
|
|
834
|
-
| "step"
|
|
835
|
-
| "step-after"
|
|
836
|
-
| "step-before"
|
|
837
|
-
};
|
|
838
|
-
};
|
|
261
|
+
arc?: ArcOptions;
|
|
262
|
+
area?: AreaOptions;
|
|
263
|
+
bar?: BarOptions;
|
|
264
|
+
bubble?: BubbleOptions;
|
|
265
|
+
candlestick?: CandlestickOptions;
|
|
266
|
+
donut?: DonutOptions;
|
|
267
|
+
gauge?: GaugeOptions;
|
|
268
|
+
line?: LineOptions;
|
|
269
|
+
polar?: PolarOptions;
|
|
270
|
+
pie?: PieOptions;
|
|
271
|
+
radar?: RadarOptions;
|
|
272
|
+
scatter?: ScatterOptions;
|
|
273
|
+
spline?: SplineOptions;
|
|
274
|
+
treemap?: TreemapOptions;
|
|
839
275
|
|
|
840
276
|
/**
|
|
841
277
|
* Set a callback to execute when the chart is initialized.
|
|
@@ -946,27 +382,6 @@ export interface ChartOptions {
|
|
|
946
382
|
};
|
|
947
383
|
}
|
|
948
384
|
|
|
949
|
-
export interface LinearGradientOptions {
|
|
950
|
-
/**
|
|
951
|
-
* x1, x2 attributes
|
|
952
|
-
*/
|
|
953
|
-
x?: [number, number];
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* y1, y2 attributes
|
|
957
|
-
*/
|
|
958
|
-
y?: [number, number];
|
|
959
|
-
|
|
960
|
-
/**
|
|
961
|
-
* The ramp of colors to use on a gradient
|
|
962
|
-
*
|
|
963
|
-
* offset, stop-color, stop-opacity
|
|
964
|
-
* - setting 'null' for stop-color, will set its original data color
|
|
965
|
-
* - setting 'function' for stop-color, will pass data id as argument. It should return color string or null value
|
|
966
|
-
*/
|
|
967
|
-
stops?: Array<[number, string | null | ((this: Chart, id: string) => string), number]>;
|
|
968
|
-
}
|
|
969
|
-
|
|
970
385
|
export interface RegionOptions {
|
|
971
386
|
axis?: string;
|
|
972
387
|
start?: string | number | Date;
|
|
@@ -1108,12 +523,14 @@ export interface TooltipOptions {
|
|
|
1108
523
|
name?(this: Chart, name: string, ratio: number, id: string, index: number): string;
|
|
1109
524
|
|
|
1110
525
|
/**
|
|
1111
|
-
* Set format for the value of each data in tooltip.
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
526
|
+
* Set format for the value of each data in tooltip. If undefined returned, the row of that value will be skipped to be called.
|
|
527
|
+
* - Will pass following arguments to the given function:
|
|
528
|
+
* - `value {string}`: Value of the data point
|
|
529
|
+
* - `ratio {number}`: Ratio of the data point in the `pie/donut/gauge` and `area/bar` when contains grouped data. Otherwise is `undefined`.
|
|
530
|
+
* - `id {string}`: id of the data point
|
|
531
|
+
* - `index {number}`: Index of the data point
|
|
1115
532
|
*/
|
|
1116
|
-
value?(this: Chart, value:
|
|
533
|
+
value?(this: Chart, value: number, ratio: number | undefined, id: string, index: number): string;
|
|
1117
534
|
};
|
|
1118
535
|
/**
|
|
1119
536
|
* Set tooltip values order
|
|
@@ -1472,7 +889,7 @@ export interface Grid {
|
|
|
1472
889
|
* If x axis is category axis, value can be category name.
|
|
1473
890
|
* If x axis is timeseries axis, value can be date string, Date object and unixtime integer.
|
|
1474
891
|
*/
|
|
1475
|
-
lines?:
|
|
892
|
+
lines?: GridLineOptions[];
|
|
1476
893
|
};
|
|
1477
894
|
|
|
1478
895
|
y?: {
|
|
@@ -1485,7 +902,7 @@ export interface Grid {
|
|
|
1485
902
|
* Show additional grid lines along y axis.
|
|
1486
903
|
* This option accepts array including object that has value, text, position and class.
|
|
1487
904
|
*/
|
|
1488
|
-
lines?:
|
|
905
|
+
lines?: GridLineOptions[];
|
|
1489
906
|
|
|
1490
907
|
/**
|
|
1491
908
|
* Number of y grids to be shown.
|
|
@@ -1494,7 +911,7 @@ export interface Grid {
|
|
|
1494
911
|
};
|
|
1495
912
|
}
|
|
1496
913
|
|
|
1497
|
-
export interface
|
|
914
|
+
export interface GridLineOptions {
|
|
1498
915
|
value: string | number | Date;
|
|
1499
916
|
text?: string;
|
|
1500
917
|
axis?: string;
|
|
@@ -1620,6 +1037,7 @@ export interface Data {
|
|
|
1620
1037
|
/**
|
|
1621
1038
|
* Set chart type for each data.
|
|
1622
1039
|
* This setting overwrites data.type setting.
|
|
1040
|
+
* - **NOTE:** `radar` and `treemap` type can't be combined with other types.
|
|
1623
1041
|
*/
|
|
1624
1042
|
types?: { [key: string]: ChartTypes };
|
|
1625
1043
|
|