stz-chart-maker 2.3.10 → 2.4.0

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/CHANGELOG.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ### [2.3.10] (2026-06-24)
5
+ - feat : stzOnClick 함수를 만들어서 사용자가 기본 chartjs options.onClick 함수를 사용 시 세번째 인자로 차트 값도 사용 할 수 있도록 제공
4
6
 
5
7
  ### [2.3.7] (2026-06-11)
6
8
  -feat : zoom option을 plugin-native `limits` 구조로 정리하고 `zoomLimits` 하위 호환 유지
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ChartTypeRegistry, ChartType, ChartDataset, GridLineOptions, FontSpec, Tick, Chart as Chart$1, ChartOptions, PluginOptionsByType, ChartEvent, ActiveElement, LegendOptions, TooltipOptions, Plugin as Plugin$1, TooltipItem } from 'chart.js';
1
+ import { ChartTypeRegistry, ChartType, ChartDataset, DefaultDataPoint, PointStyle, GridLineOptions, FontSpec, Tick, Chart as Chart$1, ChartOptions, PluginOptionsByType, ChartEvent, ActiveElement, LegendOptions, TooltipOptions, Plugin, TooltipItem } from 'chart.js';
2
2
  import { TreemapControllerDatasetOptions } from 'chartjs-chart-treemap';
3
3
  import { ZoomOptions, PanOptions, LimitOptions, ScaleLimits } from 'chartjs-plugin-zoom/types/options';
4
4
 
@@ -68,14 +68,23 @@ interface DatasetExtensions {
68
68
  }
69
69
  type CustomChartDatasets<TType extends ChartType = ChartType> = ChartDataset<TType, any> & DatasetExtensions;
70
70
  type ArcDataset<TType extends ArcChartType = ArcChartType> = ChartDataset<TType, (number | null)[]> & DatasetExtensions;
