1.0.46 • Published 4 months ago

@millistream/millistream-widgets v1.0.46

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
4 months ago

Millistream Widgets

Millistream financial data widgets for websites.

Installation

$ npm install @millistream/millistream-widgets

Angular example

<button (click)="loadChart()">Load</button>
<div id="chart" style="millistream-chart-target"></div>
...
loadChart) {
(async function () {
    const {
        MillistreamWidgetStreamingApi,
        Milli_Chart,
        MillistreamWidgetSettings,
        setDataApiUrl
    } = await import(
        // @ts-ignore
        '@millistream/millistream-widgets'
    );

    // If using your own data-api
    setDataApiUrl('xxx?');

    MillistreamWidgetSettings.token = 'xxx';

    let pushapi = new MillistreamWidgetStreamingApi({
        token: MillistreamWidgetSettings.token,
        server: 'wss://push.millistream.com',
    });

    let ml = new Milli_Chart({
        instrument: [6485],
        target: document.getElementById('chart'),
        autodraw: true,
        intradaylen: '5',
        historylen: '5y',
        gridHorizontalLines: 0,
        gridHorizontalLinesStyle: 'normal',
        gridVerticalLines: 1,
        chartlen: '2d',
        dateformat: 'b dd',
        drawyaxis: true,
        fillchart: true,
        timeformat: 'HH:mm',
        streaming: pushapi,
        instrumentStyle: {
          color: '#f90',
          backgroundLinearGradient: {
            topColor: 'rgba(255,153,0,0.6)',
            bottomColor: 'rgba(255,153,0,0.1)',
          },
          width: 1,
        },
        horizontalLegendStyle: {
          fontSize: '11px',
          fontFamily: 'Arial, Helvetica, sans-serif',
        },
        verticalLegendStyle: {
          fontSize: '11px',
          fontFamily: 'Arial, Helvetica, sans-serif',
        },
        tooltip: {
          // @ts-ignore
          formatter: function () {
            // @ts-ignore
            var date = formatDate(this.data.date, 'yyyy-mm-dd');
            var time = '';
            // @ts-ignore
            if (this.chartType == 'trades') {
              // @ts-ignore
              var hour = this.data.date.getHours();
              var minute = '';
              // @ts-ignore
              if (this.data.date.getMinutes() < 10) minute = '0';
              // @ts-ignore
              minute += this.data.date.getMinutes();
              time = hour + ':' + minute;
            }
            // @ts-ignore
            return (
              '<span class="tooltip-name">' +
              // @ts-ignore
              this.name +
              '</span><br>' +
              // @ts-ignore
              this.data.price +
              ', ' +
              // @ts-ignore
              this.data.diff.toFixed(2) +
              '%</br>' +
              date +
              ' ' +
              time
            );
          },
        },
    });

})();
/* Global Styles */
.millistream-chart-target {
  position: relative;
}

.millistream-chart-target {
  position: relative;
}

.millistream-chart-tooltip {
  position: absolute;
  background: #ffffff;
  border: 1px solid lightblue;
  border-radius: 2px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 2px;
  pointer-events: none;
}

.millistream-chart-pointer {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  box-shadow: 0px 0px 10px 2px #f90;
  pointer-events: none;
}

.millistream-chart-zoombox {
  position: absolute;
  background: rgb(255, 153, 0, 0.1);
  pointer-events: none;
}

Widget documentation

Please refer to non npm-version documentation on widget customization. https://mws.millistream.com/widgets/3.0.4/doc/chart_v3.html

Support

https://www.millistream.com

1.0.46

4 months ago

1.0.37

10 months ago

1.0.36

10 months ago

1.0.39

10 months ago

1.0.38

10 months ago

1.0.40

9 months ago

1.0.45

8 months ago

1.0.33

12 months ago

1.0.32

1 year ago

1.0.35

12 months ago

1.0.34

12 months ago

1.0.31

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.29

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.30

1 year ago

1.0.24

1 year ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.23

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.20

2 years ago

0.0.21

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago