@barchart/chart-lib 2.81.1 → 2.183.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- chart-lib/AMZN_Daily.json +6042 -0
- chart-lib/AMZN_Events.json +462 -0
- {package → chart-lib}/README.md +9 -15
- {package → chart-lib}/barchart.chart.d.ts +233 -33
- chart-lib/barchart.chart.js +2 -0
- chart-lib/chart.def.json +132 -0
- chart-lib/index.html +20 -0
- chart-lib/index.js +195 -0
- {package → chart-lib}/package.json +8 -2
- chart-lib/style.css +171 -0
- package/barchart.chart.js +0 -15
|
@@ -16,6 +16,20 @@ declare module "@barchart/chart-lib" {
|
|
|
16
16
|
*/
|
|
17
17
|
export function formatPriceWithDecimals(price: number, decimals: number): string;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* Helps if you need to know whether there's open interest for a symbol
|
|
21
|
+
* @param symbol A symbol name
|
|
22
|
+
* @returns True if the symbol has open interest
|
|
23
|
+
*/
|
|
24
|
+
export function hasOpenInterest(symbol: string): boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param symbols An array of symbol names
|
|
29
|
+
* @returns {MetaData} A combination of sorts of the individual `MetaData` for each of the symbols; for example, if you had an expression involving 3 symbols the combined `MetaData` would have max decimals of all the symbols involved.
|
|
30
|
+
*/
|
|
31
|
+
export function getCombinedMetaData(symbols: string[]): MetaData;
|
|
32
|
+
|
|
19
33
|
export type FundamentalType =
|
|
20
34
|
| "AccountsPayable"
|
|
21
35
|
| "AccruedExpenses"
|
|
@@ -114,6 +128,18 @@ declare module "@barchart/chart-lib" {
|
|
|
114
128
|
|
|
115
129
|
export type StudyFieldId =
|
|
116
130
|
| "MA"
|
|
131
|
+
| "MA1"
|
|
132
|
+
| "MA2"
|
|
133
|
+
| "MA3"
|
|
134
|
+
| "MA4"
|
|
135
|
+
| "MA5"
|
|
136
|
+
| "MA6"
|
|
137
|
+
| "MA7"
|
|
138
|
+
| "MA8"
|
|
139
|
+
| "MA9"
|
|
140
|
+
| "MA10"
|
|
141
|
+
| "MAS"
|
|
142
|
+
| "MAL"
|
|
117
143
|
| "EMA"
|
|
118
144
|
| "MAHI"
|
|
119
145
|
| "MALO"
|
|
@@ -243,7 +269,7 @@ declare module "@barchart/chart-lib" {
|
|
|
243
269
|
| "TR"
|
|
244
270
|
| "IMPVOL"
|
|
245
271
|
| "CTM"
|
|
246
|
-
| "
|
|
272
|
+
| "CPMI"
|
|
247
273
|
| "CTLTM"
|
|
248
274
|
| "CTLTMF"
|
|
249
275
|
| "DEMA"
|
|
@@ -283,7 +309,7 @@ declare module "@barchart/chart-lib" {
|
|
|
283
309
|
| "LINRLOW"
|
|
284
310
|
| "CSHO"
|
|
285
311
|
| "CSHB"
|
|
286
|
-
| "
|
|
312
|
+
| "CTPI"
|
|
287
313
|
| "TCHRE"
|
|
288
314
|
| "PCTCHG"
|
|
289
315
|
| "ATRMA"
|
|
@@ -293,12 +319,34 @@ declare module "@barchart/chart-lib" {
|
|
|
293
319
|
| "VSTOPLOW"
|
|
294
320
|
| "SUPTR"
|
|
295
321
|
| "BARCOLIX"
|
|
322
|
+
| "BARKIND"
|
|
296
323
|
| "CONVLN"
|
|
297
324
|
| "BASELN"
|
|
298
325
|
| "LEADSP1"
|
|
299
326
|
| "LEADSP2"
|
|
300
327
|
| "LAGGSP"
|
|
301
|
-
| "VWAP"
|
|
328
|
+
| "VWAP"
|
|
329
|
+
| "VWAPSD1U"
|
|
330
|
+
| "VWAPSD1L"
|
|
331
|
+
| "VWAPSD2U"
|
|
332
|
+
| "VWAPSD2L"
|
|
333
|
+
| "PLVI"
|
|
334
|
+
| "MNVI"
|
|
335
|
+
| "DIFA"
|
|
336
|
+
| "DOSCH"
|
|
337
|
+
| "DOSCS"
|
|
338
|
+
| "BOLLSQ"
|
|
339
|
+
| "TTMSQZON"
|
|
340
|
+
| "TTMSQZOFF"
|
|
341
|
+
| "TTMSQZOSC"
|
|
342
|
+
| "CRS"
|
|
343
|
+
| "CRSAVG"
|
|
344
|
+
| "JPIB"
|
|
345
|
+
| "JPIS"
|
|
346
|
+
| "DRS"
|
|
347
|
+
| "MRS"
|
|
348
|
+
| "PMO"
|
|
349
|
+
| "PMOS";
|
|
302
350
|
|
|
303
351
|
export type GeneralFieldId =
|
|
304
352
|
| "DateTime"
|
|
@@ -328,6 +376,8 @@ declare module "@barchart/chart-lib" {
|
|
|
328
376
|
|
|
329
377
|
export type StudyId =
|
|
330
378
|
| "MA"
|
|
379
|
+
| "MACDSIG"
|
|
380
|
+
| "MASIG"
|
|
331
381
|
| "MAEXP"
|
|
332
382
|
| "MAHLC"
|
|
333
383
|
| "MACD"
|
|
@@ -353,6 +403,7 @@ declare module "@barchart/chart-lib" {
|
|
|
353
403
|
| "BBANDS"
|
|
354
404
|
| "BWIDTH"
|
|
355
405
|
| "BPERC"
|
|
406
|
+
| "BSQUEEZE"
|
|
356
407
|
| "OBVOL"
|
|
357
408
|
| "ATR"
|
|
358
409
|
| "ADX"
|
|
@@ -406,7 +457,7 @@ declare module "@barchart/chart-lib" {
|
|
|
406
457
|
| "PIVPTS"
|
|
407
458
|
| "IMPVOL"
|
|
408
459
|
| "CTM"
|
|
409
|
-
| "
|
|
460
|
+
| "CPMI"
|
|
410
461
|
| "DEMA"
|
|
411
462
|
| "TEMA"
|
|
412
463
|
| "TSI"
|
|
@@ -422,7 +473,7 @@ declare module "@barchart/chart-lib" {
|
|
|
422
473
|
| "LINRCHN"
|
|
423
474
|
| "CSHO"
|
|
424
475
|
| "CSHB"
|
|
425
|
-
| "
|
|
476
|
+
| "CTPI"
|
|
426
477
|
| "TCHRE"
|
|
427
478
|
| "PCTCHG"
|
|
428
479
|
| "OPINT"
|
|
@@ -431,7 +482,19 @@ declare module "@barchart/chart-lib" {
|
|
|
431
482
|
| "VSTOP"
|
|
432
483
|
| "SUPTR"
|
|
433
484
|
| "ICHCLD"
|
|
434
|
-
| "VWAP"
|
|
485
|
+
| "VWAP"
|
|
486
|
+
| "VOIN"
|
|
487
|
+
| "DIFA"
|
|
488
|
+
| "DOSC"
|
|
489
|
+
| "MARIB"
|
|
490
|
+
| "HASMO"
|
|
491
|
+
| "TTMSQZ"
|
|
492
|
+
| "CRS"
|
|
493
|
+
| "JPI"
|
|
494
|
+
| "CTTP"
|
|
495
|
+
| "DRS"
|
|
496
|
+
| "MRS"
|
|
497
|
+
| "PMO";
|
|
435
498
|
|
|
436
499
|
type PlotType =
|
|
437
500
|
| "Symbol"
|
|
@@ -644,6 +707,10 @@ declare module "@barchart/chart-lib" {
|
|
|
644
707
|
annotationTraits?: AnnotationTraitsModel;
|
|
645
708
|
/** Obsolete, please ignore. */
|
|
646
709
|
curveTraits?: any[];
|
|
710
|
+
/** Will be `true` when all annotations are not supposed to move; their other properties, like line width, fill color etc. can still be changed.
|
|
711
|
+
* @default false
|
|
712
|
+
*/
|
|
713
|
+
allAnnotationsLocked: boolean;
|
|
647
714
|
};
|
|
648
715
|
|
|
649
716
|
export type AnnotationModel = {
|
|
@@ -715,8 +782,11 @@ declare module "@barchart/chart-lib" {
|
|
|
715
782
|
CH_CHTNEEDSCONTEXTMENU: string;
|
|
716
783
|
CH_ANNSELECTIONCHANGED: string;
|
|
717
784
|
CH_ANNPOINTPICKED: string;
|
|
785
|
+
CH_ANNMODIFIEDBYTOOL: string;
|
|
718
786
|
CH_PANEHEIGHTSCHANGED: string;
|
|
719
787
|
CH_PANESREORDERED: string;
|
|
788
|
+
CH_AXISSCALECHANGED: string;
|
|
789
|
+
CH_CHTLAYOUTCHANGED: string;
|
|
720
790
|
CH_NODATAFORMAINSYMBOL: string;
|
|
721
791
|
CH_CARDPLOTCLICKED: string;
|
|
722
792
|
CH_CARDPLOTREMOVED: string;
|
|
@@ -726,13 +796,15 @@ declare module "@barchart/chart-lib" {
|
|
|
726
796
|
CH_ZOOMCHANGED: string;
|
|
727
797
|
CH_ALL_DATA_PROJECTED: string;
|
|
728
798
|
CH_API_ACTIONS_RECEIVED: string;
|
|
799
|
+
DF_ALL: string;
|
|
800
|
+
DF_STREAMRECONNECTED: string;
|
|
729
801
|
TS_ALL: string;
|
|
730
802
|
TS_LOADING: string;
|
|
731
803
|
TS_MANYCHANGED: string;
|
|
732
804
|
TS_DATAPOINTADDED: string;
|
|
733
805
|
TS_DATAPOINTCHANGED: string;
|
|
806
|
+
TS_TIMELINECORRECTION: string;
|
|
734
807
|
TS_EVENTSCHANGED: string;
|
|
735
|
-
TS_LAST_POINT_UPDATED: string;
|
|
736
808
|
MD_ALL: string;
|
|
737
809
|
MD_CHANGED: string;
|
|
738
810
|
RT_ALL: string;
|
|
@@ -770,6 +842,7 @@ declare module "@barchart/chart-lib" {
|
|
|
770
842
|
typeName: string;
|
|
771
843
|
name: string;
|
|
772
844
|
description?: string;
|
|
845
|
+
exchange?: string;
|
|
773
846
|
error?: string;
|
|
774
847
|
id: string;
|
|
775
848
|
events: {
|
|
@@ -795,7 +868,14 @@ declare module "@barchart/chart-lib" {
|
|
|
795
868
|
|
|
796
869
|
const Topics: ITopics;
|
|
797
870
|
|
|
798
|
-
export type FeedMode =
|
|
871
|
+
export type FeedMode =
|
|
872
|
+
| "Unspecified"
|
|
873
|
+
| "GBE"
|
|
874
|
+
| "cmdtyView"
|
|
875
|
+
| "DemoSite"
|
|
876
|
+
| "InternalFeed"
|
|
877
|
+
| "Widget"
|
|
878
|
+
| "FreeWidget";
|
|
799
879
|
|
|
800
880
|
type BaseUrl = {
|
|
801
881
|
instruments: string;
|
|
@@ -843,8 +923,20 @@ declare module "@barchart/chart-lib" {
|
|
|
843
923
|
|
|
844
924
|
type HostingModel = "Page" | "Application";
|
|
845
925
|
|
|
926
|
+
type Environment = "Browser" | "NodeJs";
|
|
927
|
+
|
|
928
|
+
/**
|
|
929
|
+
* How should volume bars be colored:
|
|
930
|
+
* - `OpenToClose` same as main plot with `CurveAttribute` set to `OpenVsClose`
|
|
931
|
+
* - `CloseToClose` same as main plot with `CurveAttribute` set to `ChangeBased`
|
|
932
|
+
*
|
|
933
|
+
* By default, this is unset and the volume coloring will be identical to the main plot's bar coloring. This value will only be used when the main plot does _not_ have any bar coloring set (for example, when the main plot is a line or an area plot).
|
|
934
|
+
*/
|
|
935
|
+
export type DefaultVolumeBarColoring = "OpenToClose" | "CloseToClose";
|
|
936
|
+
|
|
846
937
|
/** The configuration is extensively documented at our documentation site. */
|
|
847
938
|
interface Config {
|
|
939
|
+
environment?: Environment;
|
|
848
940
|
validateInput?: boolean;
|
|
849
941
|
throttleMillis?: number;
|
|
850
942
|
isAlt64?: boolean;
|
|
@@ -864,9 +956,13 @@ declare module "@barchart/chart-lib" {
|
|
|
864
956
|
baseUrl?: BaseUrl;
|
|
865
957
|
overrides?: Overrides;
|
|
866
958
|
noDataText?: string;
|
|
959
|
+
useAllFieldsForComparison?: boolean;
|
|
867
960
|
credentials?: ICredentials;
|
|
868
961
|
apiKey?: string;
|
|
962
|
+
defaultVolumeBarColoring?: DefaultVolumeBarColoring;
|
|
963
|
+
colorfulAnnotations?: boolean;
|
|
869
964
|
fetch?(kind: UrlKind, relativeUrl: string): Promise<string>;
|
|
965
|
+
getCustomEventPopup(view: any): CustomEventPopup | null;
|
|
870
966
|
}
|
|
871
967
|
|
|
872
968
|
/** How should the chart be initialized on startup (if at all). Please note that this is suited for cases where the `template` is already made such that it matches the type of the main plot. This is not an issue: if the template doesn't match (main plot is set to a different kind of plot) the main plot will be replaced by the desired plot with all the values set to their defaults. */
|
|
@@ -941,6 +1037,11 @@ declare module "@barchart/chart-lib" {
|
|
|
941
1037
|
data: string;
|
|
942
1038
|
};
|
|
943
1039
|
|
|
1040
|
+
/** Additional attributes sometimes needed for drawing.
|
|
1041
|
+
* - `ChangeBased`: when coloring bars, we need to know if the price movement was up or down; use the `Change` field to decide. Also known as 'Close-to-Close'.
|
|
1042
|
+
* - `OpenVsClose`: like preceding phrase, but use `Open` and `Close` field values of the bar to decide. Also known as 'Open-to-Close'.
|
|
1043
|
+
* The two attibutes are mutually exclusive, but we _may_ add new attributes which will be independent.
|
|
1044
|
+
*/
|
|
944
1045
|
type CurveAttribute = "ChangeBased" | "OpenVsClose";
|
|
945
1046
|
|
|
946
1047
|
type CurveZone = {
|
|
@@ -954,11 +1055,6 @@ declare module "@barchart/chart-lib" {
|
|
|
954
1055
|
|
|
955
1056
|
/** Curve is the second most important concept of the chart. It's a smallest drawable unit of time-series data. Most plots consist of several curves, each using a portion of the time-series fields associated with the plot. */
|
|
956
1057
|
export interface Curve {
|
|
957
|
-
/** Additional attributes sometimes needed for drawing.
|
|
958
|
-
* - `ChangeBased`: when deciding whether the price movement was up or down, use the `Change` field to decide.
|
|
959
|
-
* - `OpenVsClose`: like preceding phrase, but use `Open` and `Close` field values of the two consequtive bars to decide whether the trend is up or down.
|
|
960
|
-
* The preceding two attibutes are mutually exclusive, but this is not a rule, just an accident.
|
|
961
|
-
*/
|
|
962
1058
|
attributes?: CurveAttribute[];
|
|
963
1059
|
/** The way the curve is drawn. */
|
|
964
1060
|
style?: CurveStyle;
|
|
@@ -1056,11 +1152,21 @@ declare module "@barchart/chart-lib" {
|
|
|
1056
1152
|
context: { period: string } | { range: { from?: number; to?: number } } | { density: number };
|
|
1057
1153
|
}
|
|
1058
1154
|
|
|
1155
|
+
export interface CrosshairProperties {
|
|
1156
|
+
color: string;
|
|
1157
|
+
dashStyle?: DashStyle;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
export interface ICrosshairContext {
|
|
1161
|
+
crosshair: Orientation;
|
|
1162
|
+
horizontal?: CrosshairProperties;
|
|
1163
|
+
vertical?: CrosshairProperties;
|
|
1164
|
+
haloTracking?: boolean;
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1059
1167
|
export interface CrosshairAccessor {
|
|
1060
1168
|
id: string;
|
|
1061
|
-
context: {
|
|
1062
|
-
crosshair: Orientation;
|
|
1063
|
-
};
|
|
1169
|
+
context: ICrosshairContext | { id: "Get" };
|
|
1064
1170
|
}
|
|
1065
1171
|
|
|
1066
1172
|
export type Orientation = "vertical" | "horizontal" | "both" | "none";
|
|
@@ -1103,6 +1209,7 @@ declare module "@barchart/chart-lib" {
|
|
|
1103
1209
|
export interface OtherAccessor {
|
|
1104
1210
|
id: string;
|
|
1105
1211
|
context: {
|
|
1212
|
+
id?: "Get" | "Update";
|
|
1106
1213
|
/**
|
|
1107
1214
|
* Deprecated. Use comparisonMode instead
|
|
1108
1215
|
*/
|
|
@@ -1115,6 +1222,7 @@ declare module "@barchart/chart-lib" {
|
|
|
1115
1222
|
showNavigator?: boolean;
|
|
1116
1223
|
plotHover?: boolean;
|
|
1117
1224
|
showGoToLatest?: boolean;
|
|
1225
|
+
allAnnotationsLocked?: boolean;
|
|
1118
1226
|
};
|
|
1119
1227
|
}
|
|
1120
1228
|
|
|
@@ -1156,6 +1264,7 @@ declare module "@barchart/chart-lib" {
|
|
|
1156
1264
|
id: string;
|
|
1157
1265
|
context: {
|
|
1158
1266
|
plots?: ICompareItem[];
|
|
1267
|
+
alignOnExpirations?: boolean;
|
|
1159
1268
|
};
|
|
1160
1269
|
}
|
|
1161
1270
|
|
|
@@ -1173,6 +1282,7 @@ declare module "@barchart/chart-lib" {
|
|
|
1173
1282
|
id: "Delete" | "Update" | "Duplicate" | "List";
|
|
1174
1283
|
uid?: string;
|
|
1175
1284
|
visible?: boolean;
|
|
1285
|
+
locked?: boolean;
|
|
1176
1286
|
traits?: AnnotationTraits;
|
|
1177
1287
|
extras?: {
|
|
1178
1288
|
[k: string]: any;
|
|
@@ -1217,6 +1327,11 @@ declare module "@barchart/chart-lib" {
|
|
|
1217
1327
|
textColor?: string;
|
|
1218
1328
|
crosshairColor?: string;
|
|
1219
1329
|
};
|
|
1330
|
+
fontSize?: {
|
|
1331
|
+
chart?: number;
|
|
1332
|
+
xAxis?: number;
|
|
1333
|
+
yAxis?: number;
|
|
1334
|
+
};
|
|
1220
1335
|
};
|
|
1221
1336
|
}
|
|
1222
1337
|
|
|
@@ -1324,14 +1439,18 @@ declare module "@barchart/chart-lib" {
|
|
|
1324
1439
|
|
|
1325
1440
|
export type AnnotationId =
|
|
1326
1441
|
| "Line"
|
|
1442
|
+
| "Ray"
|
|
1443
|
+
| "GannLine"
|
|
1327
1444
|
| "VerticalLine"
|
|
1328
1445
|
| "HorizontalLine"
|
|
1329
1446
|
| "FiftyPercentLine"
|
|
1330
1447
|
| "LongPosition"
|
|
1331
1448
|
| "ShortPosition"
|
|
1332
1449
|
| "FibonacciRetracement"
|
|
1450
|
+
| "TrendBasedFibExtension"
|
|
1333
1451
|
| "FibonacciFan"
|
|
1334
1452
|
| "FibonacciArcs"
|
|
1453
|
+
| "FibonacciChannel"
|
|
1335
1454
|
| "GannFan"
|
|
1336
1455
|
| "SpeedResistanceFan"
|
|
1337
1456
|
| "SpeedResistanceArcs"
|
|
@@ -1343,23 +1462,35 @@ declare module "@barchart/chart-lib" {
|
|
|
1343
1462
|
| "SymbolArrowDown"
|
|
1344
1463
|
| "SymbolArrowRight"
|
|
1345
1464
|
| "SymbolArrowLeft"
|
|
1465
|
+
| "SymbolArrowHorizontal"
|
|
1466
|
+
| "SymbolArrowVertical"
|
|
1346
1467
|
| "SymbolArcDown"
|
|
1347
1468
|
| "SymbolArcUp"
|
|
1348
1469
|
| "SymbolThumbsUp"
|
|
1349
1470
|
| "SymbolThumbsDown"
|
|
1471
|
+
| "SymbolZero"
|
|
1350
1472
|
| "SymbolOne"
|
|
1351
1473
|
| "SymbolTwo"
|
|
1352
1474
|
| "SymbolThree"
|
|
1353
1475
|
| "SymbolFour"
|
|
1354
1476
|
| "SymbolFive"
|
|
1477
|
+
| "SymbolSix"
|
|
1478
|
+
| "SymbolSeven"
|
|
1479
|
+
| "SymbolEight"
|
|
1480
|
+
| "SymbolNine"
|
|
1355
1481
|
| "SymbolQuestion"
|
|
1356
1482
|
| "SymbolFishHook"
|
|
1357
1483
|
| "FibonacciTimeZones"
|
|
1358
1484
|
| "Text"
|
|
1359
|
-
| "ComputedText"
|
|
1485
|
+
| "ComputedText"
|
|
1486
|
+
| "DateRange"
|
|
1487
|
+
| "PriceRange"
|
|
1488
|
+
| "DatePriceRange"
|
|
1489
|
+
| "GannBox"
|
|
1490
|
+
| "GannSquare";
|
|
1360
1491
|
|
|
1361
1492
|
export interface AnnotationPoint {
|
|
1362
|
-
/** Price (y)
|
|
1493
|
+
/** Price (y) coordinate. */
|
|
1363
1494
|
price: number;
|
|
1364
1495
|
/** Time (x) coordinate. Number because it is a JavaScript Date, milliseconds since Unix epoch. */
|
|
1365
1496
|
time: number;
|
|
@@ -1373,10 +1504,12 @@ declare module "@barchart/chart-lib" {
|
|
|
1373
1504
|
points: AnnotationPoint[];
|
|
1374
1505
|
traits: AnnotationTraits;
|
|
1375
1506
|
visible: boolean;
|
|
1507
|
+
locked: boolean;
|
|
1376
1508
|
}
|
|
1377
1509
|
|
|
1378
1510
|
export interface AnnotationTraits {
|
|
1379
1511
|
line?: LineTrait;
|
|
1512
|
+
line2?: LineTrait;
|
|
1380
1513
|
fill?: FillTrait;
|
|
1381
1514
|
|
|
1382
1515
|
fill2?: FillTrait;
|
|
@@ -1396,6 +1529,15 @@ declare module "@barchart/chart-lib" {
|
|
|
1396
1529
|
showPercentDiff?: boolean;
|
|
1397
1530
|
|
|
1398
1531
|
showTrendline?: boolean;
|
|
1532
|
+
drawBorder?: boolean;
|
|
1533
|
+
showLeftLabels?: boolean;
|
|
1534
|
+
showRightLabels?: boolean;
|
|
1535
|
+
showTopLabels?: boolean;
|
|
1536
|
+
showBottomLabels?: boolean;
|
|
1537
|
+
showAngles?: boolean;
|
|
1538
|
+
reverse?: boolean;
|
|
1539
|
+
showRangesRatio?: boolean;
|
|
1540
|
+
|
|
1399
1541
|
factors?: Array<{ shown: boolean; value: number }>;
|
|
1400
1542
|
}
|
|
1401
1543
|
|
|
@@ -1406,6 +1548,8 @@ declare module "@barchart/chart-lib" {
|
|
|
1406
1548
|
traits: AnnotationTraits;
|
|
1407
1549
|
extras: any;
|
|
1408
1550
|
points: AnnotationPoint[];
|
|
1551
|
+
locked: boolean;
|
|
1552
|
+
visible: boolean;
|
|
1409
1553
|
chart: ChartAccessor;
|
|
1410
1554
|
}
|
|
1411
1555
|
|
|
@@ -1413,6 +1557,55 @@ declare module "@barchart/chart-lib" {
|
|
|
1413
1557
|
|
|
1414
1558
|
export type RenderTo = string | HTMLElement;
|
|
1415
1559
|
|
|
1560
|
+
/**
|
|
1561
|
+
* Base class for the custom event popups. If you need to show custom events on a chart, you will likely
|
|
1562
|
+
* want to derive from this class and then override @func showValue and @func hideValue methods
|
|
1563
|
+
*/
|
|
1564
|
+
export class CustomEventPopup {
|
|
1565
|
+
/** For internal use only */
|
|
1566
|
+
view: any;
|
|
1567
|
+
/** The date of the event */
|
|
1568
|
+
date: Date;
|
|
1569
|
+
/** The value of the event; opaque, chart does not interpret this in any way */
|
|
1570
|
+
value: any;
|
|
1571
|
+
/** Whether the popup is currently shown on the screen */
|
|
1572
|
+
visible: boolean;
|
|
1573
|
+
/** The popup HTML elements hosting the content */
|
|
1574
|
+
popupElement: HTMLElement;
|
|
1575
|
+
constructor(view: any);
|
|
1576
|
+
/** Initial DOM setup; override if you need any additional initialization */
|
|
1577
|
+
initialize();
|
|
1578
|
+
/** Called when a value needs to be "shown"; basically means you should populate the DOM with the
|
|
1579
|
+
* content, won't be called if the @member value doesn't change
|
|
1580
|
+
*/
|
|
1581
|
+
showValue();
|
|
1582
|
+
/** Called when hiding the popup, in case you need to do anything (most often you don't) */
|
|
1583
|
+
hideValue();
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
/**
|
|
1587
|
+
* Creates a DOM element and appends it into the @see element
|
|
1588
|
+
* @param element DOM element to append the newly created element into
|
|
1589
|
+
* @param nodeName Name of the DOM element to create
|
|
1590
|
+
* @returns Newly created DOM element
|
|
1591
|
+
*/
|
|
1592
|
+
export function appendDOMElement<N extends keyof HTMLElementTagNameMap>(
|
|
1593
|
+
element: HTMLElement,
|
|
1594
|
+
nodeName: N
|
|
1595
|
+
): HTMLElement;
|
|
1596
|
+
/**
|
|
1597
|
+
* Apply styles to a given DOM element
|
|
1598
|
+
* @param element Element to style
|
|
1599
|
+
* @param styles Key-value paris of styles to apply
|
|
1600
|
+
*/
|
|
1601
|
+
export function styleDOMElement(element: HTMLElement, styles: object): void;
|
|
1602
|
+
/**
|
|
1603
|
+
* Apply attributes to a given DOM element
|
|
1604
|
+
* @param element DOM element whose attributes are to be set
|
|
1605
|
+
* @param attributes Key-value pairs of attributes and values to apply
|
|
1606
|
+
*/
|
|
1607
|
+
export function setAttributesDOMElement(element: HTMLElement, attributes: object): void;
|
|
1608
|
+
|
|
1416
1609
|
/** Chart accessor is the main API entry point, it essentially _is_ the chart. */
|
|
1417
1610
|
export class ChartAccessor {
|
|
1418
1611
|
/** The only parameter for construction is `headless` which if set to `true` will create a chart without any kind of visual representation. This form of a chart is useful for template editors which don't render any content. */
|
|
@@ -1447,6 +1640,16 @@ declare module "@barchart/chart-lib" {
|
|
|
1447
1640
|
print(options: { title: TitleOptions }): void;
|
|
1448
1641
|
/** Reserved for internal use. */
|
|
1449
1642
|
fromModel(model: ChartModel): void;
|
|
1643
|
+
/** Returns `true` if @see undo method could be called in order to undo the last change to an annotation */
|
|
1644
|
+
canUndo: boolean;
|
|
1645
|
+
/** Returns `true` if @see redo method could be called in order to redo the last change to an annotation */
|
|
1646
|
+
canRedo: boolean;
|
|
1647
|
+
/** Reverts the last change made to any annotation */
|
|
1648
|
+
undo(): void;
|
|
1649
|
+
/** Does again the last change undone to an annotation */
|
|
1650
|
+
redo(): void;
|
|
1651
|
+
/** Starts (or resets) the interactive zoom */
|
|
1652
|
+
zoom(zoomIn: boolean);
|
|
1450
1653
|
}
|
|
1451
1654
|
|
|
1452
1655
|
export enum SeriesKind {
|
|
@@ -1727,7 +1930,7 @@ declare module "@barchart/chart-lib" {
|
|
|
1727
1930
|
|
|
1728
1931
|
/** Built-in feed for mini chart widgets, no streaming data but does cache timeseries data. */
|
|
1729
1932
|
class MiniWidgetDataFeed extends BaseDataFeed {}
|
|
1730
|
-
|
|
1933
|
+
|
|
1731
1934
|
/** Built-in feed, use if you have a contract with Barchart to use our data. This one _does_ provide streaming data. */
|
|
1732
1935
|
class MarketDataFeed extends BaseDataFeed {
|
|
1733
1936
|
connection?: any;
|
|
@@ -1743,6 +1946,9 @@ declare module "@barchart/chart-lib" {
|
|
|
1743
1946
|
/** So you don't have to store the instance of the data feed - just call this method. The data feed is your root entry point to all APIs. */
|
|
1744
1947
|
function getFeed<T extends BaseDataFeed>(): T | null;
|
|
1745
1948
|
|
|
1949
|
+
/** Shuts down the data feed, severing any and all connections to server(s). For performance reasons, should almost never be called. */
|
|
1950
|
+
function shutdownFeed(): void;
|
|
1951
|
+
|
|
1746
1952
|
export interface IChartOutline {
|
|
1747
1953
|
isTemplate: boolean;
|
|
1748
1954
|
isDefinition: boolean;
|
|
@@ -1892,10 +2098,12 @@ declare module "@barchart/chart-lib" {
|
|
|
1892
2098
|
| "HollowCandles"
|
|
1893
2099
|
| "HeikinAshi"
|
|
1894
2100
|
| "ElderImpulseSystem"
|
|
1895
|
-
| "Renko"
|
|
1896
|
-
|
|
2101
|
+
| "Renko"
|
|
2102
|
+
| "Range"
|
|
2103
|
+
| "LineBreak"
|
|
1897
2104
|
| "Kagi"
|
|
1898
|
-
| "PointAndFigure"
|
|
2105
|
+
| "PointAndFigure"
|
|
2106
|
+
| "Baseline";
|
|
1899
2107
|
|
|
1900
2108
|
interface Taxonomies {
|
|
1901
2109
|
studies: Study[];
|
|
@@ -1993,7 +2201,7 @@ declare module "@barchart/chart-lib" {
|
|
|
1993
2201
|
* @default false
|
|
1994
2202
|
*/
|
|
1995
2203
|
showPrevious?: boolean;
|
|
1996
|
-
type: "
|
|
2204
|
+
type: "Symbol";
|
|
1997
2205
|
/** The main plot is the central focal point of the chart - by default, all studies are based off of the main plot's time-series data, for example.
|
|
1998
2206
|
* This is `false` for all "secondary" plots when we're comparing multiple plots together.
|
|
1999
2207
|
* @default false
|
|
@@ -2095,6 +2303,7 @@ declare module "@barchart/chart-lib" {
|
|
|
2095
2303
|
|
|
2096
2304
|
export interface SymbolPlot extends Plot {
|
|
2097
2305
|
main: boolean;
|
|
2306
|
+
inputs?: StudyInput[];
|
|
2098
2307
|
}
|
|
2099
2308
|
|
|
2100
2309
|
export interface FundamentalPlot extends Plot {
|
|
@@ -2149,19 +2358,10 @@ declare module "@barchart/chart-lib" {
|
|
|
2149
2358
|
a: number;
|
|
2150
2359
|
}
|
|
2151
2360
|
|
|
2152
|
-
interface INetwork {
|
|
2153
|
-
isPrivateAddress(host: string): boolean;
|
|
2154
|
-
isRunningLocally(): boolean;
|
|
2155
|
-
getThisDomainName(): string;
|
|
2156
|
-
buildURL(host: string, query: object): string;
|
|
2157
|
-
buildCheckURL(qps1: string?, qps2: string?): string;
|
|
2158
|
-
}
|
|
2159
|
-
// reserved for internal use
|
|
2160
|
-
export const Network: INetwork;
|
|
2161
|
-
|
|
2162
2361
|
export {
|
|
2163
2362
|
initFeed,
|
|
2164
2363
|
getFeed,
|
|
2364
|
+
shutdownFeed,
|
|
2165
2365
|
getChartOutline,
|
|
2166
2366
|
BarchartSiteDataFeed,
|
|
2167
2367
|
MarketDataFeed,
|