71
- type CartesianDataset<TType extends CartesianChartType = CartesianChartType> = ChartDataset<TType, (number | null)[]> & DatasetExtensions & {
71
+ type CartesianDataset<TType extends CartesianChartType = CartesianChartType> = ChartDataset<TType, DefaultDataPoint<TType>> & DatasetExtensions & {
72
72
  yAxisID?: string;
73
73
  xAxisID?: string;
74
74
  stack?: string;
75
75
  order?: number;
76
76
  DATASET_ID?: string;
77
77
  };
78
- type CustomCartesianDataset<TType extends CartesianChartType = CartesianChartType> = ChartDataset<TType, (number | null)[]> & DatasetExtensions & {
78
+ type ScatterDataset = ChartDataset<'scatter', DefaultDataPoint<'scatter'>> & DatasetExtensions & {
79
+ yAxisID?: string;
80
+ xAxisID?: string;
81
+ stack?: string;
82
+ order?: number;
83
+ _dskey?: string;
84
+ image?: string;
85
+ images?: string[];
86
+ };
87
+ type CustomCartesianDataset<TType extends CartesianChartType = CartesianChartType> = ChartDataset<TType, DefaultDataPoint<TType>> & DatasetExtensions & {
79
88
  yAxisID?: string;
80
89
  xAxisID?: string;
81
90
  stack?: string;
@@ -88,6 +97,84 @@ type CustomTreemapDataset<DType = Record<string, unknown>> = Omit<TreemapControl
88
97
  groups?: string[];
89
98
  sumKeys?: string[];
90
99
  };
100
+ interface ScatterPointContext {
101
+ raw: Record<string, unknown>;
102
+ x: number;
103
+ y: number;
104
+ dataIndex: number;
105
+ datasetIndex: number;
106
+ dataset: ScatterDataset;
107
+ }
108
+ interface ScatterPointHighlightStyle {
109
+ /** 강조 대상 포인트에 적용할 모양입니다. 이미지도 사용할 수 있습니다. */
110
+ pointStyle?: PointStyle | HTMLImageElement | HTMLCanvasElement;
111
+ /** 강조 대상 포인트의 반지름입니다. */
112
+ pointRadius?: number;
113
+ /** 강조 대상 포인트의 hover 반지름입니다. */
114
+ pointHoverRadius?: number;
115
+ /** 강조 대상 포인트의 배경색입니다. */
116
+ pointBackgroundColor?: string;
117
+ /** 강조 대상 포인트의 테두리 색상입니다. */
118
+ pointBorderColor?: string;
119
+ /** 강조 대상 포인트의 테두리 두께입니다. */
120
+ pointBorderWidth?: number;
121
+ }
122
+ interface ScatterQuadrantOptions {
123
+ /** 수직 기준선의 데이터 값입니다. 기본값은 `0` 입니다. */
124
+ x?: number;
125
+ /** 수평 기준선의 데이터 값입니다. 기본값은 `0` 입니다. */
126
+ y?: number;
127
+ /** 4분면별 배경색입니다. */
128
+ backgroundColors?: Partial<Record<'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight', string>>;
129
+ /** 기준선 색상입니다. */
130
+ borderColor?: string;
131
+ /** 기준선 두께입니다. */
132
+ borderWidth?: number;
133
+ /** 4분면 라벨입니다. `false` 를 주면 해당 라벨을 숨깁니다. */
134
+ labels?: Partial<Record<'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight', string | false>>;
135
+ /** 4분면 라벨 색상입니다. */
136
+ labelColor?: string;
137
+ /** 4분면 라벨 글자 크기입니다. */
138
+ fontSize?: number;
139
+ /** 4분면 라벨 글자 굵기입니다. */
140
+ fontWeight?: string;
141
+ }
142
+ interface ScatterTrendLineOptions {
143
+ /** 회귀선을 계산할 대상 데이터셋 인덱스입니다. 미지정 시 전체 데이터를 기준으로 계산합니다. */
144
+ datasetIndex?: number;
145
+ /** 회귀선 색상입니다. */
146
+ borderColor?: string;
147
+ /** 회귀선 두께입니다. */
148
+ borderWidth?: number;
149
+ /** 회귀선 dash 패턴입니다. */
150
+ borderDash?: number[];
151
+ /** `false` 면 실제 데이터 범위까지만 그립니다. 기본값은 축 범위 전체까지 확장합니다. */
152
+ extend?: boolean;
153
+ }
154
+ interface ScatterCrosshairOptions {
155
+ /** 가이드라인 색상입니다. */
156
+ color?: string;
157
+ /** 가이드라인 두께입니다. */
158
+ width?: number;
159
+ /** 가이드라인 dash 패턴입니다. */
160
+ dash?: number[];
161
+ /** 교차점 라벨 표시 여부입니다. 기본값은 `true` 입니다. */
162
+ showLabels?: boolean;
163
+ /** 교차점 라벨 배경색입니다. */
164
+ labelBackgroundColor?: string;
165
+ /** 교차점 라벨 글자색입니다. */
166
+ labelColor?: string;
167
+ /** X 값 포맷터입니다. */
168
+ xFormatter?: (value: number) => string;
169
+ /** Y 값 포맷터입니다. */
170
+ yFormatter?: (value: number) => string;
171
+ }
172
+ interface ScatterAxisRangePadding {
173
+ /** X축 여유 비율입니다. `0.1` 이면 데이터 범위의 10%를 양쪽에 추가합니다. */
174
+ x?: number;
175
+ /** Y축 여유 비율입니다. `0.1` 이면 데이터 범위의 10%를 양쪽에 추가합니다. */
176
+ y?: number;
177
+ }
91
178
 
92
179
  /**
93
180
  * ═════════════════════════════════════════════════════════════
@@ -607,6 +694,7 @@ type CustomArcChartOptions<TType extends ArcChartType = ArcChartType> = CustomCh
607
694
  };
608
695
  type CustomBarChartOptions = CustomChartOptions<'bar'>;
609
696
  type CustomLineChartOptions = CustomChartOptions<'line'>;
697
+ type CustomScatterChartOptions = CustomChartOptions<'scatter'>;
610
698
  type CustomBubbleChartOptions = CustomChartOptions<'bubble'>;
611
699
  type CustomPieChartOptions = CustomArcChartOptions<'pie'>;
612
700
  type CustomDoughnutChartOptions = CustomArcChartOptions<'doughnut'>;
@@ -738,6 +826,26 @@ interface LineChartBuilder extends CartesianChartBuilder<'line'> {
738
826
  setAllPointHoverRadius(hoverRadius: number): this;
739
827
  sparkLineChart(): this;
740
828
  }
829
+ interface ScatterChartBuilder extends CartesianChartBuilder<'scatter'> {
830
+ setPointRadius(datasetIndex: number, radius: number): this;
831
+ setAllPointRadius(radius: number): this;
832
+ setPointHoverRadius(datasetIndex: number, hoverRadius: number): this;
833
+ setAllPointHoverRadius(hoverRadius: number): this;
834
+ setPointStyle(datasetIndex: number, pointStyle: PointStyle): this;
835
+ setAllPointStyle(pointStyle: PointStyle): this;
836
+ setShowLine(datasetIndex: number, showLine: boolean): this;
837
+ setAllShowLine(showLine: boolean): this;
838
+ setBorderWidth(datasetIndex: number, borderWidth: number): this;
839
+ setAllBorderWidth(borderWidth: number): this;
840
+ setPointColorByValue(resolver: (point: ScatterPointContext) => string): this;
841
+ setPointStyleByValue(resolver: (point: ScatterPointContext) => ScatterPointHighlightStyle | undefined): this;
842
+ setPointStyleWhere(predicate: (point: ScatterPointContext) => boolean, pointStyle: PointStyle | HTMLImageElement | HTMLCanvasElement): this;
843
+ addQuadrant(options?: ScatterQuadrantOptions): this;
844
+ addTrendLine(options?: ScatterTrendLineOptions): this;
845
+ addCrosshair(options?: ScatterCrosshairOptions): this;
846
+ highlightPoints(predicate: (point: ScatterPointContext) => boolean, style?: ScatterPointHighlightStyle): this;
847
+ setAxisRangeFromData(padding?: number | ScatterAxisRangePadding): this;
848
+ }
741
849
  interface BubbleChartBuilder extends CartesianChartBuilder<'bubble'> {
742
850
  setBubbleRadius(datasetIndex: number, radius: number): this;
743
851
  setBubbleDataRadius(datasetIndex: number, dataIndex: number, radius: number): this;
@@ -849,6 +957,7 @@ type Types_CustomDoughnutChartOptions = CustomDoughnutChartOptions;
849
957
  type Types_CustomLineChartOptions = CustomLineChartOptions;
850
958
  type Types_CustomOptionPlugins<TType extends ChartType = ChartType> = CustomOptionPlugins<TType>;
851
959
  type Types_CustomPieChartOptions = CustomPieChartOptions;
960
+ type Types_CustomScatterChartOptions = CustomScatterChartOptions;
852
961
  type Types_CustomTreemapChartOptions = CustomTreemapChartOptions;
853
962
  type Types_CustomTreemapDataset<DType = Record<string, unknown>> = CustomTreemapDataset<DType>;
854
963
  type Types_DeepPartial<T> = DeepPartial<T>;
@@ -864,6 +973,14 @@ type Types_PieChartBuilder = PieChartBuilder;
864
973
  type Types_Position = Position;
865
974
  type Types_RadarChartBuilder = RadarChartBuilder;
866
975
  type Types_RadialChartType = RadialChartType;
976
+ type Types_ScatterAxisRangePadding = ScatterAxisRangePadding;
977
+ type Types_ScatterChartBuilder = ScatterChartBuilder;
978
+ type Types_ScatterCrosshairOptions = ScatterCrosshairOptions;
979
+ type Types_ScatterDataset = ScatterDataset;
980
+ type Types_ScatterPointContext = ScatterPointContext;
981
+ type Types_ScatterPointHighlightStyle = ScatterPointHighlightStyle;
982
+ type Types_ScatterQuadrantOptions = ScatterQuadrantOptions;
983
+ type Types_ScatterTrendLineOptions = ScatterTrendLineOptions;
867
984
  type Types_SegmentImageConfig = SegmentImageConfig;
868
985
  type Types_SettingOptions = SettingOptions;
869
986
  type Types_SpinnerOverlayConfig = SpinnerOverlayConfig;
@@ -880,7 +997,7 @@ type Types_TimeUnit = TimeUnit;
880
997
  type Types_TreemapChartBuilder = TreemapChartBuilder;
881
998
  type Types_UidImageMapping = UidImageMapping;
882
999
  declare namespace Types {
883
- export type { Types_Align as Align, Types_ArcChartBuilder as ArcChartBuilder, Types_ArcChartType as ArcChartType, Types_ArcDataset as ArcDataset, Types_BarChartBuilder as BarChartBuilder, Types_BubbleChartBuilder as BubbleChartBuilder, Types_CartesianChartBuilder as CartesianChartBuilder, Types_CartesianChartType as CartesianChartType, Types_CartesianDataset as CartesianDataset, Types_ChartBuilder as ChartBuilder, Types_Color as Color, Types_CommonAxes as CommonAxes, Types_CommonAxesSacels as CommonAxesSacels, Types_CommonCartesian as CommonCartesian, Types_CommonCartesianAxes as CommonCartesianAxes, Types_CommonCartesianLegendConfig as CommonCartesianLegendConfig, Types_CommonCartesianTicks as CommonCartesianTicks, Types_CommonCartesianTitleConfig as CommonCartesianTitleConfig, Types_CommonTicks as CommonTicks, Types_Constructor as Constructor, Types_CustomArcChartOptions as CustomArcChartOptions, Types_CustomBarChartOptions as CustomBarChartOptions, Types_CustomBubbleChartOptions as CustomBubbleChartOptions, Types_CustomCartesianDataset as CustomCartesianDataset, Types_CustomChartDatasets as CustomChartDatasets, Types_CustomChartOptions as CustomChartOptions, Types_CustomDoughnutChartOptions as CustomDoughnutChartOptions, Types_CustomLineChartOptions as CustomLineChartOptions, Types_CustomOptionPlugins as CustomOptionPlugins, Types_CustomPieChartOptions as CustomPieChartOptions, Types_CustomTreemapChartOptions as CustomTreemapChartOptions, Types_CustomTreemapDataset as CustomTreemapDataset, Types_DeepPartial as DeepPartial, Types_DeepPartialCartesianAxes as DeepPartialCartesianAxes, Types_DeepPartialPluginOptions as DeepPartialPluginOptions, Types_DoughnutChartBuilder as DoughnutChartBuilder, Types_HierarchicalChartType as HierarchicalChartType, Types_HtmlLegendOptions as HtmlLegendOptions, Types_LineChartBuilder as LineChartBuilder, Types_Mode as Mode, Types_Override as Override, Types_PieChartBuilder as PieChartBuilder, Types_Position as Position, Types_RadarChartBuilder as RadarChartBuilder, Types_RadialChartType as RadialChartType, Types_SegmentImageConfig as SegmentImageConfig, Types_SettingOptions as SettingOptions, Types_SpinnerOverlayConfig as SpinnerOverlayConfig, Types_SpinnerOverlayOption as SpinnerOverlayOption, Types_SpinnerOverlayRenderContext as SpinnerOverlayRenderContext, Types_SpinnerOverlaySpinnerContent as SpinnerOverlaySpinnerContent, Types_SpinnerOverlayStyle as SpinnerOverlayStyle, Types_StzClickContext as StzClickContext, Types_StzClickHandler as StzClickHandler, Types_StzClickItem as StzClickItem, Types_TimeScaleConfig as TimeScaleConfig, Types_TimeScaleType as TimeScaleType, Types_TimeUnit as TimeUnit, Types_TreemapChartBuilder as TreemapChartBuilder, Types_UidImageMapping as UidImageMapping };
1000
+ export type { Types_Align as Align, Types_ArcChartBuilder as ArcChartBuilder, Types_ArcChartType as ArcChartType, Types_ArcDataset as ArcDataset, Types_BarChartBuilder as BarChartBuilder, Types_BubbleChartBuilder as BubbleChartBuilder, Types_CartesianChartBuilder as CartesianChartBuilder, Types_CartesianChartType as CartesianChartType, Types_CartesianDataset as CartesianDataset, Types_ChartBuilder as ChartBuilder, Types_Color as Color, Types_CommonAxes as CommonAxes, Types_CommonAxesSacels as CommonAxesSacels, Types_CommonCartesian as CommonCartesian, Types_CommonCartesianAxes as CommonCartesianAxes, Types_CommonCartesianLegendConfig as CommonCartesianLegendConfig, Types_CommonCartesianTicks as CommonCartesianTicks, Types_CommonCartesianTitleConfig as CommonCartesianTitleConfig, Types_CommonTicks as CommonTicks, Types_Constructor as Constructor, Types_CustomArcChartOptions as CustomArcChartOptions, Types_CustomBarChartOptions as CustomBarChartOptions, Types_CustomBubbleChartOptions as CustomBubbleChartOptions, Types_CustomCartesianDataset as CustomCartesianDataset, Types_CustomChartDatasets as CustomChartDatasets, Types_CustomChartOptions as CustomChartOptions, Types_CustomDoughnutChartOptions as CustomDoughnutChartOptions, Types_CustomLineChartOptions as CustomLineChartOptions, Types_CustomOptionPlugins as CustomOptionPlugins, Types_CustomPieChartOptions as CustomPieChartOptions, Types_CustomScatterChartOptions as CustomScatterChartOptions, Types_CustomTreemapChartOptions as CustomTreemapChartOptions, Types_CustomTreemapDataset as CustomTreemapDataset, Types_DeepPartial as DeepPartial, Types_DeepPartialCartesianAxes as DeepPartialCartesianAxes, Types_DeepPartialPluginOptions as DeepPartialPluginOptions, Types_DoughnutChartBuilder as DoughnutChartBuilder, Types_HierarchicalChartType as HierarchicalChartType, Types_HtmlLegendOptions as HtmlLegendOptions, Types_LineChartBuilder as LineChartBuilder, Types_Mode as Mode, Types_Override as Override, Types_PieChartBuilder as PieChartBuilder, Types_Position as Position, Types_RadarChartBuilder as RadarChartBuilder, Types_RadialChartType as RadialChartType, Types_ScatterAxisRangePadding as ScatterAxisRangePadding, Types_ScatterChartBuilder as ScatterChartBuilder, Types_ScatterCrosshairOptions as ScatterCrosshairOptions, Types_ScatterDataset as ScatterDataset, Types_ScatterPointContext as ScatterPointContext, Types_ScatterPointHighlightStyle as ScatterPointHighlightStyle, Types_ScatterQuadrantOptions as ScatterQuadrantOptions, Types_ScatterTrendLineOptions as ScatterTrendLineOptions, Types_SegmentImageConfig as SegmentImageConfig, Types_SettingOptions as SettingOptions, Types_SpinnerOverlayConfig as SpinnerOverlayConfig, Types_SpinnerOverlayOption as SpinnerOverlayOption, Types_SpinnerOverlayRenderContext as SpinnerOverlayRenderContext, Types_SpinnerOverlaySpinnerContent as SpinnerOverlaySpinnerContent, Types_SpinnerOverlayStyle as SpinnerOverlayStyle, Types_StzClickContext as StzClickContext, Types_StzClickHandler as StzClickHandler, Types_StzClickItem as StzClickItem, Types_TimeScaleConfig as TimeScaleConfig, Types_TimeScaleType as TimeScaleType, Types_TimeUnit as TimeUnit, Types_TreemapChartBuilder as TreemapChartBuilder, Types_UidImageMapping as UidImageMapping };
884
1001
  }
885
1002
 
886
1003
  interface ChartConfig {
@@ -894,7 +1011,7 @@ interface ChartConfig {
894
1011
  type ChartBuilderMap = {
895
1012
  line: LineChartBuilder;
896
1013
  bar: BarChartBuilder;
897
- scatter: CartesianChartBuilder<'scatter'>;
1014
+ scatter: ScatterChartBuilder;
898
1015
  bubble: CartesianChartBuilder<'bubble'>;
899
1016
  doughnut: DoughnutChartBuilder;
900
1017
  pie: PieChartBuilder;
@@ -911,7 +1028,7 @@ declare abstract class Chart<TType extends ChartType, TOptions extends CustomCha
911
1028
  protected get datasets(): CustomChartDatasets<TType>[];
912
1029
  protected set datasets(value: CustomChartDatasets<TType>[]);
913
1030
  constructor(type: TType, labels: (string | number)[] | undefined, _datasets: CustomChartDatasets<TType>[], options: TOptions, plugins?: any | undefined);
914
- static create<TType extends ChartType>(type: TType, labels: (string | number)[], datasets: CustomChartDatasets<TType>[], options?: CustomChartOptions<TType>, plugins?: Plugin$1): TType extends keyof ChartBuilderMap ? ChartBuilderMap[TType] : ChartBuilder<TType>;
1031
+ static create<TType extends ChartType>(type: TType, labels: (string | number)[], datasets: CustomChartDatasets<TType>[], options?: CustomChartOptions<TType>, plugins?: Plugin): TType extends keyof ChartBuilderMap ? ChartBuilderMap[TType] : ChartBuilder<TType>;
915
1032
  static register<TType extends ChartType, TInstance>(type: TType, wrapperClass: Constructor<TType, TInstance>): void;
916
1033
  static has(type: ChartType): boolean;
917
1034
  protected cloneValue<T>(value: T): T;
@@ -2004,6 +2121,147 @@ declare class LineChart extends CartesianChart<'line'> implements LineChartBuild
2004
2121
  sparkLineChart(): this;
2005
2122
  }
2006
2123
 
2124
+ declare class ScatterChart extends CartesianChart<'scatter'> implements ScatterChartBuilder {
2125
+ constructor(type: 'scatter', labels: (string | number)[], datasets: ScatterDataset[], options?: CustomScatterChartOptions, plugins?: Plugin);
2126
+ protected requireLabels(): boolean;
2127
+ makeConfig(id?: string): {
2128
+ _chartId: any;
2129
+ type: any;
2130
+ data: any;
2131
+ options: any;
2132
+ plugins: any;
2133
+ };
2134
+ setPointRadius(datasetIndex: number, radius: number): this;
2135
+ setAllPointRadius(radius: number): this;
2136
+ setPointHoverRadius(datasetIndex: number, hoverRadius: number): this;
2137
+ setAllPointHoverRadius(hoverRadius: number): this;
2138
+ setPointStyle(datasetIndex: number, pointStyle: PointStyle): this;
2139
+ setAllPointStyle(pointStyle: PointStyle): this;
2140
+ setShowLine(datasetIndex: number, showLine: boolean): this;
2141
+ setAllShowLine(showLine: boolean): this;
2142
+ setBorderWidth(datasetIndex: number, borderWidth: number): this;
2143
+ setAllBorderWidth(borderWidth: number): this;
2144
+ private resolvePointValue;
2145
+ private createPointContext;
2146
+ private resolveOptionValue;
2147
+ private applyPointOption;
2148
+ private collectScatterPoints;
2149
+ private resolveAxisBounds;
2150
+ /**
2151
+ * @description 값에 따라 포인트 색상을 정합니다.
2152
+ * @param {(point: ScatterPointContext) => string} resolver
2153
+ * @returns {this}
2154
+ * @Since 2.4.0
2155
+ */
2156
+ setPointColorByValue(resolver: (point: ScatterPointContext) => string): this;
2157
+ /**
2158
+ * @description 값에 따라 포인트의 모양, 크기, 색상, 테두리를 한 번에 결정합니다.
2159
+ * @param resolver
2160
+ * @returns {this}
2161
+ * @since 2.4.0
2162
+ * @example
2163
+ * chart.setPointStyleByValue(point => ({
2164
+ * pointStyle: point.raw.status === 'alert' ? alertImage : 'circle',
2165
+ * pointRadius: point.y >= 80 ? 8 : 4,
2166
+ * pointBackgroundColor: point.y >= 80 ? '#ef4444' : '#3b82f6',
2167
+ * pointBorderColor: '#0f172a',
2168
+ * pointBorderWidth: 1,
2169
+ * }));
2170
+ */
2171
+ setPointStyleByValue(resolver: (point: ScatterPointContext) => ScatterPointHighlightStyle | undefined): this;
2172
+ /**
2173
+ * @description 특정 조건의 포인트 모양을 변경합니다. 이미지 사용 가능
2174
+ * @param predicate
2175
+ * @param pointStyle
2176
+ * @returns {this}
2177
+ * @since 2.4.0
2178
+ * @example
2179
+ * const alertImage = new Image();
2180
+ * alertImage.src = '/icons/alert-point.png';
2181
+ *
2182
+ * chart.setPointStyleWhere(
2183
+ * point => point.raw.status === 'alert',
2184
+ * alertImage
2185
+ * );
2186
+ */
2187
+ setPointStyleWhere(predicate: (point: ScatterPointContext) => boolean, pointStyle: PointStyle | HTMLImageElement | HTMLCanvasElement): this;
2188
+ /**
2189
+ * @description Scatter 기준선을 중심으로 4개 영역을 구분합니다.
2190
+ * @param options
2191
+ * @returns {this}
2192
+ * @since 2.4.0
2193
+ * @example
2194
+ * chart.addQuadrant({
2195
+ * x: 50,
2196
+ * y: 50,
2197
+ * labels: {
2198
+ * topLeft: '낮은 X / 높은 Y',
2199
+ * topRight: '높은 X / 높은 Y',
2200
+ * bottomLeft: '낮은 X / 낮은 Y',
2201
+ * bottomRight: '높은 X / 낮은 Y',
2202
+ * },
2203
+ * });
2204
+ */
2205
+ addQuadrant(options?: ScatterQuadrantOptions): this;
2206
+ /**
2207
+ * @description 선형 회귀선을 표시합니다.
2208
+ * @param options
2209
+ * @returns {this}
2210
+ * @since 2.4.0
2211
+ * @example
2212
+ * chart.addTrendLine({
2213
+ * borderColor: '#ef4444',
2214
+ * borderDash: [6, 4],
2215
+ * });
2216
+ */
2217
+ addTrendLine(options?: ScatterTrendLineOptions): this;
2218
+ /**
2219
+ * @description 마우스 위치의 X/Y 가이드라인과 값을 표시합니다.
2220
+ * @param options
2221
+ * @returns {this}
2222
+ * @since 2.4.0
2223
+ * @example
2224
+ * chart.addCrosshair({
2225
+ * color: 'rgba(37, 99, 235, 0.65)',
2226
+ * xFormatter: value => `${value} ms`,
2227
+ * yFormatter: value => `${value}%`,
2228
+ * });
2229
+ */
2230
+ addCrosshair(options?: ScatterCrosshairOptions): this;
2231
+ /**
2232
+ * @description 데이터 강조를 합니다.
2233
+ * @param predicate
2234
+ * @param style
2235
+ * @returns {this}
2236
+ * @since 2.4.0
2237
+ * @example
2238
+ * chart.highlightPoints(
2239
+ * point => point.y >= 80,
2240
+ * {
2241
+ * pointRadius: 8,
2242
+ * pointBackgroundColor: '#ef4444',
2243
+ * pointBorderColor: '#7f1d1d',
2244
+ * }
2245
+ * );
2246
+ */
2247
+ highlightPoints(predicate: (point: ScatterPointContext) => boolean, style?: ScatterPointHighlightStyle): this;
2248
+ /**
2249
+ * @description 데이터 기준으로 축 범위를 자동 계산하고 padding을 줍니다.
2250
+ * @param padding
2251
+ * @returns {this}
2252
+ * @since 2.4.0
2253
+ * @example
2254
+ * chart.setAxisRangeFromData(0.15);
2255
+ *
2256
+ * @example
2257
+ * chart.setAxisRangeFromData({
2258
+ * x: 0.2,
2259
+ * y: 0.1,
2260
+ * });
2261
+ */
2262
+ setAxisRangeFromData(padding?: number | ScatterAxisRangePadding): this;
2263
+ }
2264
+
2007
2265
  declare class BubbleChart extends CartesianChart<'bubble'> implements BubbleChartBuilder {
2008
2266
  constructor(type: 'bubble', labels: (string | number)[], datasets: CartesianDataset<'bubble'>[], options?: CustomBubbleChartOptions, plugins?: any);
2009
2267
  protected requireLabels(): boolean;
@@ -2166,7 +2424,7 @@ declare class BubbleChart extends CartesianChart<'bubble'> implements BubbleChar
2166
2424
  declare abstract class ArcChart<TType extends ArcChartType> extends Chart<TType> implements ArcChartBuilder<TType> {
2167
2425
  readonly type: TType;
2168
2426
  private _chartId?;
2169
- protected constructor(type: TType, labels: (string | number)[], datasets: ChartDataset<TType, (number | null)[]>[], options?: CustomArcChartOptions<TType>, plugins?: Plugin$1);
2427
+ protected constructor(type: TType, labels: (string | number)[], datasets: ChartDataset<TType, (number | null)[]>[], options?: CustomArcChartOptions<TType>, plugins?: Plugin);
2170
2428
  get chartId(): string;
2171
2429
  set chartId(value: string);
2172
2430
  protected requireLabels(): boolean;
@@ -2584,7 +2842,7 @@ declare class PieChart extends ArcChart<'pie'> implements PieChartBuilder {
2584
2842
 
2585
2843
  declare class TreemapChart extends Chart<'treemap', CustomTreemapChartOptions> implements TreemapChartBuilder {
2586
2844
  private _chartId?;
2587
- constructor(type: 'treemap', labels: undefined, datasets: CustomTreemapDataset[], options?: CustomTreemapChartOptions, plugins?: Plugin$1);
2845
+ constructor(type: 'treemap', labels: undefined, datasets: CustomTreemapDataset[], options?: CustomTreemapChartOptions, plugins?: Plugin);
2588
2846
  get chartId(): string;
2589
2847
  set chartId(value: string);
2590
2848
  protected normalize(): void;
@@ -2748,6 +3006,55 @@ declare const createAssignedTasksPlugin: (fieldName?: string, options?: {
2748
3006
  afterDatasetsDraw(chart: any, args: any, pluginOptions: any): void;
2749
3007
  };
2750
3008
 
3009
+ /**
3010
+ * @description Scatter 기준선을 중심으로 4개 영역을 구분하는 플러그인 인스턴스를 생성합니다.
3011
+ * @param options
3012
+ * @returns Chart.js 플러그인 객체
3013
+ * @group Scatter Plugins
3014
+ * @example
3015
+ * ```ts
3016
+ * chart.setPlugin(
3017
+ * createScatterQuadrantPlugin({
3018
+ * x: 50,
3019
+ * y: 50,
3020
+ * })
3021
+ * );
3022
+ * ```
3023
+ */
3024
+ declare function createScatterQuadrantPlugin(options?: ScatterQuadrantOptions): Plugin<'scatter'>;
3025
+ /**
3026
+ * @description Scatter 데이터에 대한 선형 회귀선을 그리는 플러그인 인스턴스를 생성합니다.
3027
+ * @param options
3028
+ * @returns Chart.js 플러그인 객체
3029
+ * @group Scatter Plugins
3030
+ * @example
3031
+ * ```ts
3032
+ * chart.setPlugin(
3033
+ * createScatterTrendLinePlugin({
3034
+ * borderColor: '#ef4444',
3035
+ * borderDash: [6, 4],
3036
+ * })
3037
+ * );
3038
+ * ```
3039
+ */
3040
+ declare function createScatterTrendLinePlugin(options?: ScatterTrendLineOptions): Plugin<'scatter'>;
3041
+ /**
3042
+ * @description Hover된 포인트 기준으로 X/Y 가이드라인과 값을 표시하는 플러그인 인스턴스를 생성합니다.
3043
+ * @param options
3044
+ * @returns Chart.js 플러그인 객체
3045
+ * @group Scatter Plugins
3046
+ * @example
3047
+ * ```ts
3048
+ * chart.setPlugin(
3049
+ * createScatterCrosshairPlugin({
3050
+ * xFormatter: value => `${value} ms`,
3051
+ * yFormatter: value => `${value}%`,
3052
+ * })
3053
+ * );
3054
+ * ```
3055
+ */
3056
+ declare function createScatterCrosshairPlugin(options?: ScatterCrosshairOptions): Plugin<'scatter'>;
3057
+
2751
3058
  /**
2752
3059
  * @description 데이터가 없을 때 'No data' 텍스트를 차트 중앙에 표시하는 플러그인입니다.
2753
3060
  * @group Common Plugins
@@ -2921,7 +3228,7 @@ declare const customDatasetPlugins: {
2921
3228
  * @description 임계값을 초과하는 데이터 포인트에 깜빡이는 하이라이트 효과를 표시하는 플러그인입니다.
2922
3229
  * @group Common Plugins
2923
3230
  */
2924
- declare const blinkPlugin: Plugin$1;
3231
+ declare const blinkPlugin: Plugin;
2925
3232
  /**
2926
3233
  * @description 도넛 차트 중앙에 표시할 HTML 문자열을 생성하는 유틸리티 함수입니다.
2927
3234
  * @param percent - 퍼센트 값
@@ -3124,6 +3431,10 @@ declare const defaultLineScales: CommonAxesSacels;
3124
3431
  declare const createDefaultLineOptions: (userOptions?: CustomLineChartOptions, defaultScales?: CommonAxesSacels) => CustomLineChartOptions;
3125
3432
  declare const sparkLineOptions: CustomLineChartOptions;
3126
3433
 
3434
+ declare const defaultScatterTooltipCallback: (context: TooltipItem<"scatter">) => string;
3435
+ declare const defaultScatterScales: CommonAxesSacels;
3436
+ declare const createDefaultScatterOptions: (userOptions?: CustomScatterChartOptions, defaultScales?: CommonAxesSacels) => CustomScatterChartOptions;
3437
+
3127
3438
  declare const defaultBubbleTooltipCallback: (context: TooltipItem<"bubble">) => string;
3128
3439
  declare const defaultBubbleScales: CommonAxesSacels;
3129
3440
  declare const createDefaultBubbleOptions: (userOptions?: CustomBubbleChartOptions, defaultScales?: CommonAxesSacels) => CustomBubbleChartOptions;
@@ -3213,7 +3524,11 @@ declare const LocalDefaults_createDefaultCartesianScales: typeof createDefaultCa
3213
3524
  declare const LocalDefaults_createDefaultDoughnutOptions: typeof createDefaultDoughnutOptions;
3214
3525
  declare const LocalDefaults_createDefaultLineOptions: typeof createDefaultLineOptions;
3215
3526
  declare const LocalDefaults_createDefaultPieOptions: typeof createDefaultPieOptions;
3527
+ declare const LocalDefaults_createDefaultScatterOptions: typeof createDefaultScatterOptions;
3216
3528
  declare const LocalDefaults_createDefaultTreemapOptions: typeof createDefaultTreemapOptions;
3529
+ declare const LocalDefaults_createScatterCrosshairPlugin: typeof createScatterCrosshairPlugin;
3530
+ declare const LocalDefaults_createScatterQuadrantPlugin: typeof createScatterQuadrantPlugin;
3531
+ declare const LocalDefaults_createScatterTrendLinePlugin: typeof createScatterTrendLinePlugin;
3217
3532
  declare const LocalDefaults_createStatusPlugin: typeof createStatusPlugin;
3218
3533
  declare const LocalDefaults_createTodayLinePlugin: typeof createTodayLinePlugin;
3219
3534
  declare const LocalDefaults_createWeekendPlugin: typeof createWeekendPlugin;
@@ -3227,6 +3542,8 @@ declare const LocalDefaults_defaultDoughnutTooltipCallback: typeof defaultDoughn
3227
3542
  declare const LocalDefaults_defaultLineScales: typeof defaultLineScales;
3228
3543
  declare const LocalDefaults_defaultLineTooltipCallback: typeof defaultLineTooltipCallback;
3229
3544
  declare const LocalDefaults_defaultPieTooltipCallback: typeof defaultPieTooltipCallback;
3545
+ declare const LocalDefaults_defaultScatterScales: typeof defaultScatterScales;
3546
+ declare const LocalDefaults_defaultScatterTooltipCallback: typeof defaultScatterTooltipCallback;
3230
3547
  declare const LocalDefaults_defaultTreemapTooltipCallback: typeof defaultTreemapTooltipCallback;
3231
3548
  declare const LocalDefaults_doughnutCenterTextPlugin: typeof doughnutCenterTextPlugin;
3232
3549
  declare const LocalDefaults_loadingPlugin: typeof loadingPlugin;
@@ -3261,7 +3578,11 @@ declare namespace LocalDefaults {
3261
3578
  LocalDefaults_createDefaultDoughnutOptions as createDefaultDoughnutOptions,
3262
3579
  LocalDefaults_createDefaultLineOptions as createDefaultLineOptions,
3263
3580
  LocalDefaults_createDefaultPieOptions as createDefaultPieOptions,
3581
+ LocalDefaults_createDefaultScatterOptions as createDefaultScatterOptions,
3264
3582
  LocalDefaults_createDefaultTreemapOptions as createDefaultTreemapOptions,
3583
+ LocalDefaults_createScatterCrosshairPlugin as createScatterCrosshairPlugin,
3584
+ LocalDefaults_createScatterQuadrantPlugin as createScatterQuadrantPlugin,
3585
+ LocalDefaults_createScatterTrendLinePlugin as createScatterTrendLinePlugin,
3265
3586
  LocalDefaults_createStatusPlugin as createStatusPlugin,
3266
3587
  LocalDefaults_createTodayLinePlugin as createTodayLinePlugin,
3267
3588
  LocalDefaults_createWeekendPlugin as createWeekendPlugin,
@@ -3275,6 +3596,8 @@ declare namespace LocalDefaults {
3275
3596
  LocalDefaults_defaultLineScales as defaultLineScales,
3276
3597
  LocalDefaults_defaultLineTooltipCallback as defaultLineTooltipCallback,
3277
3598
  LocalDefaults_defaultPieTooltipCallback as defaultPieTooltipCallback,
3599
+ LocalDefaults_defaultScatterScales as defaultScatterScales,
3600
+ LocalDefaults_defaultScatterTooltipCallback as defaultScatterTooltipCallback,
3278
3601
  LocalDefaults_defaultTreemapTooltipCallback as defaultTreemapTooltipCallback,
3279
3602
  LocalDefaults_doughnutCenterTextPlugin as doughnutCenterTextPlugin,
3280
3603
  LocalDefaults_loadingPlugin as loadingPlugin,
@@ -3637,6 +3960,7 @@ declare const T$: {
3637
3960
  readonly CartesianChart: typeof CartesianChart;
3638
3961
  readonly BarChart: typeof BarChart;
3639
3962
  readonly LineChart: typeof LineChart;
3963
+ readonly ScatterChart: typeof ScatterChart;
3640
3964
  readonly BubbleChart: typeof BubbleChart;
3641
3965
  readonly ArcChart: typeof ArcChart;
3642
3966
  readonly DoughnutChart: typeof DoughnutChart;
@@ -3646,6 +3970,7 @@ declare const T$: {
3646
3970
  readonly CartesianChartWrapper: typeof CartesianChart;
3647
3971
  readonly BarChartWrapper: typeof BarChart;
3648
3972
  readonly LineChartWrapper: typeof LineChart;
3973
+ readonly ScatterChartWrapper: typeof ScatterChart;
3649
3974
  readonly BubbleChartWrapper: typeof BubbleChart;
3650
3975
  readonly ArcChartWrapper: typeof ArcChart;
3651
3976
  readonly DoughnutChartWrapper: typeof DoughnutChart;
@@ -3659,5 +3984,5 @@ declare const T$: {
3659
3984
  };
3660
3985
  };
3661
3986
 
3662
- export { ArcChart, ArcChart as ArcChartWrapper, BarChart, BarChart as BarChartWrapper, BubbleChart, BubbleChart as BubbleChartWrapper, CartesianChart, CartesianChart as CartesianChartWrapper, Chart, ChartFactory, ChartInstance, ChartToolBox, ChartTypes, Chart as ChartWrapper, CreateZoomRangeSlider, DefaultArcRadius, DefaultDataLabelsOptions, DefaultHiddenLegendTopOptions, DefaultHiddenSparkScales, DefaultResponsiveChartOptions, DefaultSparkPluginOptions, DefaultTimeScaleOptions, DefaultTopLegendOptions, DefaultZoomOptions, DoughnutChart, DoughnutChart as DoughnutChartWrapper, LineChart, LineChart as LineChartWrapper, PieChart, PieChart as PieChartWrapper, T$, TreemapChart, TreemapChart as TreemapChartWrapper, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, clearChartActiveElements, createAssignedTasksPlugin, createDefaultBarOptions, createDefaultBubbleOptions, createDefaultCartesianScales, createDefaultDoughnutOptions, createDefaultLineOptions, createDefaultPieOptions, createDefaultTreemapOptions, createStatusPlugin, createTodayLinePlugin, createWeekendPlugin, customDatasetPlugins, customLegend, T$ as default, defaultBarScales, defaultBarTooltipCallback, defaultBubbleScales, defaultBubbleTooltipCallback, defaultDoughnutTooltipCallback, defaultLineScales, defaultLineTooltipCallback, defaultPieTooltipCallback, defaultTreemapTooltipCallback, doughnutCenterTextPlugin, downloadChartAsImage, downloadChartAsImageByInstance, getChartAsBase64, getChartAsBase64ByInstance, getChartAsBlob, getChartAsBlobByInstance, getChartDatasetMeta, getChartInstance, hideChartTooltip, isChartDatasetVisible, loadingPlugin, makeCenterHtml, mountChart, noDataPlugin, resetChartZoom, resizeChart, segmentImagePlugin, setChartActiveElements, setChartConfig, setChartDatasetVisibility, showChartTooltip, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, toggleChartDatasetVisibility, updateChart, zoomRangeSlider, zoomResetPlugin };
3663
- export type { Align, AllChartTypes, ArcChartBuilder, ArcChartType, ArcDataset, AutoZoomLimitMode, AutoZoomLimits, AxisColors, BarChartBuilder, BubbleChartBuilder, CartesianChartBuilder, CartesianChartType, CartesianDataset, ChartBuilder, ChartImageExportOptions, ChartTarget, ChartWithFocus, Color, CommonAxes, CommonAxesSacels, CommonCartesian, CommonCartesianAxes, CommonCartesianLegendConfig, CommonCartesianTicks, CommonCartesianTitleConfig, CommonTicks, Constructor, CustomArcChartOptions, CustomBarChartOptions, CustomBubbleChartOptions, CustomCartesianDataset, CustomChartDatasets, CustomChartOptions, CustomDoughnutChartOptions, CustomLineChartOptions, CustomOptionPlugins, CustomPieChartOptions, CustomTreemapChartOptions, CustomTreemapDataset, CustomZoomType, DataLabels, DataLabelsContext, DatasetWithPrevColors, DeepPartial, DeepPartialCartesianAxes, DeepPartialPluginOptions, DeepPartialZoomType, DoughnutChartBuilder, FocusCallback, HierarchicalChartType, HtmlLegendOptions, LineChartBuilder, Mode, MountChartHandle, OriginalColors, Override, PartialDataLabels, PieChartBuilder, Position, RadarChartBuilder, RadialChartType, ScaleWithOriginalColors, SegmentImageConfig, SettingOptions, SpinnerOverlayConfig, SpinnerOverlayOption, SpinnerOverlayRenderContext, SpinnerOverlaySpinnerContent, SpinnerOverlayStyle, StzClickContext, StzClickHandler, StzClickItem, StzConfig, TimeScaleConfig, TimeScaleType, TimeUnit, TreemapChartBuilder, UidImageMapping, ZoomLimitOptions, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar, ZoomScaleLimits };
3987
+ export { ArcChart, ArcChart as ArcChartWrapper, BarChart, BarChart as BarChartWrapper, BubbleChart, BubbleChart as BubbleChartWrapper, CartesianChart, CartesianChart as CartesianChartWrapper, Chart, ChartFactory, ChartInstance, ChartToolBox, ChartTypes, Chart as ChartWrapper, CreateZoomRangeSlider, DefaultArcRadius, DefaultDataLabelsOptions, DefaultHiddenLegendTopOptions, DefaultHiddenSparkScales, DefaultResponsiveChartOptions, DefaultSparkPluginOptions, DefaultTimeScaleOptions, DefaultTopLegendOptions, DefaultZoomOptions, DoughnutChart, DoughnutChart as DoughnutChartWrapper, LineChart, LineChart as LineChartWrapper, PieChart, PieChart as PieChartWrapper, ScatterChart, ScatterChart as ScatterChartWrapper, T$, TreemapChart, TreemapChart as TreemapChartWrapper, barScaleImgPlugin, blinkPlugin, changeSetting, chartMountPlugin, clearChartActiveElements, createAssignedTasksPlugin, createDefaultBarOptions, createDefaultBubbleOptions, createDefaultCartesianScales, createDefaultDoughnutOptions, createDefaultLineOptions, createDefaultPieOptions, createDefaultScatterOptions, createDefaultTreemapOptions, createScatterCrosshairPlugin, createScatterQuadrantPlugin, createScatterTrendLinePlugin, createStatusPlugin, createTodayLinePlugin, createWeekendPlugin, customDatasetPlugins, customLegend, T$ as default, defaultBarScales, defaultBarTooltipCallback, defaultBubbleScales, defaultBubbleTooltipCallback, defaultDoughnutTooltipCallback, defaultLineScales, defaultLineTooltipCallback, defaultPieTooltipCallback, defaultScatterScales, defaultScatterTooltipCallback, defaultTreemapTooltipCallback, doughnutCenterTextPlugin, downloadChartAsImage, downloadChartAsImageByInstance, getChartAsBase64, getChartAsBase64ByInstance, getChartAsBlob, getChartAsBlobByInstance, getChartDatasetMeta, getChartInstance, hideChartTooltip, isChartDatasetVisible, loadingPlugin, makeCenterHtml, mountChart, noDataPlugin, resetChartZoom, resizeChart, segmentImagePlugin, setChartActiveElements, setChartConfig, setChartDatasetVisibility, showChartTooltip, sparkBarOptions, sparkBubbleOptions, sparkLineOptions, toggleChartDatasetVisibility, updateChart, zoomRangeSlider, zoomResetPlugin };
3988
+ export type { Align, AllChartTypes, ArcChartBuilder, ArcChartType, ArcDataset, AutoZoomLimitMode, AutoZoomLimits, AxisColors, BarChartBuilder, BubbleChartBuilder, CartesianChartBuilder, CartesianChartType, CartesianDataset, ChartBuilder, ChartImageExportOptions, ChartTarget, ChartWithFocus, Color, CommonAxes, CommonAxesSacels, CommonCartesian, CommonCartesianAxes, CommonCartesianLegendConfig, CommonCartesianTicks, CommonCartesianTitleConfig, CommonTicks, Constructor, CustomArcChartOptions, CustomBarChartOptions, CustomBubbleChartOptions, CustomCartesianDataset, CustomChartDatasets, CustomChartOptions, CustomDoughnutChartOptions, CustomLineChartOptions, CustomOptionPlugins, CustomPieChartOptions, CustomScatterChartOptions, CustomTreemapChartOptions, CustomTreemapDataset, CustomZoomType, DataLabels, DataLabelsContext, DatasetWithPrevColors, DeepPartial, DeepPartialCartesianAxes, DeepPartialPluginOptions, DeepPartialZoomType, DoughnutChartBuilder, FocusCallback, HierarchicalChartType, HtmlLegendOptions, LineChartBuilder, Mode, MountChartHandle, OriginalColors, Override, PartialDataLabels, PieChartBuilder, Position, RadarChartBuilder, RadialChartType, ScaleWithOriginalColors, ScatterAxisRangePadding, ScatterChartBuilder, ScatterCrosshairOptions, ScatterDataset, ScatterPointContext, ScatterPointHighlightStyle, ScatterQuadrantOptions, ScatterTrendLineOptions, SegmentImageConfig, SettingOptions, SpinnerOverlayConfig, SpinnerOverlayOption, SpinnerOverlayRenderContext, SpinnerOverlaySpinnerContent, SpinnerOverlayStyle, StzClickContext, StzClickHandler, StzClickItem, StzConfig, TimeScaleConfig, TimeScaleType, TimeUnit, TreemapChartBuilder, UidImageMapping, ZoomLimitOptions, ZoomRangeSliderColors, ZoomRangeSliderPlugin, ZoomRangeSliderVar, ZoomScaleLimits };