forked from syncfusion/ej2-javascript-ui-controls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchart.ts
4895 lines (4552 loc) · 190 KB
/
chart.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import { Component, Property, NotifyPropertyChanges, Internationalization, SanitizeHtmlHelper } from '@syncfusion/ej2-base';
import { ModuleDeclaration, L10n, setValue, isNullOrUndefined, updateBlazorTemplate } from '@syncfusion/ej2-base';
import { TapEventArgs, EmitType, ChildProperty } from '@syncfusion/ej2-base';
import { remove, extend } from '@syncfusion/ej2-base';
import { INotifyPropertyChanged, Browser, Touch } from '@syncfusion/ej2-base';
import { Event, EventHandler, Complex, Collection } from '@syncfusion/ej2-base';
import { findClipRect, showTooltip, ImageOption, removeElement, appendChildElement, blazorTemplatesReset, withInBounds, getValueXByPoint, getValueYByPoint } from '../common/utils/helper';
import { textElement, RectOption, createSvg, firstToLowerCase, titlePositionX, PointData, redrawElement, getTextAnchor } from '../common/utils/helper';
import { appendClipElement, ChartLocation } from '../common/utils/helper';
import { ChartModel, CrosshairSettingsModel, ZoomSettingsModel, RangeColorSettingModel } from './chart-model';
import { MarginModel, BorderModel, TooltipSettingsModel, IndexesModel, titleSettingsModel, ChartAreaModel, AccessibilityModel } from '../common/model/base-model';
import { getSeriesColor, getThemeColor } from '../common/model/theme';
import { Margin, Border, TooltipSettings, Indexes, ChartArea, titleSettings, Accessibility } from '../common/model/base';
import { AxisModel, RowModel, ColumnModel } from './axis/axis-model';
import { Row, Column, Axis } from './axis/axis';
import { Highlight } from './user-interaction/high-light';
import { CartesianAxisLayoutPanel } from './axis/cartesian-panel';
import { DateTime } from './axis/date-time-axis';
import { Category } from './axis/category-axis';
import { DateTimeCategory } from './axis/date-time-category-axis';
import { CandleSeries } from './series/candle-series';
import { ErrorBar } from './series/error-bar';
import { Logarithmic } from './axis/logarithmic-axis';
import { Rect, measureText, TextOption, Size, SvgRenderer, BaseAttibutes, CanvasRenderer } from '@syncfusion/ej2-svg-base';
import { ChartData } from './utils/get-data';
import { LineType, ZoomMode, ToolbarItems } from './utils/enum';
import { SelectionMode, HighlightMode, ChartTheme } from '../common/utils/enum';
import { Points, Series, SeriesBase } from './series/chart-series';
import { SeriesModel } from './series/chart-series-model';
import { Data } from '../common/model/data';
import { LineSeries } from './series/line-series';
import { AreaSeries } from './series/area-series';
import { BarSeries } from './series/bar-series';
import { HistogramSeries } from './series/histogram-series';
import { StepLineSeries } from './series/step-line-series';
import { StepAreaSeries } from './series/step-area-series';
import { ColumnSeries } from './series/column-series';
import { ParetoSeries } from './series/pareto-series';
import { StackingColumnSeries } from './series/stacking-column-series';
import { StackingBarSeries } from './series/stacking-bar-series';
import { StackingAreaSeries } from './series/stacking-area-series';
import { StackingStepAreaSeries } from './series/stacking-step-area-series';
import { StackingLineSeries } from './series/stacking-line-series';
import { ScatterSeries } from './series/scatter-series';
import { SplineSeries } from './series/spline-series';
import { SplineAreaSeries } from './series/spline-area-series';
import { RangeColumnSeries } from './series/range-column-series';
import { PolarSeries } from './series/polar-series';
import { RadarSeries } from './series/radar-series';
import { HiloSeries } from './series/hilo-series';
import { HiloOpenCloseSeries } from './series/hilo-open-close-series';
import { WaterfallSeries } from './series/waterfall-series';
import { BubbleSeries } from './series/bubble-series';
import { RangeAreaSeries } from './series/range-area-series';
import { RangeStepAreaSeries } from './series/range-step-area-series';
import { SplineRangeAreaSeries } from './series/spline-range-area-series';
import { Tooltip } from './user-interaction/tooltip';
import { Crosshair } from './user-interaction/crosshair';
import { DataEditing } from './user-interaction/data-editing';
import { Marker, markerShapes } from './series/marker';
import { LegendSettings } from '../common/legend/legend';
import { LegendSettingsModel } from '../common/legend/legend-model';
import { Legend } from './legend/legend';
import { Zoom } from './user-interaction/zooming';
import { Selection } from './user-interaction/selection';
import { DataLabel } from './series/data-label';
import { StripLine } from './axis/strip-line';
import { MultiLevelLabel } from './axis/multi-level-labels';
import { BoxAndWhiskerSeries } from './series/box-and-whisker-series';
import { PolarRadarPanel } from './axis/polar-radar-panel';
import { StripLineSettingsModel, ToolbarPositionModel } from './model/chart-base-model';
import { Trendline } from './series/chart-series';
import { Trendlines } from './trend-lines/trend-line';
import { TechnicalIndicator } from './technical-indicators/technical-indicator';
import { SmaIndicator } from './technical-indicators/sma-indicator';
import { EmaIndicator } from './technical-indicators/ema-indicator';
import { TmaIndicator } from './technical-indicators/tma-indicator';
import { AccumulationDistributionIndicator } from './technical-indicators/ad-indicator';
import { AtrIndicator } from './technical-indicators/atr-indicator';
import { BollingerBands } from './technical-indicators/bollinger-bands';
import { MomentumIndicator } from './technical-indicators/momentum-indicator';
import { StochasticIndicator } from './technical-indicators/stochastic-indicator';
import { MacdIndicator } from './technical-indicators/macd-indicator';
import { RsiIndicator } from './technical-indicators/rsi-indicator';
import { TechnicalIndicatorModel } from './technical-indicators/technical-indicator-model';
import { ILegendRenderEventArgs, IAxisLabelRenderEventArgs, ITextRenderEventArgs, IResizeEventArgs } from '../chart/model/chart-interface';
import { IAnnotationRenderEventArgs, IAxisMultiLabelRenderEventArgs, IThemeStyle, IScrollEventArgs } from '../chart/model/chart-interface';
import { IPointRenderEventArgs, ISeriesRenderEventArgs, ISelectionCompleteEventArgs } from '../chart/model/chart-interface';
import { IDragCompleteEventArgs, ITooltipRenderEventArgs, IExportEventArgs } from '../chart/model/chart-interface';
import { IZoomCompleteEventArgs, ILoadedEventArgs, IZoomingEventArgs, IAxisLabelClickEventArgs } from '../chart/model/chart-interface';
import { IMultiLevelLabelClickEventArgs, ILegendClickEventArgs, ISharedTooltipRenderEventArgs } from '../chart/model/chart-interface';
import { IAnimationCompleteEventArgs, IMouseEventArgs, IPointEventArgs, IBeforeResizeEventArgs } from '../chart/model/chart-interface';
import { chartMouseClick, chartDoubleClick, pointClick, pointDoubleClick, axisLabelClick, beforeResize } from '../common/model/constants';
import { chartMouseDown, chartMouseMove, chartMouseUp, load, pointMove, chartMouseLeave, resized } from '../common/model/constants';
import { IPrintEventArgs, IAxisRangeCalculatedEventArgs, IDataEditingEventArgs } from '../chart/model/chart-interface';
import { ChartAnnotationSettingsModel } from './model/chart-base-model';
import { ChartAnnotationSettings, ToolbarPosition } from './model/chart-base';
import { ChartAnnotation } from './annotation/annotation';
import { getElement, getTitle } from '../common/utils/helper';
import { Alignment, ExportType, SelectionPattern } from '../common/utils/enum';
import { MultiColoredLineSeries } from './series/multi-colored-line-series';
import { MultiColoredAreaSeries } from './series/multi-colored-area-series';
import { ScrollBar } from '../common/scrollbar/scrollbar';
import { DataManager } from '@syncfusion/ej2-data';
import { StockChart } from '../stock-chart/stock-chart';
import { Export } from './print-export/export';
import { PrintUtils } from '../common/utils/print';
import { IAfterExportEventArgs } from '../common/model/interface';
/**
* Configures the range color settings in the chart.
*/
export class RangeColorSetting extends ChildProperty<RangeColorSetting> {
/**
* Specifies the start value of the color mapping range.
*/
@Property()
public start: number;
/**
* Specifies the end value of the color mapping range.
*/
@Property()
public end: number;
/**
* Specifies the fill colors for points that lie within the given range. If multiple colors are specified, a gradient will be applied.
*/
@Property([])
public colors: string[];
/**
* Specifies the name or label for the range mapping item.
*/
@Property('')
public label: string;
}
/**
* Options to configure the crosshair on the chart, which displays lines that follow the mouse cursor and show the axis values of the data points.
*/
export class CrosshairSettings extends ChildProperty<CrosshairSettings> {
/**
* If set to true, the crosshair line becomes visible.
*
* @default false
*/
@Property(false)
public enable: boolean;
/**
* Specifies the pattern of dashes and gaps used to stroke the crosshair line.
*
* @default ''
*/
@Property('')
public dashArray: string;
/**
* The `line` property allows defining the appearance of the crosshair line, including its color and width.
*/
@Complex<BorderModel>({ color: null, width: 1 }, Border)
public line: BorderModel;
/**
* Specifies the line type for the crosshair.
* The available modes are:
* * None: Both vertical and horizontal crosshair lines are hidden.
* * Both: Displays both the vertical and horizontal crosshair lines.
* * Vertical: Shows only the vertical crosshair line.
* * Horizontal: Shows only the horizontal crosshair line.
*
* @default Both
*/
@Property('Both')
public lineType: LineType;
/**
* The color of the vertical crosshair line accepts values in hex and rgba as valid CSS color strings.
*
* @default ''
*/
@Property('')
public verticalLineColor: string;
/**
* The color of the horizontal crosshair line accepts values in hex and rgba as valid CSS color strings.
*
* @default ''
*/
@Property('')
public horizontalLineColor: string;
/**
* Specifies the opacity level for the crosshair, which controls its transparency.
*
* @default 1
*/
@Property(1)
public opacity: number;
/**
* If set to `true`, the horizontal crosshair snaps to the nearest data point.
*
* @default false
*/
@Property(false)
public snapToData: boolean;
}
/**
* Configures the zooming behavior for the chart.
*/
export class ZoomSettings extends ChildProperty<ZoomSettings> {
/**
* If set to true, the chart can be zoomed in by selecting a rectangular region on the plot area.
*
* @default false
*/
@Property(false)
public enableSelectionZooming: boolean;
/**
* If set to true, the chart can be pinched to zoom in and out.
*
* @default false
*/
@Property(false)
public enablePinchZooming: boolean;
/**
* If set to true, the chart is rendered with a toolbar on initial load.
*
* @default false
*/
@Property(false)
public showToolbar: boolean;
/**
* If set to true, the chart can be zoomed using the mouse wheel.
*
* @default false
*/
@Property(false)
public enableMouseWheelZooming: boolean;
/**
* If set to true, zooming will be performed on mouse up.
> Note that `enableDeferredZooming` requires `enableSelectionZooming` to be true.
* ```html
* <div id='Chart'></div>
* ```
* ```typescript
* let chart: Chart = new Chart({
* ...
* zoomSettings: {
* enableSelectionZooming: true,
* enableDeferredZooming: false
* }
* ...
* });
* chart.appendTo('#Chart');
* ```
*
* @default true
*/
@Property(true)
public enableDeferredZooming: boolean;
/**
* Specifies whether to allow zooming vertically, horizontally, or in both ways.
* Available options are:
* * XY: Chart can be zoomed both vertically and horizontally.
* * X: Chart can be zoomed horizontally.
* * Y: Chart can be zoomed vertically.
> Note that `enableSelectionZooming` must be set to true for this feature to work.
* ```html
* <div id='Chart'></div>
* ```
* ```typescript
* let chart: Chart = new Chart({
* ...
* zoomSettings: {
* enableSelectionZooming: true,
* mode: 'XY'
* }
* ...
* });
* chart.appendTo('#Chart');
* ```
*
* @default 'XY'
*/
@Property('XY')
public mode: ZoomMode;
/**
* Specifies the toolkit options for zooming as follows:
* * Zoom - Enables the zooming tool to select and zoom into a specific region of the chart.
* * ZoomIn - Provides a button to zoom in on the chart.
* * ZoomOut - Provides a button to zoom out from the chart.
* * Pan - Allows panning across the chart to explore different regions.
* * Reset - Resets the zoom level to the default view of the chart.
*
* @default '["Zoom", "ZoomIn", "ZoomOut", "Pan", "Reset"]'
*/
@Property(['Zoom', 'ZoomIn', 'ZoomOut', 'Pan', 'Reset'])
public toolbarItems: ToolbarItems[];
/**
* If set to true, the chart can be panned without requiring toolbar items. If set to false, panning is disabled, and the toolbar options must be used to pan the chart.
*
* @default false.
*/
@Property(false)
public enablePan: boolean;
/**
* Specifies whether the axis should have a scrollbar.
*
* @default false.
*/
@Property(false)
public enableScrollbar: boolean;
/**
* If set to true, the chart will animate when zooming.
*
* @default false.
*/
@Property(false)
public enableAnimation: boolean;
/**
* Allows customization of the zoom toolbar position. Users can set the horizontal and vertical alignment of the toolbar, as well as specify offsets for precise placement.
*/
@Complex<ToolbarPositionModel>({}, ToolbarPosition)
public toolbarPosition: ToolbarPositionModel;
/**
* Options to improve accessibility for zoom toolkit elements.
*/
@Complex<AccessibilityModel>({}, Accessibility)
public accessibility: AccessibilityModel;
}
/**
* Represents the chart control.
* ```html
* <div id="chart"/>
* <script>
* var chartObj = new Chart({});
* chartObj.appendTo("#chart");
* </script>
* ```
*
* @public
*/
@NotifyPropertyChanges
export class Chart extends Component<HTMLElement> implements INotifyPropertyChanged {
//Module Declaration of Chart.
/**
* `lineSeriesModule` is used to add line series to the chart.
*/
public lineSeriesModule: LineSeries;
/**
* `multiColoredLineSeriesModule` is used to add multi colored line series to the chart.
*/
public multiColoredLineSeriesModule: MultiColoredLineSeries;
/**
* `multiColoredAreaSeriesModule` is used to add multi colored area series to the chart.
*/
public multiColoredAreaSeriesModule: MultiColoredAreaSeries;
/**
* `columnSeriesModule` is used to add column series to the chart.
*/
public columnSeriesModule: ColumnSeries;
/**
* `paretoSeriesModule` is used to add pareto series to the chart.
*/
public paretoSeriesModule: ParetoSeries;
/**
* `areaSeriesModule` is used to add area series to the chart.
*/
public areaSeriesModule: AreaSeries;
/**
* `barSeriesModule` is used to add bar series to the chart.
*/
public barSeriesModule: BarSeries;
/**
* `stackingColumnSeriesModule` is used to add stacking column series to the chart.
*/
public stackingColumnSeriesModule: StackingColumnSeries;
/**
* `stackingAreaSeriesModule` is used to add stacking area series to the chart.
*/
public stackingAreaSeriesModule: StackingAreaSeries;
/**
* `stackingStepAreaSeriesModule` is used to add stacking step area series to the chart.
*/
public stackingStepAreaSeriesModule: StackingStepAreaSeries;
/**
* `stackingLineSeriesModule` is used to add stacking line series to the chart.
*/
public stackingLineSeriesModule: StackingLineSeries;
/**
* 'candleSeriesModule' is used to add candle series to the chart.
*/
public candleSeriesModule: CandleSeries;
/**
* `stackingBarSeriesModule` is used to add stacking bar series to the chart.
*/
public stackingBarSeriesModule: StackingBarSeries;
/**
* `stepLineSeriesModule` is used to add step line series to the chart.
*/
public stepLineSeriesModule: StepLineSeries;
/**
* `stepAreaSeriesModule` is used to add step area series to the chart.
*/
public stepAreaSeriesModule: StepAreaSeries;
/**
* `polarSeriesModule` is used to add polar series to the chart.
*/
public polarSeriesModule: PolarSeries;
/**
* `radarSeriesModule` is used to add radar series to the chart.
*/
public radarSeriesModule: RadarSeries;
/**
* `splineSeriesModule` is used to add spline series to the chart.
*/
public splineSeriesModule: SplineSeries;
/**
* `splineAreaSeriesModule` is used to add spline area series to the chart.
*/
public splineAreaSeriesModule: SplineAreaSeries;
/**
* `scatterSeriesModule` is used to add scatter series to the chart.
*/
public scatterSeriesModule: ScatterSeries;
/**
* `boxAndWhiskerSeriesModule` is used to add box and whisker series to the chart.
*/
public boxAndWhiskerSeriesModule: BoxAndWhiskerSeries;
/**
* `rangeColumnSeriesModule` is used to add range column series to the chart.
*/
public rangeColumnSeriesModule: RangeColumnSeries;
/**
* `histogramSeriesModule` is used to add histogram series to the chart.
*/
public histogramSeriesModule: HistogramSeries;
/**
* `hiloSeriesModule` is used to add hilo series to the chart.
*/
public hiloSeriesModule: HiloSeries;
/**
* `hiloOpenCloseSeriesModule` is used to add hilo open close series to the chart.
*/
public hiloOpenCloseSeriesModule: HiloOpenCloseSeries;
/**
* `waterfallSeries` is used to add waterfall series to the chart.
*/
public waterfallSeriesModule: WaterfallSeries;
/**
* `bubbleSeries` is used to add bubble series to the chart.
*/
public bubbleSeriesModule: BubbleSeries;
/**
* `rangeAreaSeriesModule` is used to add range area series to the chart.
*/
public rangeAreaSeriesModule: RangeAreaSeries;
/**
* `rangeStepAreaSeriesModule` is used to add range step area series to the chart.
*/
public rangeStepAreaSeriesModule: RangeStepAreaSeries;
/**
* `splineRangeAreaSeriesModule` is used to add spline range area series to the chart.
*/
public splineRangeAreaSeriesModule: SplineRangeAreaSeries;
/**
* `tooltipModule` is used to manipulate and add tooltip to the series.
*/
public tooltipModule: Tooltip;
/**
* `crosshairModule` is used to manipulate and add crosshair to the chart.
*/
public crosshairModule: Crosshair;
/**
* `errorBarModule` is used to manipulate and add errorBar for series.
*/
public errorBarModule: ErrorBar;
/**
* `dataLabelModule` is used to manipulate and add data label to the series.
*/
public dataLabelModule: DataLabel;
/**
* `dateTimeModule` is used to manipulate and add date time axis to the chart.
*/
public dateTimeModule: DateTime;
/**
* `categoryModule` is used to manipulate and add category axis to the chart.
*/
public categoryModule: Category;
/**
* `dateTimeCategoryModule` is used to manipulate date time and category axis to the chart.
*/
public dateTimeCategoryModule: DateTimeCategory;
/**
* `logarithmicModule` is used to manipulate and add log axis to the chart.
*/
public logarithmicModule: Logarithmic;
/**
* `legendModule` is used to manipulate and add legend to the chart.
*/
public legendModule: Legend;
/**
* `zoomModule` is used to manipulate and add zooming to the chart.
*/
public zoomModule: Zoom;
/**
* `dataEditingModule` is used to drag and drop of the point.
*/
public dataEditingModule: DataEditing;
/**
* `selectionModule` is used to manipulate and add selection to the chart.
*/
public selectionModule: Selection;
/**
* `highlightModule` is used to manipulate and add highlight to the chart.
*/
public highlightModule: Highlight;
/**
* `annotationModule` is used to manipulate and add annotation to the chart.
*/
public annotationModule: ChartAnnotation;
/**
* `stripLineModule` is used to manipulate and add strip line to the chart.
*/
public stripLineModule: StripLine;
/**
* `multiLevelLabelModule` is used to manipulate and add multi-level labels to the chart.
*/
public multiLevelLabelModule: MultiLevelLabel;
/**
* 'trendlineModule' is used to predict the market trend using trendlines.
*/
public trendLineModule: Trendlines;
/**
* `sMAIndicatorModule` is used to predict the market trend using SMA approach.
*/
public sMAIndicatorModule: SmaIndicator;
/**
* `eMAIndicatorModule` is used to predict the market trend using EMA approach.
*/
public eMAIndicatorModule: EmaIndicator;
/**
* `tMAIndicatorModule` is used to predict the market trend using TMA approach.
*/
public tMAIndicatorModule: TmaIndicator;
/**
* `accumulationDistributionIndicatorModule` is used to predict the market trend using Accumulation Distribution approach.
*/
public accumulationDistributionIndicatorModule: AccumulationDistributionIndicator;
/**
* `atrIndicatorModule` is used to predict the market trend using ATR approach.
*/
public atrIndicatorModule: AtrIndicator;
/**
* `rSIIndicatorModule` is used to predict the market trend using RSI approach.
*/
public rsiIndicatorModule: RsiIndicator;
/**
* `macdIndicatorModule` is used to predict the market trend using Macd approach.
*/
public macdIndicatorModule: MacdIndicator;
/**
* `stochasticIndicatorModule` is used to predict the market trend using Stochastic approach.
*/
public stochasticIndicatorModule: StochasticIndicator;
/**
* `momentumIndicatorModule` is used to predict the market trend using Momentum approach.
*/
public momentumIndicatorModule: MomentumIndicator;
/**
* `bollingerBandsModule` is used to predict the market trend using Bollinger approach.
*/
public bollingerBandsModule: BollingerBands;
/**
* `scrollBarModule` is used to render a scrollbar in the chart while zooming.
*/
public scrollBarModule: ScrollBar;
/**
* `exportModule` is used to export the chart in `JPEG`, `PNG`, `SVG`, `PDF`, `XLSX`, or `CSV` format.
*/
public exportModule: Export;
/**
* The width of the chart as a string, accepting input such as '100px' or '100%'.
* If specified as '100%', the chart renders to the full width of its parent element.
*
* @default null
*/
@Property(null)
public width: string;
/**
* The height of the chart as a string, accepting input such as '100px' or '100%'.
* If specified as '100%', the chart renders to the full height of its parent element.
*
* @default null
*/
@Property(null)
public height: string;
/**
* The title is displayed at the top of the chart to provide information about the plotted data.
*
* @default ''
*/
@Property('')
public title: string;
/**
* Specifies the data source for the chart. It can be an array of JSON objects, or an instance of DataManager.
* ```html
* <div id='Chart'></div>
* ```
* ```typescript
* let dataManager: DataManager = new DataManager({
* url: 'https://services.syncfusion.com/js/production/api/orders'
* });
* let query: Query = new Query().take(5);
* let chart: Chart = new Chart({
* ...
* dataSource: dataManager,
* series: [{
* type: 'Column',
* xName: 'CustomerID',
* yName: 'Freight',
* query: query
* }],
* ...
* });
* chart.appendTo('#Chart');
* ```
*
* @default ''
*/
@Property('')
public dataSource: Object | DataManager;
/**
* Options for customizing the appearance of the title, which displays information about the plotted data.
* Use the `fontFamily`, `size`, `fontStyle`, `fontWeight`, and `color` properties in `titleSettings` to adjust the title's appearance.
*/
@Complex<titleSettingsModel>({fontFamily: null, size: null, fontStyle: null, fontWeight: null, color: null}, titleSettings)
public titleStyle: titleSettingsModel;
/**
* The subtitle is positioned below the main title and provides additional details about the data represented in the chart.
*
* @default ''
*/
@Property('')
public subTitle: string;
/**
* Options for customizing the appearance of the subtitle, which displays information about the plotted data below the main title.
* Use the `fontFamily`, `size`, `fontStyle`, `fontWeight`, and `color` properties in `titleSettings` to adjust the subtitle's appearance.
*/
// eslint-disable-next-line max-len
@Complex<titleSettingsModel>({fontFamily: null, size: null, fontStyle: null, fontWeight: null, color: null, accessibility: {focusable: false}}, titleSettings)
public subTitleStyle: titleSettingsModel;
/**
* Options to customize the margins around the chart, including the left, right, top, and bottom margins.
* These margins refer to the space between the outer edge of the chart and its chart area.
*/
@Complex<MarginModel>({}, Margin)
public margin: MarginModel;
/**
* Options for customizing the appearance of the border in the chart by using the `color` and `width` properties in the `border`.
*/
@Complex<BorderModel>({ color: '#DDDDDD', width: 0 }, Border)
public border: BorderModel;
/**
* The background color of the chart accepts values in hex and rgba formats as valid CSS color strings.
*
* @default null
*/
@Property(null)
public background: string;
/**
* Configuration options for the chart area's border and background.
*/
@Complex<ChartAreaModel>({ border: { color: null, width: 0.5 }, background: 'transparent' }, ChartArea)
public chartArea: ChartAreaModel;
/**
* Specifies whether to display or remove the untrusted HTML values in the Chart component.
* If 'enableHtmlSanitizer' set to true, the component will sanitize any suspected untrusted strings and scripts before rendering them.
*
* @default false
*/
@Property(false)
public enableHtmlSanitizer: boolean;
/**
* The `primaryXAxis` property configures the horizontal axis of the chart, including settings for axis labels, tick marks, grid lines, and axis ranges.
*/
@Complex<AxisModel>({ name: 'primaryXAxis' }, Axis)
public primaryXAxis: AxisModel;
/**
* The `primaryYAxis` property configures the vertical axis of the chart, including settings for axis labels, tick marks, grid lines, and axis ranges.
*/
@Complex<AxisModel>({ name: 'primaryYAxis' }, Axis)
public primaryYAxis: AxisModel;
/**
* Options to split the chart into multiple plotting areas horizontally.
* Each object in the collection represents a separate plotting area (row) in the chart, allowing multiple data series to be displayed in distinct horizontal sections.
*/
@Collection<RowModel>([{}], Row)
public rows: RowModel[];
/**
* Options to split the chart into multiple plotting areas vertically.
* Each object in the collection represents a separate plotting area (column) in the chart, allowing multiple data series to be displayed in distinct vertical sections.
*/
@Collection<ColumnModel>([{}], Column)
public columns: ColumnModel[];
/**
* Configuration options for the secondary axis in the chart.
* Each object in the collection represents an additional axis, allowing for the plotting of multiple data series with different scales.
*/
@Collection<AxisModel>([{}], Axis)
public axes: AxisModel[];
/**
* Configuration options for the chart's series.
* Each object in the `series` collection represents a distinct data series displayed in the chart. Customize various aspects of each series such as data, type, and appearance.
*/
@Collection<SeriesModel>([{}], Series)
public series: SeriesModel[];
/**
* Annotations are used to highlight specific data points or areas in the chart, providing additional context and information.
*/
@Collection<ChartAnnotationSettingsModel>([{accessibility: {focusable: false}}], ChartAnnotationSettings)
public annotations: ChartAnnotationSettingsModel[];
/**
* The `palettes` array defines a set of colors used for rendering the chart's series. Each color in the array is applied to the series in order.
*
* @default []
*/
@Property([])
public palettes: string[];
/**
* The theme applied to the chart for visual styling.
* Choose from predefined themes to change the overall look and feel of the chart.
* The available themes are:
* * Fabric
* * FabricDark
* * Bootstrap4
* * Bootstrap
* * BootstrapDark
* * HighContrastLight
* * HighContrast
* * Tailwind
* * TailwindDark
* * Bootstrap5
* * Bootstrap5Dark
* * Fluent
* * FluentDark
* * Fluent2
* * Fluent2Dark
* * Fluent2HighContrast
* * Material3
* * Material3Dark
* * Material
* * MaterialDark
*
* @default 'Material'
*/
@Property('Material')
public theme: ChartTheme;
/**
* Configuration options for the chart's tooltip, which displays details about the points when hovering over them.
*/
@Complex<TooltipSettingsModel>({}, TooltipSettings)
public tooltip: TooltipSettingsModel;
/**
* The crosshair displays lines on the chart that follow the mouse cursor and show the axis values of the data points.
*/
@Complex<CrosshairSettingsModel>({}, CrosshairSettings)
public crosshair: CrosshairSettingsModel;
/**
* The legend provides descriptive information about the data series displayed in the chart, helping to understand what each series represents.
*/
@Complex<LegendSettingsModel>({}, LegendSettings)
public legendSettings: LegendSettingsModel;
/**
* The `rangeColorSettings` property specifies a set of rules for applying different colors to points based on their value ranges.
*/
@Collection<RangeColorSettingModel>([{}], RangeColorSetting)
public rangeColorSettings: RangeColorSettingModel[];
/**
* Options to enable and configure the zooming feature in the chart.
*/
@Complex<ZoomSettingsModel>({}, ZoomSettings)
public zoomSettings: ZoomSettingsModel;
/**
* Defines the color used to highlight a data point on mouse hover.
*
* @default ''
*/
@Property('')
public highlightColor: string;
/**
* The `selectionMode` property determines how data points or series can be highlighted or selected.
* The available options are:
* * 'None': Disables any form of highlight or selection.
* * 'Series': Highlights or selects an entire series of data points.
* * 'Point': Highlights or selects a single data point.
* * 'Cluster': Highlights or selects a group of data points that belong to the same cluster.
* * 'DragXY': Selects points by dragging with respect to both horizontal and vertical axes.
* * 'DragX': Selects points by dragging with respect to horizontal axis.
* * 'DragY': Selects points by dragging with respect to vertical axis.
* * 'Lasso': Selects points by dragging with respect to free form.
*
* @default None
*/
@Property('None')
public selectionMode: SelectionMode;
/**
* The `highlightMode` property determines how a series or individual data points are highlighted in the chart.
* The available options are:
* * 'None': Disables highlighting.
* * 'Series': Highlights an entire series of data points.
* * 'Point': Highlights a single data point.
* * 'Cluster': Highlights a group of data points that belong to the same cluster.
*
* @default None
*/
@Property('None')
public highlightMode: HighlightMode;
/**
* The `selectionPattern` property determines how the selected data points or series are visually represented.
* The available options are:
* * 'None': No selection pattern is applied.
* * 'Chessboard': Applies a chessboard pattern as the selection effect.
* * 'Dots': Applies a dot pattern as the selection effect.
* * 'DiagonalForward': Applies a forward diagonal line pattern as the selection effect.
* * 'Crosshatch': Applies a crosshatch pattern as the selection effect.
* * 'Pacman': Applies a Pacman pattern as the selection effect.
* * 'DiagonalBackward': Applies a backward diagonal line pattern as the selection effect.
* * 'Grid': Applies a grid pattern as the selection effect.
* * 'Turquoise': Applies a turquoise pattern as the selection effect.
* * 'Star': Applies a star pattern as the selection effect.
* * 'Triangle': Applies a triangle pattern as the selection effect.
* * 'Circle': Applies a circle pattern as the selection effect.
* * 'Tile': Applies a tile pattern as the selection effect.
* * 'HorizontalDash': Applies a horizontal dash pattern as the selection effect.
* * 'VerticalDash': Applies a vertical dash pattern as the selection effect.
* * 'Rectangle': Applies a rectangle pattern as the selection effect.
* * 'Box': Applies a box pattern as the selection effect.
* * 'VerticalStripe': Applies a vertical stripe pattern as the selection effect.
* * 'HorizontalStripe': Applies a horizontal stripe pattern as the selection effect.
* * 'Bubble': Applies a bubble pattern as the selection effect.
*
* @default None
*/
@Property('None')
public selectionPattern: SelectionPattern;
/**
* The `highlightPattern` property determines how the data points or series are visually highlighted.
* The available options are:
* * 'None': No highlighting pattern.
* * 'Chessboard': Applies a chessboard pattern for highlighting.
* * 'Dots': Applies a dot pattern for highlighting.
* * 'DiagonalForward': Applies a forward diagonal line pattern for highlighting.
* * 'Crosshatch': Applies a crosshatch pattern for highlighting.
* * 'Pacman': Applies a Pacman pattern for highlighting.
* * 'DiagonalBackward': Applies a backward diagonal line pattern for highlighting.
* * 'Grid': Applies a grid pattern for highlighting.
* * 'Turquoise': Applies a turquoise pattern for highlighting.
* * 'Star': Applies a star pattern for highlighting.
* * 'Triangle': Applies a triangle pattern for highlighting.
* * 'Circle': Applies a circle pattern for highlighting.
* * 'Tile': Applies a tile pattern for highlighting.
* * 'HorizontalDash': Applies a horizontal dash pattern for highlighting.
* * 'VerticalDash': Applies a vertical dash pattern for highlighting.
* * 'Rectangle': Applies a rectangle pattern for highlighting.
* * 'Box': Applies a box pattern for highlighting.
* * 'VerticalStripe': Applies a vertical stripe pattern for highlighting.
* * 'HorizontalStripe': Applies a horizontal stripe pattern for highlighting.
* * 'Bubble': Applies a bubble pattern for highlighting.
*
* @default None
*/
@Property('None')
public highlightPattern: SelectionPattern;
/**
* When set to true, it allows selecting multiple data points, series, or clusters.
> Note that the `selectionMode` must be set to `Point`, `Series`, or `Cluster` for multi-selection to be enabled.
*
* @default false
*/
@Property(false)
public isMultiSelect: boolean;
/**
* If set to true, enables multi-drag selection in the chart.
* This feature allows selecting multiple data points by dragging a selection box.
> Note that the `selectionMode` to be set to `DragX`, `DragY`, or `DragXY` for this feature to work.
*
* @default false
*/
@Property(false)
public allowMultiSelection: boolean;
/**
* When set to true, it enables exporting the chart to various formats such as `JPEG`, `PNG`, `SVG`, `PDF`, `XLSX`, or `CSV`.
*
* @default true
*/
@Property(true)
public enableExport: boolean;
/**
* To enable export feature in blazor chart.
*
* @default false
*/
@Property(false)
public allowExport: boolean;
/**