@millistream/millistream-widgets 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,12 +16,25 @@ $ npm install @millistream/millistream-widgets
|
|
|
16
16
|
...
|
|
17
17
|
loadChart) {
|
|
18
18
|
(async function () {
|
|
19
|
-
const {
|
|
19
|
+
const {
|
|
20
|
+
MillistreamWidgetStreamingApi,
|
|
21
|
+
Milli_Chart,
|
|
22
|
+
MillistreamWidgetSettings,
|
|
23
|
+
} = await import(
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
'@millistream/millistream-widgets'
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
MillistreamWidgetSettings.token = 'xxx';
|
|
29
|
+
|
|
30
|
+
let pushapi = new MillistreamWidgetStreamingApi({
|
|
31
|
+
token: MillistreamWidgetSettings.token,
|
|
32
|
+
server: 'wss://push.millistream.com',
|
|
33
|
+
});
|
|
20
34
|
|
|
21
35
|
let ml = new Milli_Chart({
|
|
22
36
|
instrument: [6485],
|
|
23
37
|
target: document.getElementById('chart'),
|
|
24
|
-
token: '5b09a1bb-3f27-4026-8c08-0acc9ef7a872',
|
|
25
38
|
autodraw: true,
|
|
26
39
|
intradaylen: '5',
|
|
27
40
|
historylen: '5y',
|
|
@@ -33,8 +46,9 @@ loadChart) {
|
|
|
33
46
|
drawyaxis: true,
|
|
34
47
|
fillchart: true,
|
|
35
48
|
timeformat: 'HH:mm',
|
|
36
|
-
|
|
49
|
+
streaming: pushapi,
|
|
37
50
|
});
|
|
51
|
+
|
|
38
52
|
})();
|
|
39
53
|
```
|
|
40
54
|
|
|
@@ -104,9 +118,7 @@ loadChart) {
|
|
|
104
118
|
background: rgb(255, 153, 0, 0.1);
|
|
105
119
|
pointer-events: none;
|
|
106
120
|
}
|
|
107
|
-
|
|
108
|
-
...
|
|
109
|
-
|
|
121
|
+
```
|
|
110
122
|
|
|
111
123
|
## Widget documentation
|
|
112
124
|
Please refer to non npm-version documentation on widget customization.
|