Skip to content

Instantly share code, notes, and snippets.

@wignesh
Created December 5, 2020 07:28
Show Gist options
  • Select an option

  • Save wignesh/46110e30885cb06588c4d1bfcfd4a212 to your computer and use it in GitHub Desktop.

Select an option

Save wignesh/46110e30885cb06588c4d1bfcfd4a212 to your computer and use it in GitHub Desktop.

Revisions

  1. wignesh created this gist Dec 5, 2020.
    6 changes: 6 additions & 0 deletions index.html
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    <div id="container" style="height: 400px; min-width: 310px"></div>

    <script src="https://code.highcharts.com/stock/highstock.js"></script>
    <script src="https://code.highcharts.com/stock/modules/data.js"></script>
    <script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
    <script src="https://code.highcharts.com/stock/modules/export-data.js"></script>
    7 changes: 7 additions & 0 deletions intraday-area.markdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    Intraday area
    -------------


    A [Pen](https://codepen.io/Wignesh/pen/abmNvwd) by [VIGNESH](https://codepen.io/Wignesh) on [CodePen](https://codepen.io).

    [License](https://codepen.io/Wignesh/pen/abmNvwd/license).
    60 changes: 60 additions & 0 deletions script.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    Highcharts.getJSON('https://cdn.jsdelivr.net/gh/highcharts/[email protected]/samples/data/new-intraday.json', function (data) {

    // create the chart
    Highcharts.stockChart('container', {


    title: {
    text: 'AAPL stock price by minute'
    },

    subtitle: {
    text: 'Using ordinal X axis'
    },

    xAxis: {
    gapGridLineWidth: 0
    },

    rangeSelector: {
    buttons: [{
    type: 'hour',
    count: 1,
    text: '1h'
    }, {
    type: 'day',
    count: 1,
    text: '1D'
    }, {
    type: 'all',
    count: 1,
    text: 'All'
    }],
    selected: 1,
    inputEnabled: false
    },

    series: [{
    name: 'AAPL',
    type: 'area',
    data: data,
    gapSize: 5,
    tooltip: {
    valueDecimals: 2
    },
    fillColor: {
    linearGradient: {
    x1: 0,
    y1: 0,
    x2: 0,
    y2: 1
    },
    stops: [
    [0, Highcharts.getOptions().colors[0]],
    [1, Highcharts.color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
    ]
    },
    threshold: null
    }]
    });
    });