HelloWorld - Basic chart

This is the jsfiddle implementation of helloworld.html

by sonylnagale

HTML

<link rel="stylesheet" type="text/css" href="https://jsfiddle.chartiq.com/chart/css/stx-chart.css" media="screen" />


<div class="chartContainer" style="width:100%;height:400px;position:relative;"></div>

CSS

.stx_grid { /* Default Grid */

    color:#efefef;

    opacity:1;

    border-style:solid;

     width: 10px;

    }

.stx_grid_dark {/* Default Grid dividers */

    color:#cccccc;

    opacity:.9;

    border-style:solid;

     width: 10px;

    }

JavaScript

import { CIQ } from "https://jsfiddle.chartiq.com/chart/js/standard.js";
import sampleData from "https://jsfiddle.chartiq.com/chart/examples/data/STX_SAMPLE_DAILY.js"

// Declare a CIQ.ChartEngine object.
// This is the main object for drawing charts.
// Here is where you set all required defaults.
const stxx = new CIQ.ChartEngine({
  container: document.querySelector(".chartContainer"),
  layout: {
    "chartType": "candle",
    "crosshair": true,
    "candleWidth": 130
  },
  preferences: {
    "currentPriceLine": true
  },
  chart: {
    yAxis: {
      position: 'left'
    }
  }
});

//Now load a chart with it's data
stxx.loadChart(
  "SPY", sampleData
);



stxx.setRange({
	dtRight: new Date('2014-01-01').toISOString(),
  goIntoFuture: false
})

stxx.chart.allowScrollFuture = false;