@millistream/millistream-widgets 1.0.1 → 1.0.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.
Files changed (2) hide show
  1. package/README.md +56 -33
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -45,12 +45,66 @@ loadChart) {
45
45
  gridHorizontalLines: 0,
46
46
  gridHorizontalLinesStyle: 'normal',
47
47
  gridVerticalLines: 1,
48
- chartlen: '1y',
48
+ chartlen: '2d',
49
49
  dateformat: 'b dd',
50
50
  drawyaxis: true,
51
51
  fillchart: true,
52
52
  timeformat: 'HH:mm',
53
53
  streaming: pushapi,
54
+ fillchart: true,
55
+ timeformat: 'HH:mm',
56
+ streaming: pushapi,
57
+ instrumentStyle: {
58
+ color: '#f90',
59
+ backgroundLinearGradient: {
60
+ topColor: 'rgba(255,153,0,0.6)',
61
+ bottomColor: 'rgba(255,153,0,0.1)',
62
+ },
63
+ width: 1,
64
+ },
65
+ horizontalLegendStyle: {
66
+ fontSize: '11px',
67
+ fontFamily: 'Arial, Helvetica, sans-serif',
68
+ },
69
+ verticalLegendStyle: {
70
+ fontSize: '11px',
71
+ fontFamily: 'Arial, Helvetica, sans-serif',
72
+ },
73
+ tooltip: {
74
+ // @ts-ignore
75
+ formatter: function () {
76
+ // @ts-ignore
77
+ var date = formatDate(this.data.date, 'yyyy-mm-dd');
78
+ var time = '';
79
+ // @ts-ignore
80
+ if (this.chartType == 'trades') {
81
+ // @ts-ignore
82
+ var hour = this.data.date.getHours();
83
+ var minute = '';
84
+ // @ts-ignore
85
+ if (this.data.date.getMinutes() < 10) minute = '0';
86
+ // @ts-ignore
87
+ minute += this.data.date.getMinutes();
88
+ time = hour + ':' + minute;
89
+ }
90
+ // @ts-ignore
91
+ return (
92
+ '<span class="tooltip-name">' +
93
+ // @ts-ignore
94
+ this.name +
95
+ '</span><br>' +
96
+ // @ts-ignore
97
+ this.data.price +
98
+ ', ' +
99
+ // @ts-ignore
100
+ this.data.diff.toFixed(2) +
101
+ '%</br>' +
102
+ date +
103
+ ' ' +
104
+ time
105
+ );
106
+ },
107
+ },
54
108
  });
55
109
 
56
110
  })();
@@ -67,19 +121,6 @@ loadChart) {
67
121
  position: relative;
68
122
  }
69
123
 
70
- .millistream-chart {
71
- margin-bottom: 30px;
72
- }
73
-
74
- .millistream-chart-instrument {
75
- color: #f90;
76
- background-image: linear-gradient(
77
- rgba(255, 153, 0, 0.6),
78
- rgba(255, 153, 0, 0)
79
- );
80
- width: 2px;
81
- }
82
-
83
124
  .millistream-chart-tooltip {
84
125
  position: absolute;
85
126
  background: #ffffff;
@@ -88,7 +129,6 @@ loadChart) {
88
129
  font-family: Arial, Helvetica, sans-serif;
89
130
  font-size: 11px;
90
131
  padding: 2px;
91
- height: 14px;
92
132
  pointer-events: none;
93
133
  }
94
134
 
@@ -100,23 +140,6 @@ loadChart) {
100
140
  pointer-events: none;
101
141
  }
102
142
 
103
- .millistream-chart-x-legend {
104
- font-family: Arial, Helvetica, sans-serif;
105
- font-size: 11px;
106
- }
107
-
108
- .millistream-chart-y-legend {
109
- font-family: Arial, Helvetica, sans-serif;
110
- font-size: 11px;
111
- float: left;
112
- }
113
-
114
- .millistream-chart-y2-legend {
115
- font-family: Arial, Helvetica, sans-serif;
116
- font-size: 11px;
117
- float: right;
118
- }
119
-
120
143
  .millistream-chart-zoombox {
121
144
  position: absolute;
122
145
  background: rgb(255, 153, 0, 0.1);
@@ -129,4 +152,4 @@ Please refer to non npm-version documentation on widget customization.
129
152
  https://widgets.millistream.com/3.0.3/doc/widgets.html
130
153
 
131
154
  ## Support
132
- https://www.millistream.com
155
+ https://www.millistream.com
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@millistream/millistream-widgets",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Millistream widgets node package",
5
5
  "main": "millistream-widgets.js",
6
6
  "scripts": {