stz-chart-maker 1.0.16 → 1.0.18
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/index.d.ts +251 -89
- package/dist/index.js +1518 -1427
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChartType, PluginOptionsByType, ChartOptions, GridLineOptions, FontSpec, Tick, Chart,
|
|
1
|
+
import { ChartType, PluginOptionsByType, ChartOptions, GridLineOptions, FontSpec, Tick, Chart, ChartEvent, ActiveElement, ChartDataset, Plugin as Plugin$1, TooltipItem, ChartTypeRegistry } from 'chart.js';
|
|
2
2
|
import { ZoomPluginOptions } from 'chartjs-plugin-zoom/types/options';
|
|
3
3
|
import { DeepPartial as DeepPartial$1 } from 'chart.js/dist/types/utils';
|
|
4
4
|
|
|
@@ -210,6 +210,12 @@ type CustomChartOptions<TType extends ChartType = ChartType> = Override<ChartOpt
|
|
|
210
210
|
right?: number;
|
|
211
211
|
};
|
|
212
212
|
};
|
|
213
|
+
onResize?: (this: Chart<TType>, chart: Chart<TType>, size: {
|
|
214
|
+
width: number;
|
|
215
|
+
height: number;
|
|
216
|
+
}) => void;
|
|
217
|
+
onClick?: (this: Chart<TType>, event: ChartEvent, elements: ActiveElement[]) => void;
|
|
218
|
+
onHover?: (this: Chart<TType>, event: ChartEvent, elements: ActiveElement[]) => void;
|
|
213
219
|
}> & {
|
|
214
220
|
_mounted?: (chart: Chart<TType>) => void;
|
|
215
221
|
_chartId?: string;
|
|
@@ -337,6 +343,7 @@ declare namespace Types {
|
|
|
337
343
|
interface ChartConfig {
|
|
338
344
|
_chartId: string;
|
|
339
345
|
type: ChartType;
|
|
346
|
+
datasetIdKey?: string;
|
|
340
347
|
data: any;
|
|
341
348
|
options: any;
|
|
342
349
|
plugins?: any;
|
|
@@ -350,34 +357,55 @@ declare abstract class ChartWrapper<TType extends ChartType> implements ChartBui
|
|
|
350
357
|
static registry: Map<string, Constructor<any, any>>;
|
|
351
358
|
constructor(type: TType, labels: (string | number)[], datasets: ChartDataset<TType, (number | null)[]>[], options: CustomChartOptions<TType>, plugins?: any | undefined);
|
|
352
359
|
static create<TType extends ChartType>(type: TType, labels: (string | number)[], datasets: ChartDataset<TType, (number | null)[]>[], options?: CustomChartOptions<TType>, plugins?: any): TType extends CartesianChartType ? CartesianChartBuilder<TType> : ChartBuilder<TType>;
|
|
360
|
+
static register<TType extends ChartType, TInstance>(type: TType, wrapperClass: Constructor<TType, TInstance>): void;
|
|
361
|
+
static has(type: ChartType): boolean;
|
|
353
362
|
protected abstract normalize(): void;
|
|
354
363
|
protected abstract configAop(config: any): any;
|
|
355
|
-
|
|
364
|
+
abstract build(id?: string): ChartConfig;
|
|
356
365
|
/**
|
|
357
|
-
* 플러그인을 추가합니다.
|
|
366
|
+
* @description 플러그인을 추가합니다.
|
|
358
367
|
* @param plugin
|
|
359
368
|
* @param replaceIfExists
|
|
360
|
-
*
|
|
369
|
+
* @Since 1.0.0
|
|
370
|
+
* @category plugin
|
|
361
371
|
*/
|
|
362
372
|
setPlugin(plugin: any, replaceIfExists?: boolean): this;
|
|
363
373
|
/**
|
|
364
|
-
* 차트 설정 객체를 생성합니다.
|
|
374
|
+
* @Description 레거시 지원용 차트 설정 객체를 생성합니다.
|
|
365
375
|
* @param {string} id
|
|
366
376
|
* @returns {ChartConfig}
|
|
367
|
-
* @
|
|
377
|
+
* @Since 1.0.0
|
|
378
|
+
* @category config
|
|
368
379
|
*/
|
|
369
380
|
makeConfig(id?: string): ChartConfig;
|
|
370
381
|
/**
|
|
371
|
-
* 플러그인을 제거합니다.
|
|
382
|
+
* @description 플러그인을 제거합니다.
|
|
372
383
|
* @param pluginId
|
|
384
|
+
* @Since 1.0.0
|
|
385
|
+
* @category plugin
|
|
386
|
+
*
|
|
373
387
|
*/
|
|
374
388
|
removePlugin(pluginId: string): this;
|
|
375
389
|
/**
|
|
376
|
-
* 플러그인이 존재하는지 확인합니다.
|
|
390
|
+
* @description 플러그인이 존재하는지 확인합니다.
|
|
377
391
|
* @param pluginId
|
|
392
|
+
* @returns {boolean}
|
|
393
|
+
* @Since 1.0.0
|
|
394
|
+
* @category plugin
|
|
378
395
|
*/
|
|
379
396
|
hasPlugin(pluginId: string): boolean;
|
|
380
|
-
|
|
397
|
+
/**
|
|
398
|
+
* @beta
|
|
399
|
+
* @description 차트 리사이즈 이벤트 콜백 함수를 설정합니다.
|
|
400
|
+
* @param callback
|
|
401
|
+
* @returns {this}
|
|
402
|
+
* @Since 1.0.0
|
|
403
|
+
* @category options
|
|
404
|
+
*/
|
|
405
|
+
onResize(callback: (chart: Chart<TType>, size: {
|
|
406
|
+
width: number;
|
|
407
|
+
height: number;
|
|
408
|
+
}) => void): this;
|
|
381
409
|
}
|
|
382
410
|
|
|
383
411
|
interface AxisColors {
|
|
@@ -449,6 +477,15 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
449
477
|
get chartId(): string;
|
|
450
478
|
set chartId(value: string);
|
|
451
479
|
protected requireLabels(): boolean;
|
|
480
|
+
/**
|
|
481
|
+
* @protected
|
|
482
|
+
* @description 데이터셋의 기본적은 옵션을 추가하거나 부여합니다.
|
|
483
|
+
* @param ds
|
|
484
|
+
* @param {number} idx
|
|
485
|
+
* @Returns {void}
|
|
486
|
+
* @Since 1.0.1
|
|
487
|
+
* @category Dataset
|
|
488
|
+
*/
|
|
452
489
|
protected decorateDataset(ds: any, idx: number): void;
|
|
453
490
|
protected mustHavePlugins(): {
|
|
454
491
|
id: string;
|
|
@@ -459,7 +496,20 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
459
496
|
protected isBar(): boolean;
|
|
460
497
|
protected normalize(): void;
|
|
461
498
|
protected configAop(config: any): any;
|
|
499
|
+
/**
|
|
500
|
+
* @Description 차트 설정 객체를 생성합니다. 이 메소드는 차트의 구성 요소를 종합하여 Chart.js에서 사용할 수 있는 형식으로 반환합니다.
|
|
501
|
+
* @param id
|
|
502
|
+
* @returns {ChartConfig}
|
|
503
|
+
* @Since 1.0.0
|
|
504
|
+
* @category Chart
|
|
505
|
+
*/
|
|
462
506
|
build(id?: string): ChartConfig;
|
|
507
|
+
/**
|
|
508
|
+
* @deprecated
|
|
509
|
+
* @description 차트 설정 객체를 생성합니다. 이 메소드는 레거시 지원용으로, Chart.js에서 사용할 수 있는 형식으로 반환합니다.
|
|
510
|
+
* @param {string} id
|
|
511
|
+
* @returns {{data: any, plugins: any, _chartId: any, options: any, type: any}}
|
|
512
|
+
*/
|
|
463
513
|
makeConfig(id?: string): {
|
|
464
514
|
_chartId: any;
|
|
465
515
|
type: any;
|
|
@@ -468,36 +518,25 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
468
518
|
plugins: any;
|
|
469
519
|
};
|
|
470
520
|
/**
|
|
471
|
-
* Cartesian chart type을 체크 합니다.
|
|
472
521
|
* @private
|
|
473
|
-
*
|
|
474
|
-
* @remarks cartesina 차트의 타입인지 확인합니다
|
|
475
|
-
* @example
|
|
522
|
+
* @description Cartesian chart type을 체크 합니다.
|
|
476
523
|
* @since 1.0.0
|
|
477
524
|
* @category Chart
|
|
478
|
-
* @defaultValue
|
|
479
|
-
*
|
|
480
525
|
*/
|
|
481
526
|
private isCartesianChartType;
|
|
482
527
|
/**
|
|
483
|
-
* 카테시안 차트의 스케일을 설정합니다.
|
|
528
|
+
* @description 카테시안 차트의 스케일을 설정합니다.
|
|
484
529
|
* @param scales
|
|
485
|
-
*
|
|
486
|
-
* @remarks 카테시안 차트의 스케일을 설정합니다. 이 메소드는 차트의 축을 정의하는데 사용됩니다.
|
|
487
|
-
* @example
|
|
530
|
+
* @returns {this}
|
|
488
531
|
* @since 1.0.0
|
|
489
532
|
* @category Scales
|
|
490
|
-
* @defaultValue
|
|
491
|
-
*
|
|
492
533
|
*/
|
|
493
534
|
setScales(scales: CommonAxesSacels): this;
|
|
494
535
|
/**
|
|
495
|
-
* 카테시안 차트의 축 제목을 설정합니다.
|
|
536
|
+
* @description 카테시안 차트의 축 제목을 설정합니다.
|
|
496
537
|
* @param axis
|
|
497
538
|
* @param titleConfig
|
|
498
|
-
*
|
|
499
|
-
* @remarks 원하는 축의 제목을 설정합니다.
|
|
500
|
-
* @example
|
|
539
|
+
* @returns {this}
|
|
501
540
|
* @since 1.0.0
|
|
502
541
|
* @category Scales
|
|
503
542
|
* @defaultValue
|
|
@@ -505,16 +544,12 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
505
544
|
*/
|
|
506
545
|
setAxisTitle(axis: 'x' | 'y', titleConfig: CommonCartesianTitleConfig): this;
|
|
507
546
|
/**
|
|
508
|
-
* 카테시안 차트의 그리드 옵션을 설정합니다.
|
|
547
|
+
* @description 카테시안 차트의 그리드 옵션을 설정합니다.
|
|
509
548
|
* @param axis
|
|
510
549
|
* @param gridOptions
|
|
511
|
-
*
|
|
512
|
-
* @remarks 차트 뒷 배경의 그리드(선) 옵션을 설정합니다.
|
|
513
|
-
* @example
|
|
550
|
+
* @returns {this}
|
|
514
551
|
* @since 1.0.0
|
|
515
552
|
* @category Scales
|
|
516
|
-
* @defaultValue
|
|
517
|
-
*
|
|
518
553
|
*/
|
|
519
554
|
setGridOptions(axis: 'x' | 'y', gridOptions: {
|
|
520
555
|
display?: boolean;
|
|
@@ -522,12 +557,10 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
522
557
|
lineWidth?: number;
|
|
523
558
|
}): this;
|
|
524
559
|
/**
|
|
525
|
-
* 줌 기능을 추가합니다.
|
|
560
|
+
* @description 줌 기능을 추가합니다. 해당 기능은 플러그인 설치가 필요합니다.
|
|
526
561
|
* @param defaultZoom
|
|
527
562
|
* @param zoomOption
|
|
528
|
-
*
|
|
529
|
-
* @remarks 차트의 줌 기능을 추가합니다. 해당 기능은 플러그인 설치가 필요합니다.
|
|
530
|
-
* @example
|
|
563
|
+
* @returns {this}
|
|
531
564
|
* @since 1.0.0
|
|
532
565
|
* @category Plugins
|
|
533
566
|
* @defaultValue defaultZoom = false
|
|
@@ -535,85 +568,70 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
535
568
|
*/
|
|
536
569
|
addZoom(defaultZoom?: boolean, zoomOption?: object): this;
|
|
537
570
|
/**
|
|
538
|
-
* 데이터
|
|
571
|
+
* @Description 차트에 데이터 라벨을 추가합니다. 기본 옵션을 사용하거나 사용자 정의 옵션을 적용할 수 있습니다.
|
|
539
572
|
* @param defultDataLabels
|
|
540
573
|
* @param dataLabelsOptions
|
|
541
|
-
* @
|
|
574
|
+
* @returns {this}
|
|
542
575
|
* @Category Plugins
|
|
543
576
|
* @since 1.0.0
|
|
544
577
|
* @defaultValue defultDataLabels = false
|
|
545
578
|
*/
|
|
546
579
|
addDataLabels(defultDataLabels: boolean | undefined, dataLabelsOptions: PartialDataLabels): this;
|
|
547
580
|
/**
|
|
548
|
-
* 데이터셋에 y축을 설정합니다.
|
|
581
|
+
* @description 데이터셋에 y축을 설정합니다.
|
|
549
582
|
* @param datasetIndex
|
|
550
583
|
* @param axisId
|
|
551
|
-
*
|
|
552
|
-
* @remarks 각 데이터셋의 축을 설정합니다.
|
|
553
|
-
* @example
|
|
584
|
+
* @returns {this}
|
|
554
585
|
* @since 1.0.0
|
|
555
586
|
* @category Scales
|
|
556
587
|
* @defaultValue axisId = 'y'
|
|
557
|
-
*
|
|
558
588
|
*/
|
|
559
589
|
setYAxisForDataset(datasetIndex: number, axisId?: string): this;
|
|
560
590
|
/**
|
|
561
|
-
* y1 축을 보장합니다.
|
|
562
591
|
* @private
|
|
563
|
-
*
|
|
564
|
-
* @remarks y1 축이 없을 경우 기본 구조를 추가합니다. 이 메소드는 y1 축을 사용하는 차트에서 필요합니다.
|
|
565
|
-
* @example
|
|
592
|
+
* @description y1 축을 보장합니다.
|
|
566
593
|
* @since 1.0.0
|
|
567
594
|
* @category Scales
|
|
568
|
-
* @defaultValue
|
|
569
|
-
*
|
|
570
595
|
*/
|
|
571
596
|
private ensureY1AxisExists;
|
|
572
597
|
/**
|
|
573
|
-
* 카테시안 차트의 축 범위를 설정합니다.
|
|
598
|
+
* @description 카테시안 차트의 축 범위를 설정합니다. 해당 차트의 스케일을 min, max 를 입력 받은 값으로 고정합니다.
|
|
574
599
|
* @param axis
|
|
575
600
|
* @param min
|
|
576
601
|
* @param max
|
|
577
|
-
*
|
|
578
|
-
* *
|
|
579
|
-
* @remarks 해당 차트의 스케일을 min, max 를 입력 받은 값으로 고정합니다.
|
|
580
|
-
* @example
|
|
602
|
+
* @returns {this}
|
|
581
603
|
* @since 1.0.0
|
|
582
604
|
* @category Scales
|
|
583
|
-
* @defaultValue
|
|
584
|
-
*
|
|
585
605
|
*/
|
|
586
606
|
setAxisRange(axis: 'x' | 'y', min?: number, max?: number): this;
|
|
587
607
|
/**
|
|
588
|
-
* 데이터셋의 yAxisID를 설정합니다.
|
|
608
|
+
* @description 데이터셋의 yAxisID를 설정합니다.
|
|
589
609
|
* @param datasetIndex
|
|
590
610
|
* @param axisID
|
|
591
|
-
*
|
|
592
|
-
* @
|
|
593
|
-
* @example
|
|
611
|
+
* @returns {this}
|
|
612
|
+
* @throws {CustomError} 해당 차트 타입이 yAxisID 옵션을 지원하지 않을 경우 에러를 발생시킵니다.
|
|
594
613
|
* @since 1.0.0
|
|
595
614
|
* @category Scales
|
|
596
|
-
* @defaultValue
|
|
597
|
-
*
|
|
598
615
|
*/
|
|
599
616
|
setYAxisID(datasetIndex: number, axisID: string): this;
|
|
600
617
|
/**
|
|
601
|
-
* 축의 위치를 설정합니다.
|
|
618
|
+
* @description 축의 위치를 설정합니다.
|
|
602
619
|
* @param axis
|
|
603
620
|
* @param position
|
|
604
|
-
*
|
|
605
|
-
* @
|
|
606
|
-
* @example
|
|
621
|
+
* @returns {this}
|
|
622
|
+
* @throws {CustomError} 해당 축이 존재하지 않거나 position 옵션을 지원하지 않을 경우 에러를 발생시킵니다.
|
|
607
623
|
* @since 1.0.0
|
|
608
624
|
* @category Scales
|
|
609
|
-
* @defaultValue
|
|
610
|
-
*
|
|
611
625
|
*/
|
|
612
626
|
setAxisPosition(axis: string, position: 'left' | 'right'): this;
|
|
613
627
|
/**
|
|
614
|
-
* 축에 이미지를 추가합니다.
|
|
628
|
+
* @description 축에 이미지를 추가합니다.
|
|
615
629
|
* @param {string} axis
|
|
630
|
+
* @returns {this}
|
|
631
|
+
* @throws {CustomError} 이미지 속성이 없는 데이터셋이 있을 경우 에러를 발생시킵니다.
|
|
616
632
|
* @Deprecated
|
|
633
|
+
* @Category Scales
|
|
634
|
+
* @Since 1.0.0
|
|
617
635
|
*/
|
|
618
636
|
setAddImg(axis: string): this;
|
|
619
637
|
/**
|
|
@@ -622,43 +640,106 @@ declare abstract class CartesianChartWrapper<TType extends CartesianChartType> e
|
|
|
622
640
|
* @Deprecated
|
|
623
641
|
*/
|
|
624
642
|
addRangeSlider(colors?: ZoomRangeSliderColors): this;
|
|
643
|
+
/**
|
|
644
|
+
* @description 차트의 패딩을 설정합니다.
|
|
645
|
+
* @param padding
|
|
646
|
+
* @returns {this}
|
|
647
|
+
* @Category options
|
|
648
|
+
* @Since 1.0.0
|
|
649
|
+
*/
|
|
625
650
|
setPadding(padding: any): this;
|
|
651
|
+
/**
|
|
652
|
+
* @description 데이터셋의 배경색에 알파 값을 설정합니다.
|
|
653
|
+
* @param {number} alpha
|
|
654
|
+
* @returns {this}
|
|
655
|
+
* @throws {CustomError} 알파 값이 0.0 미만 또는 1.0 초과일 경우 에러를 발생시킵니다.
|
|
656
|
+
* @Since 1.0.0
|
|
657
|
+
* @Category Dataset
|
|
658
|
+
*/
|
|
626
659
|
setBackgroundAlpha(alpha: number): this;
|
|
627
660
|
/**
|
|
628
|
-
*
|
|
661
|
+
* @private
|
|
662
|
+
* @description 색상에 알파 값을 추가합니다.
|
|
629
663
|
* @param color
|
|
630
664
|
* @param alpha
|
|
631
|
-
* @
|
|
665
|
+
* @returns {string}
|
|
632
666
|
*/
|
|
633
667
|
private addAlphaToColor;
|
|
634
668
|
/**
|
|
635
|
-
*
|
|
669
|
+
* @description 데이터셋의 파싱 키를 설정합니다. xAxisKey와 yAxisKey를 각각 설정할 수 있습니다. false로 설정하면 해당 축에 대한 파싱을 비활성화합니다.
|
|
636
670
|
* @param {string | false} xAxisKey
|
|
637
671
|
* @param {string | false} yAxisKey
|
|
638
|
-
* @
|
|
672
|
+
* @throws {CustomError} xAxisKey와 yAxisKey가 모두 false일 경우 에러를 발생시킵니다.
|
|
673
|
+
* @returns {this}
|
|
639
674
|
* @Category options
|
|
640
675
|
* @Since 1.0.0
|
|
641
676
|
*/
|
|
642
677
|
setParsingKey(xAxisKey: string | false, yAxisKey: string | false): this;
|
|
678
|
+
/**
|
|
679
|
+
* @description 특정 데이터셋의 파싱 키를 설정합니다. xAxisKey와 yAxisKey를 각각 설정할 수 있습니다. false로 설정하면 해당 축에 대한 파싱을 비활성화합니다.
|
|
680
|
+
* @param {number} datasetIndex
|
|
681
|
+
* @param {string | false} xAxisKey
|
|
682
|
+
* @param {string | false} yAxisKey
|
|
683
|
+
* @returns {this}
|
|
684
|
+
* @throws {CustomError} 데이터셋이 존재하지 않을 경우 에러를 발생시킵니다.
|
|
685
|
+
* @Category options
|
|
686
|
+
* @Since 1.0.0
|
|
687
|
+
*/
|
|
643
688
|
setDatasetParsing(datasetIndex: number, xAxisKey: string | false, yAxisKey: string | false): this;
|
|
689
|
+
/**
|
|
690
|
+
* @description 모든 데이터셋의 파싱 키를 설정합니다. xAxisKey와 yAxisKey를 각각 설정할 수 있습니다. false로 설정하면 해당 축에 대한 파싱을 비활성화합니다.
|
|
691
|
+
* @param {string | false} xAxisKey
|
|
692
|
+
* @param {string | false} yAxisKey
|
|
693
|
+
* @returns {this}
|
|
694
|
+
* @throws {CustomError} 데이터셋이 존재하지 않을 경우 에러를 발생시킵니다.
|
|
695
|
+
* @Category options
|
|
696
|
+
* @Since 1.0.0
|
|
697
|
+
*/
|
|
644
698
|
setAllDatasetsParsing(xAxisKey: string | false, yAxisKey: string | false): this;
|
|
699
|
+
/**
|
|
700
|
+
* @description HTML 범례를 추가합니다. 해당 기능은 플러그인 설치가 필요합니다.
|
|
701
|
+
* @param {HtmlLegendOptions} obj
|
|
702
|
+
* @returns {this}
|
|
703
|
+
* @throws {CustomError} 옵션이 비어있거나 객체가 아닐 경우 에러를 발생시킵니다.
|
|
704
|
+
* @Since 1.0.0
|
|
705
|
+
* @category Plugins
|
|
706
|
+
*/
|
|
645
707
|
customLegend(obj: HtmlLegendOptions): this;
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
708
|
+
/**
|
|
709
|
+
* @Beta
|
|
710
|
+
* @description 데이터셋 배열에서 주어진 UID와 일치하는 데이터셋을 반환합니다. UID가 없거나 데이터셋이 비어있으면 undefined를 반환합니다.
|
|
711
|
+
* @param {string} uid
|
|
712
|
+
* @returns {CustomCartesianDataset<TType> | undefined}
|
|
713
|
+
* @throws {CustomError} UID가 없거나 데이터셋이 비어있을 때 에러를 발생시킵니다.
|
|
714
|
+
* @Since 1.0.0
|
|
715
|
+
* @category Dataset
|
|
716
|
+
*/
|
|
717
|
+
getDataset(uid: string): CustomCartesianDataset<TType> | undefined;
|
|
718
|
+
/**
|
|
719
|
+
* @Beta
|
|
720
|
+
* @description 주어진 UID를 가진 데이터셋을 새로운 데이터셋으로 교체합니다. UID가 없거나 데이터셋이 비어있으면 에러를 발생시킵니다.
|
|
721
|
+
* @param {string} uid
|
|
722
|
+
* @param {CustomCartesianDataset<TType>} dataset
|
|
723
|
+
* @returns {this}
|
|
724
|
+
* @throws {CustomError} UID가 없거나 데이터셋이 비어있을 때 에러를 발생시킵니다.
|
|
725
|
+
* @Since 1.0.0
|
|
726
|
+
* @category Dataset
|
|
727
|
+
*/
|
|
728
|
+
setDataset(uid: string, dataset: CustomCartesianDataset<TType>): this;
|
|
729
|
+
/**
|
|
730
|
+
* @Beta
|
|
731
|
+
* @description 새로운 데이터셋을 추가하고 고유 식별자(UID)를 반환합니다. 데이터셋 배열이 비어있으면 새로 생성합니다.
|
|
732
|
+
* @param {CustomCartesianDataset<TType>} dataset
|
|
733
|
+
* @returns {string}
|
|
734
|
+
* @throws {CustomError} 데이터셋이 null 또는 undefined일 때 에러를 발생시킵니다.
|
|
735
|
+
* @Since 1.0.0
|
|
736
|
+
* @category Dataset
|
|
737
|
+
*/
|
|
738
|
+
addDataset(dataset: CustomCartesianDataset<TType>): string;
|
|
658
739
|
}
|
|
659
740
|
|
|
660
741
|
declare class BarChartWrapper extends CartesianChartWrapper<'bar'> implements BarChartBuilder {
|
|
661
|
-
constructor(type:
|
|
742
|
+
constructor(type: 'bar', labels: (string | number)[], datasets: CartesianDataset<'bar'>[], options?: CustomBarChartOptions, plugins?: any);
|
|
662
743
|
protected requireLabels(): boolean;
|
|
663
744
|
makeConfig(id?: string): {
|
|
664
745
|
_chartId: any;
|
|
@@ -789,8 +870,27 @@ declare class BarChartWrapper extends CartesianChartWrapper<'bar'> implements Ba
|
|
|
789
870
|
}
|
|
790
871
|
|
|
791
872
|
declare class LineChartWrapper extends CartesianChartWrapper<'line'> implements LineChartBuilder {
|
|
792
|
-
constructor(type:
|
|
873
|
+
constructor(type: 'line', labels: (string | number)[], datasets: CartesianDataset<'line'>[], options?: CustomChartOptions<'line'>);
|
|
874
|
+
/**
|
|
875
|
+
*
|
|
876
|
+
* @protected
|
|
877
|
+
* @returns {boolean}
|
|
878
|
+
* @description 라인 차트는 카테고리형 x축일 때 라벨이 필수입니다.
|
|
879
|
+
* @Since 1.0.0
|
|
880
|
+
* @category config
|
|
881
|
+
* @override
|
|
882
|
+
*/
|
|
793
883
|
protected requireLabels(): boolean;
|
|
884
|
+
/**
|
|
885
|
+
*
|
|
886
|
+
* @param id
|
|
887
|
+
* @returns {ChartConfiguration}
|
|
888
|
+
* @description 차트 설정 객체를 생성합니다.
|
|
889
|
+
* @Since 1.0.0
|
|
890
|
+
* @category config
|
|
891
|
+
* @override
|
|
892
|
+
* @Deprecated use build() Method
|
|
893
|
+
*/
|
|
794
894
|
makeConfig(id?: string): {
|
|
795
895
|
_chartId: any;
|
|
796
896
|
type: any;
|
|
@@ -879,6 +979,58 @@ declare class LineChartWrapper extends CartesianChartWrapper<'line'> implements
|
|
|
879
979
|
*
|
|
880
980
|
*/
|
|
881
981
|
setAllPointHoverRadius(hoverRadius: number): this;
|
|
982
|
+
/**
|
|
983
|
+
*
|
|
984
|
+
* @param {number} datasetIndex - 대상 데이터셋 인덱스
|
|
985
|
+
* @param {number} steps - 그라디언트 단계 (2단계면 0,1 / 3단계면 0,0.5,1)
|
|
986
|
+
* @param {string[]} colors - 색상 배열 (steps와 같은 길이여야 함)
|
|
987
|
+
* @param {'vertical' | 'horizontal'} direction - 그라디언트 방향 (기본값: vertical)
|
|
988
|
+
* @description 지정된 데이터셋에 단계별 그라디언트를 적용합니다.
|
|
989
|
+
* @remarks step 인자는 2 이상만 지원할것입니다.
|
|
990
|
+
* @Since 1.0.0
|
|
991
|
+
* @category dataset
|
|
992
|
+
* @beta (기능 테스트 중)
|
|
993
|
+
*/
|
|
994
|
+
setGradient(datasetIndex: number, steps: number, colors: string[], direction?: 'vertical' | 'horizontal'): this;
|
|
995
|
+
/**
|
|
996
|
+
*
|
|
997
|
+
* @param {number} steps - 그라디언트 단계
|
|
998
|
+
* @param {string[]} colors - 색상 배열
|
|
999
|
+
* @param {'vertical' | 'horizontal'} direction - 그라디언트 방향 (기본값: vertical)
|
|
1000
|
+
* @description 모든 데이터셋에 동일한 그라디언트를 적용합니다.
|
|
1001
|
+
* @Since 1.0.0
|
|
1002
|
+
* @category dataset
|
|
1003
|
+
* @beta (기능 테스트 중)
|
|
1004
|
+
*/
|
|
1005
|
+
setAllGradient(steps: number, colors: string[], direction?: 'vertical' | 'horizontal'): this;
|
|
1006
|
+
/**
|
|
1007
|
+
*
|
|
1008
|
+
* @param {number} datasetIndex - 대상 데이터셋 인덱스
|
|
1009
|
+
* @description 지정된 데이터셋의 그라디언트를 제거합니다.
|
|
1010
|
+
* @Since 1.0.0
|
|
1011
|
+
* @category dataset
|
|
1012
|
+
* @beta (기능 테스트 중)
|
|
1013
|
+
*/
|
|
1014
|
+
removeGradient(datasetIndex: number): this;
|
|
1015
|
+
/**
|
|
1016
|
+
*
|
|
1017
|
+
* @description 모든 데이터셋의 그라디언트를 제거합니다.
|
|
1018
|
+
* @Since 1.0.0
|
|
1019
|
+
* @category dataset
|
|
1020
|
+
* @beta (기능 테스트 중)
|
|
1021
|
+
*/
|
|
1022
|
+
removeAllGradients(): this;
|
|
1023
|
+
/**
|
|
1024
|
+
*
|
|
1025
|
+
* @param {number} steps - 단계 수
|
|
1026
|
+
* @returns {number[]} 0부터 1까지의 위치 배열
|
|
1027
|
+
* @description 주어진 단계 수에 따라 그라디언트 위치를 계산합니다.
|
|
1028
|
+
* @Since 1.0.0
|
|
1029
|
+
* @category utility
|
|
1030
|
+
* @private
|
|
1031
|
+
* @beta (기능 테스트 중)
|
|
1032
|
+
*/
|
|
1033
|
+
private calculateGradientPositions;
|
|
882
1034
|
}
|
|
883
1035
|
|
|
884
1036
|
declare const noDataPlugin: {
|
|
@@ -1022,7 +1174,7 @@ declare namespace LocalDefaults {
|
|
|
1022
1174
|
declare class ChartFactory {
|
|
1023
1175
|
private static registry;
|
|
1024
1176
|
static register<TType extends ChartType, TInstance>(type: TType, wrapperClass: Constructor<TType, TInstance>): void;
|
|
1025
|
-
static create<TType extends ChartType>(type: TType,
|
|
1177
|
+
static create<TType extends ChartType>(type: TType, labels: (string | number)[], datasets: ChartDataset<TType, (number | null)[]>[], options?: CustomChartOptions<TType>, plugins?: any): any;
|
|
1026
1178
|
static has(type: ChartType): boolean;
|
|
1027
1179
|
static clear(): void;
|
|
1028
1180
|
}
|
|
@@ -1039,9 +1191,20 @@ declare class ChartInstance {
|
|
|
1039
1191
|
static resize(id: string): void;
|
|
1040
1192
|
}
|
|
1041
1193
|
|
|
1194
|
+
type AllChartTypes = keyof ChartTypeRegistry;
|
|
1195
|
+
declare enum ChartTypes {
|
|
1196
|
+
BAR = "bar",
|
|
1197
|
+
LINE = "line",
|
|
1198
|
+
DOUGHNUT = "doughnut",
|
|
1199
|
+
PIE = "pie",
|
|
1200
|
+
RADAR = "radar",
|
|
1201
|
+
BUBBLE = "bubble",
|
|
1202
|
+
SCATTER = "scatter",
|
|
1203
|
+
TREE = "tree"
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1042
1206
|
declare const ChartToolBox: {
|
|
1043
1207
|
setErrorLog(enabled: boolean): void;
|
|
1044
|
-
setDebugLog(enabled: boolean): void;
|
|
1045
1208
|
};
|
|
1046
1209
|
declare const T$: {
|
|
1047
1210
|
readonly create: typeof ChartWrapper.create;
|
|
@@ -1054,7 +1217,6 @@ declare const T$: {
|
|
|
1054
1217
|
readonly defaultsOptions: typeof LocalDefaults;
|
|
1055
1218
|
readonly toolBox: {
|
|
1056
1219
|
setErrorLog(enabled: boolean): void;
|
|
1057
|
-
setDebugLog(enabled: boolean): void;
|
|
1058
1220
|
};
|
|
1059
1221
|
};
|
|
1060
1222
|
|