Basic line

author(s): Torstein Hønsi

by Sascha

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/highstock.js"></script>
<script src="https://code.highcharts.com/modules/boost.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>
<script src="https://code.highcharts.com/modules/heatmap.js"></script>
<script src="https://code.highcharts.com/modules/solid-gauge.js"></script>
<script src="https://code.highcharts.com/modules/tilemap.js"></script>
<script src="https://code.highcharts.com/modules/treemap.js"></script>

<!--<script src="https://code.highcharts.com/modules/series-label.js"></script> -->

<figure class="highcharts-figure">
    <div id="container"></div>
    <p class="highcharts-description">
        Basic line chart showing trends in a dataset. This chart includes the
        <code>series-label</code> module, which adds a label to each line for
        enhanced readability.
    </p>
</figure>

CSS

.highcharts-figure, .highcharts-data-table table {
    min-width: 360px; 
    max-width: 800px;
    margin: 1em auto;
}

.highcharts-data-table table {
	font-family: Verdana, sans-serif;
	border-collapse: collapse;
	border: 1px solid #EBEBEB;
	margin: 10px auto;
	text-align: center;
	width: 100%;
	max-width: 500px;
}
.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}
.highcharts-data-table th {
	font-weight: 600;
    padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
    padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}
.highcharts-data-table tr:hover {
    background: #f1f7ff;
}

JavaScript

Highcharts.chart('container', {
    "colors": [
        "#FF6C00",
        "#A66999",
        "#0040FF",
        "#5CB85C",
        "#C5C5C5",
        "#FF5494",
        "#004c6d",
        "#346888",
        "#5886a5",
        "#7aa6c2",
        "#9dc6e0",
        "#c1e7ff",
        "#FF9655",
        "#FFF263",
        "#6AF9C4",
        "#2B908F",
        "#90EE7E",
        "#f45B5B",
        "#7798BF",
        "#AAEEEE",
        "#FF0066",
        "#EEAAEE",
        "#55BF3B",
        "#DF5353"
    ],
    "chart": {
        "backgroundColor": "transparent",
        "spacing": 4,
        "style": {
            "fontFamily": "'Roboto', 'Helvetica', 'Arial', sans-serif"
        },
        "renderTo": "COM_WORKLOAD_HISTORY_TILE;_166717a9-8654-441c-8a14-73f719408adaworkloadHistory",
        "zoomType": "x",
        "panning": true,
        "panKey": "shift",
        "type": "column"
    },
    "plotOptions": {
        "series": {
            "borderWidth": 0,
            "fillOpacity": 0.4,
            "pointPadding": 0,
            "groupPadding": 0.05,
            "label": {
                "style": {
                    "fontWeight": "normal"
                }
            },
            "dataLabels": {
                "style": {
                    "fontWeight": "bold"
                }
            }
        }
    },
    "legend": {
        "margin": 2,
        "enabled": true
    },
    "tooltip": {
        "style": {
            "borderRadius": 4
        },
        "useHTML": true,
        "headerFormat": "<span style=\"font-size: 10px\">{point.key}</span><br/>"
    },
    "credits": {
        "enabled": false
    },
    "exporting": {
        "enabled": false
    },
    "title": {
        "text": null,
        "align": "left",
        "style": {
            "fontSize": "16px"
        }
    },
    "boost": {
        "useGPUTranslations": true,
        "usePreallocated": true
    },
    "xAxis": {
        "tickmarkPlacement": "on",
        "labels": {
         ...