Highcharts Demo

author(s): Torstein Hønsi

by Anil Vangari

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

<div id="container"></div>

CSS

#container {
	min-width: 310px;
	max-width: 800px;
	height: 400px;
	margin: 0 auto
}

JavaScript

Highcharts.chart('container', {
  "chart": {
    "type": "line"
  },
  "title": {
    "text": ""
  },
  "subtitle": {
    "text": ""
  },
  "xAxis": {
    "type": "datetime",
    "labels": {
      "overflow": "justify"
    }
  },
  "yAxis": {
    "title": {
      "text": "Drawdown"
    },
    "minorGridLineWidth": 0,
    "gridLineWidth": 0,
    "alternateGridColor": null
  },
  "tooltip": {
    "headerFormat": "<b>{point.x:%m/%d/%Y}</b><br/>",
    "pointFormat": "{series.name}: {point.y:.4f}<br/>Total: {point.stackTotal:.4f}"
  },
  "plotOptions": {
    "spline": {
      "lineWidth": 1,
      "states": {
        "hover": {
          "lineWidth": 1
        }
      },
      "marker": {
        "enabled": false
      }
    }
  },
  "series": [{
    "name": "Equal Weighted Portfolio Returns",
    "data": [
      [Date.parse("2006-01-31T06:00:00.000Z"),0],
      [Date.parse("2006-02-28T06:00:00.000Z"),-0.0024352913417411415],
      [Date.parse("2006-03-31T05:00:00.000Z"),0],
      [Date.parse("2006-04-30T05:00:00.000Z"),0],
      [Date.parse("2006-05-31T05:00:00.000Z"),-0.035501579798865146],
      [Date.parse("2006-06-30T05:00:00.000Z"),-0.03452914668514828],
      [Date.parse("2006-07-31T05:00:00.000Z"),-0.0215518571101746],
      [Date.parse("2006-08-31T05:00:00.000Z"),-0.0019415269945228797],
      [Date.parse("2006-09-30T05:00:00.000Z"),0],
      [Date.parse("2006-10-31T05:00:00.000Z"),0],
      [Date.parse("2006-11-30T06:00:00.000Z"),0],
      [Date.parse("2006-12-31T06:00:00.000Z"),0],
      [Date.parse("2007-01-31T06:00:00.000Z"),0],
      [Date.parse("2007-02-28T06:00:00.000Z"),-0.0028105977316863484],
      [Date.parse("2007-03-31T05:00:00.000Z"),0],
      [Date.parse("2007-04-30T05:00:00.000Z"),0],
      [Date.parse("2007-05-31T05:00:00.000Z"),0],
      [Date.parse("2007-06-30T05:00:00.000Z"),-0.01685930477691322],
      [Date.parse("2007-07-31T05:00:00.000Z"),-0.036152629119215796],
      [Date.parse("2007-08-31T05:00:00.000Z"),-0.018747224924565487],
    ...