forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AmCharts.d.ts
2558 lines (2430 loc) · 139 KB
/
AmCharts.d.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
// Type definitions for amCharts
// Project: http://www.amcharts.com/
// Definitions by: aleksey-bykov <https://github.com/aleksey-bykov>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// AmCharts object (it's not a class) is create automatically when amcharts.js or amstock.js file is included in a web page.
declare module AmCharts {
/** Set it to true if you have base href set for your page. This will fix rendering problems in Firefox caused by base href. */
var baseHref: boolean;
/** Array of day names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] */
var dayNames: string[];
/** Array of month names, used when formatting dates (if categoryAxis.parseDates is set to true) ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] */
var monthNames: string[];
/** Array of short versions of day names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'] */
var shortDayNames: string[];
/** Array of short versions of month names, used when formatting dates (if categoryAxis.parseDates is set to true) ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] */
var shortMonthNames: string[];
/** Set it to true if you want UTC time to be used instead of local time. */
var useUTC: boolean;
/** Clears all the charts on page, removes listeners and intervals. */
function clear();
/** AmPieChart class creates pie/donut chart. In order to display pie chart you need to set at least three properties - dataProvider, titleField and valueField.
@example
var chartData = [{title:"Pie I have eaten",value:70},{title:"Pie I haven\'t eaten",value:30}];
var chart = new AmCharts.AmPieChart();
chart.valueField = "value";
chart.titleField = "title";
chart.dataProvider = chartData;
chart.write("chartdiv");
*/
class AmPieChart {
/** Name of the field in chart's dataProvider which holds slice's alpha. */
alphaField: string;
/** Pie lean angle (for 3D effect). Valid range is 0 - 90. */
angle: number;
/** Balloon text. The following tags can be used: [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]% ([[value]])\n[[description]] */
balloonText: string;
/** Read-only. Array of Slice objects. */
chartData: any[];
/** Name of the field in chart's dataProvider which holds slice's color. */
colorField: string;
/** Specifies the colors of the slices, if the slice color is not set. If there are more slices than colors in this array, the chart picks random color. ["#FF0F00", "#FF6600", "#FF9E01", "#FCD202", "#F8FF01", "#B0DE09", "#04D215", "#0D8ECF", "#0D52D1", "#2A0CD0", "#8A0CCF", "#CD0D74", "#754DEB", "#DDDDDD", "#999999", "#333333", "#000000", "#57032A", "#CA9726", "#990000", "#4B0C25"] */
colors: any[];
/** Depth of the pie (for 3D effect). */
depth3D: number;
/** Name of the field in chart's dataProvider which holds a string with description. */
descriptionField: string;
/** Example: [-0.2,0.2]. Will make slices to be filled with color gradients. */
gradientRatio: number[];
/** Opacity of the group slice. Value range is 0 - 1.
@default 1
*/
groupedAlpha: number;
/** Color of the group slice. The default value is not set - this means the next available color from "colors" array will be used. */
groupedColor: string;
/** Description of the group slice. */
groupedDescription: string;
/** If this is set to true, the group slice will be pulled out when the chart loads. */
groupedPulled: boolean;
/** Title of the group slice. Other */
groupedTitle: string;
/** If there is more than one slice whose percentage of the pie is less than this number, those slices will be grouped together into one slice. This is the "other" slice. It will always be the last slice in a pie. */
groupPercent: number;
/** Slices with percent less then hideLabelsPercent won't display labels This is useful to avoid cluttering up the chart, if you have a lot of small slices. 0 means all labels will be shown. */
hideLabelsPercent: number;
/** Opacity of a hovered slice. Value range is 0 - 1.
@default 1
*/
hoverAlpha: number;
/** Inner radius of the pie, in pixels or percents. */
innerRadius: any;
/** The distance between the label and the slice, in pixels. You can use negative values to put the label on the slice.
@default 30
*/
labelRadius: number;
/** Name of the field in dataProvider which specifies the length of a tick. Note, the chart will not try to arrange labels automatically if this property is set. */
labelRadiusField: string;
/** Specifies whether data labels are visible.
@default true
*/
labelsEnabled: boolean;
/** Label text. The following tags can be used: [[value]], [[title]], [[percents]], [[description]]. [[title]]: [[percents]]% */
labelText: string;
/** Label tick opacity. Value range is 0 - 1. 0.2 */
labelTickAlpha: number;
/** Label tick color. #000000 */
labelTickColor: string;
/** Bottom margin of the chart.
@default 5
*/
marginBottom: number;
/** Left margin of the chart. */
marginLeft: number;
/** Right margin of the chart. */
marginRight: number;
/** Top margin of the chart.
@default 5
*/
marginTop: number;
/** Minimum radius of the pie, in pixels.
@default 10
*/
minRadius: number;
/** Pie outline opacity. Value range is 0 - 1. */
outlineAlpha: number;
/** Pie outline color. #FFFFFF */
outlineColor: string;
/** Pie outline thickness.
@default 1
*/
outlineThickness: number;
/** Opacity of the slices. You can set the opacity of individual slice too.
@default 1
*/
pieAlpha: number;
/** Color of the first slice. All the other will be colored with darker or brighter colors. */
pieBaseColor: string;
/** Lightness increase of each subsequent slice. This is only useful if pieBaseColor is set. Use negative values for darker colors. Value range is from -255 to 255.
@default 30*/
pieBrightnessStep: number;
/** You can set fixed position of a pie center, in pixels or in percents. */
pieX: any;
/** You can set fixed position of a pie center, in pixels or in percents. */
pieY: any;
/** Name of the field in chart's dataProvider which holds a boolean value telling the chart whether this slice must be pulled or not. */
pulledField: string;
/** Pull out duration, in seconds.
@default 1
*/
pullOutDuration: number;
/** Pull out effect. Possible values are ">", "<", elastic" and "bounce". bounce */
pullOutEffect: string;
/** If this is set to true, only one slice can be pulled out at a time. If the viewer clicks on a slice, any other pulled-out slice will be pulled in. */
pullOutOnlyOne: boolean;
/** Pull out radius, in pixels or percents 0.2 */
pullOutRadius: any;
/** Radius of a pie, in pixels or percents. By default, radius is calculated automatically. */
radius: any;
/** Specifies whether the animation should be sequenced or all slices should appear at once. */
sequencedAnimation: boolean;
/** Initial opacity of all slices. If you set startDuration higher than 0, slices will fade in from startAlpha.
@default 1
*/
startAlpha: number;
/** Angle of the first slice, in degrees. This will work properly only if "depth3D" is set to 0. If "depth3D" is greater than 0, then there can be two angles only: 90 and 270. Value range is 0-360.
@default 90
*/
startAngle: number;
/** Duration of the animation, in seconds.
@default 1
*/
startDuration: number;
/** Animation effect. Possible values are ">", "<", "elastic" and "bounce". bounce */
startEffect: string;
/** Radius of the positions from which the slices will fly in.
default 5
*/
startRadius: any;
/** Name of the field in chart's dataProvider which holds slice's title. */
titleField: string;
/** Name of the field in chart's dataProvider which holds url which would be accessed if the user clicks on a slice. */
urlField: string;
/** If url is specified for a slice, it will be opened when user clicks on it. urlTarget specifies target of this url. Use _blank if you want url to be opened in a new window. _self */
urlTarget: string;
/** Name of the field in chart's dataProvider which holds slice's value. */
valueField: string;
/** Name of the field in chart's dataProvider which holds boolean variable defining whether this data item should have an entry in the legend. */
visibleInLegendField: string;
/** You can trigger the animation of the pie chart. */
animateAgain();
/** You can trigger the click on a slice from outside. index - the number of a slice or Slice object. */
clickSlice(index: number);
/** Hides slice. index - the number of a slice or Slice object. */
hideSlice(index: number);
/** You can simulate roll-out of a slice from outside. index - the number of a slice or Slice object. */
rollOutSlice(index: number);
/** You can simulate roll-over a slice from outside. index - the number of a slice or Slice object. */
rollOverSlice(index: number);
/** Shows slice. index - the number of a slice or Slice object. */
showSlice(index: number);
/** Adds event listener of the type "clickSlice" or "pullInSlice" or "pullOutSlice" to the object.
@param type Always "clickSlice" or "pullInSlice" or "pullOutSlice".
@param handler
If the type is "clickSlice", dispatched when user clicks on a slice.
If the type is "pullInSlice", dispatched when user clicks on a slice and the slice is pulled-in.
If the type is "pullOutSlice", dispatched when user clicks on a slice and the slice is pulled-out.
If the type is "rollOutSlice", dispatched when user rolls-out of the slice.
If the type is "rollOverSlice", dispatched when user rolls-over the slice.
*/
addListener(type: string, handler: (e: {/** Always "rollOverSlice". */
type: string; dataItem: Slice;
}) => void );
}
/** AmRadarChart is the class you have to use for radar and polar chart types.
@example
var chart;
var chartData = [
{country:"Czech Republic",litres:156.90},
{country:"Ireland",litres:131.10},
{country:"Germany",litres:115.80},
{country:"Australia",litres:109.90},
{country:"Austria",litres:108.30},
{country:"UK",litres:99.00}
];
window.onload = function() {
chart = new AmCharts.AmRadarChart();
chart.dataProvider = chartData;
chart.categoryField = "country";
chart.startDuration = 2;
var valueAxis = new AmCharts.ValueAxis();
valueAxis.axisAlpha = 0.15;
valueAxis.minimum = 0;
valueAxis.dashLength = 3;
valueAxis.axisTitleOffset = 20;
valueAxis.gridCount = 5;
chart.addValueAxis(valueAxis);
var graph = new AmCharts.AmGraph();
graph.valueField = "litres";
graph.bullet = "round";
graph.balloonText = "[[value]] litres of beer per year"
chart.addGraph(graph);
chart.write("chartdiv");
}
*/
class AmRadarChart extends AmCoordinateChart {
/** Bottom margin of the chart. */
marginBottom: number;
/** Left margin of the chart. */
marginLeft: number;
/** Right margin of the chart. */
marginRight: number;
/** Top margin of the chart. */
marginTop: number;
/** Radius of a radar. 0.35 */
radius: any;
}
/** AmXYChart is the class you have to use for XY/Bubble/Scatter chart types. The chart supports simple and logarithmic scales, it can have multiple value axes.
@example
var chartData = [
{x:10, y:14, value:59},
{x:5, y:3, value:50},
{x:-10, y:-3, value:19},
{x:-6, y:5, value:65},
{x:15, y:-4, value:92},
{x:13, y:1, value:8},
{x:1, y:6, value:35}
];
var chart = new AmCharts.AmXYChart();
chart.pathToImages = "../../amcharts/javascript/images/";
chart.dataProvider = chartData;
chart.marginLeft = 35;
chart.startDuration = 1.5;
var xAxis = new AmCharts.ValueAxis();
xAxis.position = "left";
xAxis.autoGridCount = true;
chart.addValueAxis(xAxis);
var yAxis = new AmCharts.ValueAxis();
yAxis.position = "bottom";
yAxis.autoGridCount = true;
chart.addValueAxis(yAxis);
var graph = new AmCharts.AmGraph();
graph.valueField = "value";
graph.xField = "x";
graph.yField = "y";
graph.lineAlpha = 0;
graph.bullet = "round";
chart.addGraph(graph);
var chartCursor = new AmCharts.ChartCursor();
chart.addChartCursor(chartCursor);
var chartScrollbar = new AmCharts.ChartScrollbar();
chartScrollbar.hideResizeGrips = false;
chart.addChartScrollbar(chartScrollbar);
chart.write("chartdiv);
*/
class AmXYChart extends AmRectangularChart {
/** Specifies if Scrollbar of X axis (horizontal) should be hidden. */
hideXScrollbar: boolean;
/** Specifies if Scrollbar of Y axis (vertical) should be hidden. */
hideYScrollbar: boolean;
/** Maximum zoom factor of the chart.
@default 20
*/
maxZoomFactor: number;
/** Zooms out, charts shows all available data.*/
zoomOut();
}
/** Guides are straight vertical or horizontal lines or areas supported by AmSerialChart, AmXYChart and AmRadarChart. You can have guides both on value and category axes. To add/remove a guide to an axis, use axis.addGuide(guide)/axis.removeGuide(guide) methods.
If you do not set properties such as dashLength, lineAlpha, lineColor, etc - values of the axis are used.*/
class Guide {
/** If you set it to true, the guide will be displayed above the graphs. */
above: boolean;
/** Radar chart only. Specifies angle at which guide should start. Affects only fills, not lines. */
angle: number;
/** Baloon fill color. */
balloonColor: string;
/** The text which will be displayed if the user rolls-over the guide. */
balloonText: string;
/** Specifies if label should be bold or not. */
boldLabel: boolean;
/** Category of the guide (in case the guide is for category axis). */
category: string;
/** Dash length. */
dashLength: number;
/** Date of the guide (in case the guide is for category axis and parseDates is set to true). */
date: Date;
/** Works if a guide is added to CategoryAxis and this axis is non-date-based. If you set it to true, the guide will start (or be placed, if it's not a fill) on the beginning of the category cell and will end at the end of toCategory cell. */
expand: boolean;
/** Fill opacity. Value range is 0 - 1. */
fillAlpha: number;
/** Fill color. */
fillColor: string;
/** Font size of guide label. */
fontSize: string;
/** Unique id of a Guide. You don't need to set it, unless you want to. */
id: string;
/** Specifies whether label should be placed inside or outside plot area. */
inside: boolean;
/** The label which will be displayed near the guide. */
label: string;
/** Rotation angle of a guide label. */
labelRotation: number;
/** Line opacity. */
lineAlpha: number;
/** Line color. */
lineColor: string;
/** Line thickness. */
lineThickness: number;
/** Position of guide label. Possible values are "left" or "right" for horizontal axis and "top" or "bottom" for vertical axis. */
position: string;
/** Tick length. */
tickLength: number;
/** Radar chart only. Specifies angle at which guide should end. Affects only fills, not lines. */
toAngle: number;
/** To category of the guide (in case the guide is for category axis). */
toCategory: string;
/** To date of the guide (in case the guide is for category axis and parseDates is set to true) If you have both date and toDate, the space between these two dates can be filled with color. */
toDate: Date;
/** To value of the guide (in case the guide is for value axis). */
toValue: number;
/** Value of the guide (in case the guide is for value axis). */
value: number;
/** Value axis of a guide. As you can add guides directly to the chart, you might need to specify which which value axis should be used. */
valueAxis: ValueAxis;
}
/** ImagesSettings is a class which holds common settings of all MapImage objects. */
class ImagesSettings {
/** Opacity of the image.
@default 1
*/
alpha: number;
/** Text which is displayed in a roll-over balloon. You can use the following tags: [[title]], [[description]], [[value]] and [[percent]]. [[title]] */
balloonText: string;
/** Specifies if the image's center should be placed in the provided coordinates. If false, top-left corner will be at provided coordinates.
@default true
*/
centered: boolean;
/** Color of image. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. #000000 */
color: string;
/** Height of a description window. */
descriptionWindowHeight: number;
/** Width of a description window.
@default 250
*/
descriptionWindowWidth: number;
/** X position of a description window. */
descriptionWindowX: number;
/** Y position of a description window. */
descriptionWindowY: number;
/** Label color. #000000 */
labelColor: string;
/** Font size of a label.
@default 11
*/
labelfontSize: string;
/** Position of the label. Allowed values are: left, right, top, bottom and middle. right */
labelPosition: string;
/** Label roll-over color. #00CC00 */
labelRollOverColor: string;
/** Opacity of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. */
outlineAlpha: number;
/** Color of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. */
outlineColor: string;
/** Thickness of image outline. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images.
@default 1
*/
outlineThickness: number;
/** Color of image when hovered. This will affect only predefined images (with "type" property set) and images with svgPath set. This property won't affect bitmap images and loaded SVG images. */
rollOverColor: string;
/** Scale of the image when hovered. Use value like 1.5 - 2 to enlarge image when user rolls-over it.
@default 1
*/
rollOverScale: number;
/** Scale of the image if it is selected. Use value like 1.5 - 2 to enlarge selected image.
@default 1
*/
selectedScale: number;
}
/** AreasSettings is a class which holds common settings of all MapArea objects. */
class AreasSettings {
/** Opacity of areas.
@default 1
*/
alpha: number;
/** Specifies if the areas should be zoomed-in when user clicks on them, event if zoom properties are not set. */
autoZoom: boolean;
/** Text which is displayed in a roll-over balloon. You can use the following tags: [[title]], [[description]], [[value]] and [[percent]] [[title]] */
balloonText: string;
/** Color of the areas. #FFCC00 */
color: string;
/** Color of area with highest value. Colors for areas with values less then highest will be colored with intermediate colors between color and colorSolid. Use colorSteps property of AmMap to change the number of intermediate colors. #990000 */
colorSolid: string;
/** Height of a description window. */
descriptionWindowHeight: number;
/** Width of a description window.
@default 250
*/
descriptionWindowWidth: number;
/** X position of a description window. */
descriptionWindowX: number;
/** Y position of a description window. */
descriptionWindowY: number;
/** Opacity of area's outline.
@default 1
*/
outlineAlpha: number;
/** Color of area's outline. #FFFFFF */
outlineColor: string;
/** Thickness of area's outline. 0.5 */
outlineThickness: number;
/** Color of area when user rolls-over it. undefined */
rollOverColor: string;
/** Color of area's outline when user rolls-over it. #CC0000 */
rollOverOutlineColor: string;
/** Color of area which is currently selected. #CC0000 */
selectedColor: string;
/** Opacity of all areas which are in the map svg file, but not listed as areas in DataSet.
@default 1
*/
unlistedAreasAlpha: number;
/** Color of all areas which are in the map svg file, but not listed as areas in DataSet. #DDDDDD */
unlistedAreasColor: string;
/** Opacity of all areas' outline which are in the map svg file, but not listed as areas in DataSet.
@default 1
*/
unlistedAreasOutlineAlpha: number;
/** Color of all areas' outline which are in the map svg file, but not listed as areas in DataSet. #FFFFFF */
unlistedAreasOutlineColor: string;
}
/** Slice is an item of AmPieChart's chartData Array and holds all the information about the slice. When working with a pie chart, you do not create slices or change it's properties directly, instead you set array of data using dataProvider property. Consider properties of a Slice read-only - change values in chart's data provider if you need to. */
class Slice {
/** Opacity of a slice. */
alpha: number;
/** Color of a slice. */
color: string;
/** Original object from data provider. */
dataContext: Object;
/** Slice description. */
description: string;
/** Specifies whether the slice is hidden */
hidden: boolean;
/** Percent value of a slice. */
percents: number;
/** Specifies whether the slice is pulled or not. */
pulled: boolean;
/** Slice title */
title: string;
/** Url of a slice */
url: string;
/** Value of a slice */
value: number;
/** specifies whether this slice has a legend entry */
visibleInLegend: boolean;
}
/** AmStockChart is a main class Stock chart. */
class AmStockChart {
/** Specifies if animation was already played. Animation is only played once, when chart is rendered for the first time. If you want the animation to be repeated, set this property to false. */
animationPlayed: boolean;
/** Balloon object. */
balloon: AmBalloon;
/** Settings for category axes. */
categoryAxesSettings: CategoryAxesSettings;
/** Indicates if the chart is created. */
chartCreated: boolean;
/** Chart cursor settings. */
chartCursorSettings: ChartCursorSettings;
/** Chart scrollbar settings. */
chartScrollbarSettings: ChartScrollbarSettings;
/** Array of colors used by data sets if no color was set explicitly on data set itself. #FF6600, "#FCD202", "#B0DE09", "#0D8ECF", "#2A0CD0", "#CD0D74", "#CC0000", "#00CC00", "#0000CC", "#DDDDDD", "#999999", "#333333", "#990000" */
colors: any[];
/** Array of data sets selected for comparing. */
comparedDataSets: any[];
/** Array of DataSets. */
dataSets: any[];
/** DataSetSelector object. You can add it if you have more than one data set and want users to be able to select/compare them. */
dataSetSelector: DataSetSelector;
/** Current end date of the selected period, get only. To set start/end dates, use stockChart.zoom(startDate, endDate) method. */
endDate: Date;
/** Defines on which day week starts. 0 - Sunday, 1 - Monday..
@default 1 */
firstDayOfWeek: number;
/** If set to true the scope of the data view will be set to the end after data update. */
glueToTheEnd: boolean;
/** Legend settings. */
legendSettings: LegendSettings;
/** Data set selected as main. */
mainDataSet: DataSet;
/** Array of StockPanels (charts). */
panels: any[];
/** Settings for stock panels. */
panelsSettings: PanelsSettings;
/** Period selector object. You can add it if you want user's to be able to enter date ranges or zoom chart with predefined period buttons. */
periodSelector: PeriodSelector;
/** Scrollbar's chart object, get only. */
scrollbarChart: AmSerialChart;
/** Current start date of the selected period, get only. To set start/end dates, use stockChart.zoom(startDate, endDate) method. */
startDate: Date;
/** Settings for stock events. */
stockEventsSettings: any;
/** Settings for value axes. */
valueAxesSettings: ValueAxesSettings;
/** read-only. Indicates current version of a script. */
version: string;
/** Specifies whether the chart should zoom-out when main data set is changed. */
zoomOutOnDataSetChange: boolean;
/** Adds panel to the stock chart. Requires stockChart.validateNow() method to be called after this action. */
addPanel(panel: StockPanel);
/** Adds panel to the stock chart at a specified index. Requires stockChart.validateNow() method to be called after this action. */
addPanelAt(panel: StockPanel, index: number);
/** Destroys chart, all timeouts and listeners. */
clear();
/** Hides event bullets. */
hideStockEvents();
/** Removes event listener from the object. */
removeListener(obj: any, type: string, handler: any);
/** Removes panel from the stock chart. Requires stockChart.validateNow() method to be called after this action. */
removePanel(panel: StockPanel);
/** Shows event bullets. */
showStockEvents();
/** Method which should be called after data was changed. */
validateData();
/** Method which forces the stock chart to rebuild. Should be called after properties are changed. */
validateNow();
/** Zooms chart to specified dates. startDate, endDate - Date objects. */
zoom(startDate: Date, endDate: Date);
/** Zooms out the chart. */
zoomOut();
/** Adds event listener of the type "dataUpdated" or "init" or "rendered" to the object.
@param type Always "dataUpdated" or "init" or "rendered".
@param handler
If the type is "dataUpdated", dispatched when the chart was updated with new data.
If the type is "init", dispatched when the chart is initialized for the first time. In case you want it to fire again after validateNow() method is called, set chart.chartCreated = false.
If the type is "rendered", dispatched each when chart is rendered.
*/
addListener(type: string, handler: (e: {
/** Either "dataUpdated" or "init". */
type: string;
chart: AmStockChart;
}) => void );
/** Adds event listener of the type "rollOutStockEvent" or "rollOverStockEvent" or "clickStockEvent" to the object.
@param type // Either "rollOutStockEvent" or "rollOverStockEvent" or "clickStockEvent".
@param handler
If the type is "rollOutStockEvent", dispatched when the user rolls-out of the Stock event (bullet).
If the type is "rollOverStockEvent", dispatched when the user rolls-over of the Stock event (bullet).
If the type is "clickStockEvent", dispatched when the user clicks on the Stock event (bullet).
*/
addListener(type: string, handler: (e: {
/** Always "rollOverStockEvent". */
type: string;
eventObject: any;
graph: AmGraph;
date: Date;
chart: AmStockChart;
}) => void );
/** Adds event listener of the type "zoomed" to the object.
@param type Always "zoomed".
@param handler Dispatched when the chart is zoomed (even for the first time, when chart is initialized).*/
addListener(type: string, handler: (e: {
/** Always "zoomed". */
type: string;
startDate: Date;
endDate: Date;
period: string;
chart: AmStockChart;
}) => void );
/** Adds event listener of the type "panelRemoved" to the object.
@param type Always "panelRemoved".
@param handler Dispatched when the StockPanel is removed.*/
addListener(type: string, handler: (e: {
/** Always "panelRemoved". */
type: string;
panel: StockPanel;
chart: AmStockChart;
}) => void );
/** Removes event listener from chart object. */
removeListener(chart: AmChart, type: string, handler: any);
}
/** ValueAxesSettings settings set 's settings for all ValueAxes. If you change a property after the chart is initialized, you should call stockChart.validateNow() method in order for it to work. If there is no default value specified, default value of ValueAxis class will be used. */
class ValueAxesSettings {
/** Specifies whether number for gridCount is specified automatically, according to the axis size.
@default true
*/
autoGridCount: boolean;
/** Axis opacity. */
axisAlpha: number;
/** Axis color. */
axisColor: string;
/** Thickness of the axis. */
axisThickness: number;
/** Label color. */
color: string;
/** Length of a dash. By default, the grid line is not dashed. */
dashLength: number;
/** Fill opacity. Every second space between grid lines can be filled with color. */
fillAlpha: number;
/** Fill color. Every second space between grid lines can be filled with color. Set fillAlpha to a value greater than 0 to see the fills. */
fillColor: string;
/** Opacity of grid lines. */
gridAlpha: number;
/** Color of grid lines. */
gridColor: string;
/** Approximate number of grid lines. autoGridCount should be set to false, otherwise this property will be ignored. */
gridCount: number;
/** Thickness of grid lines. */
gridThickness: number;
/** Specifies whether guide values should be included when calculating min and max of the axis. */
includeGuidesInMinMax: boolean;
/** If true, the axis will include hidden graphs when calculating min and max values. */
includeHidden: boolean;
/** Specifies whether values should be placed inside or outside plot area. In case you set this to false, you'll have to adjust marginLeft or marginRight in [[PanelsSettings]] in order labels to be visible.
@default true
*/
inside: boolean;
/** Specifies whether values on axis can only be integers or both integers and doubles. */
integersOnly: boolean;
/** Frequency at which labels should be placed. */
labelFrequency: number;
/** Specifies whether value labels are displayed. */
labelsEnabled: boolean;
/** Set to true if value axis is logarithmic, false otherwise. */
logarithmic: boolean;
/** The distance of the axis to the plot area, in pixels. Useful if you have more then one axis on the same side. */
offset: number;
/** Position of the value axis. Possible values are "left" and "right". */
position: string;
/** Set to true if value axis is reversed (smaller values on top), false otherwise. */
reversed: boolean;
/** Specifies if first label of value axis should be displayed. */
showFirstLabel: boolean;
/** Specifies if last label of value axis should be displayed. */
showLastLabel: boolean;
/** Stacking mode of the axis. Possible values are: "none", "regular", "100%", "3d". */
stackType: string;
/** Tick length. */
tickLength: number;
/** Unit which will be added to the value label. */
unit: string;
/** Position of the unit. Possible values are "left" or "right". */
unitPosition: string;
}
/** AmLegend is the class that displays legend of the chart. Legend to the chart should be added using chart.addLegend(legend) method.
@example
var chart = new AmCharts.AmSerialChart();
var legend = new AmCharts.AmLegend();
chart.addLegend(legend);
*/
class AmLegend {
/** Alignment of legend entries. Possible values are: "left", "center", "right". left */
align: string;
/** Used if chart is Serial or XY. In case true, margins of the legend are adjusted and made equal to chart's margins.
@default true
*/
autoMargins: boolean;
/** Opacity of legend's background. Value range is 0 - 1 */
backgroundAlpha: number;
/** Background color. You should set backgroundAlpha to >0 vallue in order background to be visible. #FFFFFF */
backgroundColor: string;
/** Opacity of chart's border. Value range is 0 - 1. */
borderAlpha: number;
/** Color of legend's border. You should set borderAlpha >0 in order border to be visible. #000000 */
borderColor: string;
/** In case legend position is set to "absolute", you can set distance from bottom of the chart, in pixels. */
bottom: number;
/** Text color. Will use chart's color if not set. */
color: string;
/** This can be used by AmMap only. You can pass array of objects with title, color, markerType values, for example: [{title: "One", color: "#3366CC"},{title: "Two", color: "#FFCC33"}] */
data: any[];
/** Specifies if each of legend entry should be equal to the most wide entry. Won't look good if legend has more than one line.
@default true
*/
equalWidths: boolean;
/** Font size. Will use chart's font size if not set. */
fontSize: string;
/** Horizontal space between legend item and left/right border. */
horizontalGap: number;
/** The text which will be displayed in the legend. Tag [[title]] will be replaced with the title of the graph. [[title]] */
labelText: string;
/** In case legend position is set to "absolute", you can set distance from left side of the chart, in pixels. */
left: number;
/** Bottom margin. */
marginBottom: number;
/** Left margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default).
@default 20
*/
marginLeft: number;
/** Right margin. This property will be ignored if chart is Serial or XY and autoMargins property of the legend is true (default).
@default 20
*/
marginRight: number;
/** Top margin. */
marginTop: number;
/** Marker border opacity 1. */
markerBorderAlpha: number;
/** Marker border color. If not set, will use the same color as marker. */
markerBorderColor: string;
/** Thickness of the legend border. The default value (0) means the line will be a "hairline" (1 px). In case marker type is line, this style will be used for line thickness.
@default 1
*/
markerBorderThickness: number;
/** The color of the disabled marker (when the graph is hidden). #AAB3B3 */
markerDisabledColor: string;
/** Space between legend marker and legend text, in pixels.
@default 5
*/
markerLabelGap: number;
/** Size of the legend marker (key).
@default 16
*/
markerSize: number;
/** Shape of the legend marker (key). Possible values are: "square", "circle", "line", "dashedLine", "triangleUp", "triangleDown", "bubble", "none". square */
markerType: string;
/** Maximum number of columns in the legend. If Legend's position is set to "right" or "left", maxColumns is automatically set to 1. */
maxColumns: number;
/** Position of a legend. Possible values are: "bottom", "top", "left", "right" and "absolute". In case "absolute", you should set left and top properties too. (this setting is ignored in Stock charts). In case legend is used with AmMap, position is set to "absolute" automatically. bottom */
position: string;
/** Specifies whether legend entries should be placed in reversed order. */
reversedOrder: boolean;
/** In case legend position is set to "absolute", you can set distance from right side of the chart, in pixels. */
right: number;
/** Legend item text color on roll-over. #CC0000 */
rollOverColor: string;
/** When you roll-over the legend entry, all other graphs can reduce their opacity, so that the graph you rolled-over would be distinguished. This style specifies the opacity of the graphs.
@default 1
*/
rollOverGraphAlpha: number;
/** You can use this property to turn all the legend entries off.
@default true
*/
showEntries: boolean;
/** Horizontal space between legend items, in pixels.
@default 10
*/
spacing: number;
/** Whether showing/hiding of graphs by clicking on the legend marker is enabled or not. In case legend is used with AmMap, this is set to false automatically.
@default true
*/
switchable: boolean;
/** Legend switch color. #FFFFFF */
switchColor: string;
/** Legend switch type (in case the legend is switchable). Possible values are "x" and "v". x */
switchType: string;
/** If true, clicking on the text will show/hide balloon of the graph. Otherwise it will show/hide graph/slice, if switchable is set to true. */
textClickEnabled: boolean;
/** In case legend position is set to "absolute", you can set distance from top of the chart, in pixels. */
top: number;
/** Specifies if legend labels should be use same color as corresponding markers. */
useMarkerColorForLabels: boolean;
/** Alignment of the value text. Possible values are "left" and "right". right */
valueAlign: string;
/** The text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. [[value]] */
valueText: string;
/** Width of the value text.
@default 80
*/
valueWidth: number;
/** Vertical space between legend items also between legend border and first and last legend row. 10 */
verticalGap: number;
/** Adds event listener of the type "clickLabel" or "clickMarker" or "hideItem" to the object.
@param type Either "clickLabel" or "clickMarker" or "hideItem".
@param handler
If the type is "clickLabel", dispatched when legend label is clicked.
If the type is "clickMarker", dispatched when legend marker is clicked.
If the type is "hideItem", dispatched when user clicks on a legend item marker and hides corresponding object.
If the type is "rollOutItem", dispatched when user rolls-out of the legend item label (or whole item, if switchable is set to false).
If the type if "rollOverItem", dispatched when user rolls-over the legend item label (or whole item, if switchable is set to false).
If the type is "rollOutMarker", dispatched when user clicks out of a legend item marker and shows corresponding object.
If the type if "rollOverMarker", dispatched when user clicks on a legend item marker and shows corresponding object.
*/
/** Adds event listener of the type "showItem" to the object.
@param type Always "showItem".
@param handler
*/
addListener(type: string, handler: (e: {/** Always "showItem". */
type: string; dataItem: Object; chart: AmChart;
}) => void );
/** Removes event listener from chart object. */
removeListener(chart: AmChart, type: string, handler: any);
}
/** StockLegend is a legend of StockPanel. */
class StockLegend extends AmLegend {
/** The text which will be displayed in the value portion of the legend when graph is comparable and at least one dataSet is selected for comparing. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents.value/open/close/low/high]], [[description]]. [[percents.value]]% */
valueTextComparing: string;
/** The text which will be displayed in the value portion of the legend. You can use tags like [[value]], [[open]], [[high]], [[low]], [[close]], [[percents]], [[description]]. [[value]] */
valueTextRegular: string;
}
/** StockPanel class creates stock panels (charts). AmStockChart can have multiple Stock panels. */
class StockPanel extends AmSerialChart {
/** Specifies whether x button will be displayed near the panel. This button allows turning panel off. */
allowTurningOff: boolean;
/** If true, drawing icons will be displayed in top-right corner. */
drawingIconsEnabled: boolean;
/** Specifies on which value axis user can draw trend lines. Set drawingIconsEnabled to true if you want drawing icons to be visible. First value axis will be used if not set here. */
drawOnAxis: ValueAxis;
/** Specifies if all trend lines should be erased when erase button is clicked. If false, trend lines can be erased one by one. */
eraseAll: boolean;
/** Size of trend line drawing icons. If you change this size, you should update icon images if you want them to look properly.
@default 18
*/
iconSize: number;
/** Relative height of panel. Possible values 0 - 100. */
percentHeight: number;
/** Specifies when values should be recalculated to percents. Possible values are: "never", "always", "whenComparing". whenComparing */
recalculateToPercents: string;
/** Specifies whether this panel will show category axis.
@default true
*/
showCategoryAxis: boolean;
/** */
stockGraphs: StockGraph[];
/** Stock chart legend. */
stockLegend: StockLegend;
/** Title of a panel. Note, StockLegend should be added in order title to be displayed. */
title: string;
/** Trend line opacity.
@default 1
*/
trendLineAlpha: number;
/** Trend line color. #00CC00 */
trendLineColor: string;
/** Trend line dash length. */
trendLineDashLength: number;
/** Trend line thickness.
@default 2
*/
trendLineThickness: number;
/** Adds a graph to the panel. */
addStockGraph(graph: StockGraph);
/** Removes graph from the panel. */
removeStockGraph(graph: StockGraph);
}
/** AmChart is a base class of all charts. It can not be instantiated explicitly. AmCoordinateChart, AmPieChart and AmMap extend AmChart class. */
class AmChart {
/** used when constructing a chart with a theme */
constructor(theme?: any);
/** Specifies, if class names should be added to chart elements. */
addClassNames: boolean;
/** Array of Labels. Example of label object, with all possible properties:
{"x": 20, "y": 20, "text": "this is label", "align": "left", "size": 12, "color": "#CC0000", "alpha": 1, "rotation": 0, "bold": true, "url": "http://www.amcharts.com"} */
allLabels: Label[];
/** Set this to false if you don't want chart to resize itself whenever its parent container size changes. */
autoResize: boolean;
/** Opacity of background. Set it to >0 value if you want backgroundColor to work. However we recommend changing div's background-color style for changing background color. */
backgroundAlpha: number;
/** Background color. You should set backgroundAlpha to >0 value in order background to be visible. We recommend setting background color directly on a chart's DIV instead of using this property. #FFFFFF */
backgroundColor: string;
/** The chart creates AmBalloon class itself. If you want to customize balloon, get balloon instance using this property, and then change balloon's properties. AmBalloon */
balloon: AmBalloon;
/** Opacity of chart's border. Value range is 0 - 1. */
borderAlpha: number;
/** Color of chart's border. You should set borderAlpha >0 in order border to be visible. We recommend setting border color directly on a chart's DIV instead of using this property. #000000 */
borderColor: string;
/** This prefix is added to all class names which are added to all visual elements of a chart in case addClassNames is set to true. */
classNamePrefix: string;
/** Text color. #000000 */
color: string;
/** Non-commercial version only. Specifies position of link to amCharts site. Allowed values are: top-left, top-right, bottom-left and bottom-right.
@default 'top-left'
*/
creditsPosition: string;
/** Array of data objects, for example: [{country:"US", value:524},{country:"UK", value:624},{country:"Lithuania", value:824}]. You can have any number of fields and use any field names. In case of AmMap, data provider should be MapData object. */
dataProvider: any[];
/** Decimal separator.
@Default . */
decimalSeparator: string;
/** Using this property you can add any additional information to SVG, like SVG filters or clip paths. The structure of this object should be identical to XML structure of a object you are adding, only in JSON format. */
defs: any;
/** Export config. Specifies how export to image/data export/print/annotate menu will look and behave. You can find a lot of examples in amcharts/plugins/export folder. */
export: ExportSettings;
/** Font family. Verdana */
fontFamily: string;
/** Font size.
@default 11
*/
fontSize: string;
/** If you set this to true, the lines of the chart will be distorted and will produce hand-drawn effect. Try to adjust chart.handDrawScatter and chart.handDrawThickness properties for a more scattered result.
@Default false
*/
handDrawn: boolean;
/** Defines by how many pixels hand-drawn line (when handDrawn is set to true) will fluctuate.
@Default 2
*/
handDrawScatter: number;
/** Defines by how many pixels line thickness will fluctuate (when handDrawn is set to true).
@Default 1
*/
handDrawThickness: number;
/** Time, in milliseconds after which balloon is hidden if the user rolls-out of the object. Might be useful for AmMap to avoid balloon flickering while moving mouse over the areas. Note, this is not duration of fade-out. Duration of fade-out is set in AmBalloon class.
@Default 150
*/
hideBalloonTime: number;
/** Legend of a chart. */
legend: AmLegend;
/** Reference to the div of the legend. */
legendDiv: HTMLElement;
/** You can add listeners of events using this property. Example: listeners = [{"event":"dataUpdated", "method":handleEvent}]; */
listerns: Object[];
/** This setting affects touch-screen devices only. If a chart is on a page, and panEventsEnabled are set to true, the page won't move if the user touches the chart first. If a chart is big enough and occupies all the screen of your touch device, the user won’t be able to move the page at all. That's why the default value is "false". If you think that selecting/panning the chart or moving/pinching the map is a primary purpose of your users, you should set panEventsEnabled to true. */
panEventsEnabled: boolean;
/** Specifies absolute or relative path to amCharts files, i.e. "amcharts/". (where all .js files are located)
If relative URLs are used, they will be relative to the current web page, displaying the chart.
You can also set path globally, using global JavaScript variable AmCharts_path. If this variable is set, and "path" is not set in chart config, the chart will assume the path from the global variable. This allows setting amCharts path globally. I.e.:
var AmCharts_path = "/libs/amcharts/";
"path" parameter will be used by the charts to locate it's files, like images, plugins or patterns.*/
path: string;
/** Specifies path to the folder where images like resize grips, lens and similar are.
IMPORTANT: Since V3.14.12, you should use "path" to point to amCharts directory instead. The "pathToImages" will be automatically set and does not need to be in the chart config, unless you keep your images separately from other amCharts files. */
pathToImages: string;
/** Precision of percent values. -1 means percent values won't be rounded at all and show as they are.
@default 2
*/
percentPrecision: number;
/** Precision of values. -1 means values won't be rounded at all and show as they are.
@Default 1*/
precision: number;
/** Prefixes which are used to make big numbers shorter: 2M instead of 2000000, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e+3,prefix:"k"},{number:1e+6,prefix:"M"},{number:1e+9,prefix:"G"},{number:1e+12,prefix:"T"},{number:1e+15,prefix:"P"},{number:1e+18,prefix:"E"},{number:1e+21,prefix:"Z"},{number:1e+24,prefix:"Y"}] */
prefixesOfBigNumbers: any[];
/** Prefixes which are used to make small numbers shorter: 2μ instead of 0.000002, etc. Prefixes are used on value axes and in the legend. To enable prefixes, set usePrefixes property to true. [{number:1e-24, prefix:"y"},{number:1e-21, prefix:"z"},{number:1e-18, prefix:"a"},{number:1e-15, prefix:"f"},{number:1e-12, prefix:"p"},{number:1e-9, prefix:"n"},{number:1e-6, prefix:"μ"},{number:1e-3, prefix:"m"}] */
prefixesOfSmallNumbers: any[];
/** Theme of a chart. Config files of themes can be found in amcharts/themes/ folder. More info about using themes. */
theme: string;
/** Thousands separator.
@default .
*/
thousandsSeparator: string;
/** Array of Title objects. */
titles: Title[];
/** Type of a chart. Required when creating chart using JSON. Possible types are: serial, pie, xy, radar, funnel, gauge, map, stock. */
type: string;
/** If true, prefixes will be used for big and small numbers. You can set arrays of prefixes via prefixesOfSmallNumbers and prefixesOfBigNumbers properties. */
usePrefixes: boolean;
/** Read-only. Indicates current version of a script. */