legend layout

by vasagi

HTML

<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-more.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>

<div id="container" style="height:400px;margin:1.5em 1em;"></div>

CSS

.legend-title {
    display:inline-block;
    width:120px;
    margin:1px 10px;
    padding:0 5px;
}
.legend-value {
    display:inline-block;
    background-color:rgba(204,204,204,.25);
    margin:1px 10px;
    padding:0 5px;
    font-weight:normal;    
}

JavaScript

var categories     = ['a','b','c'];

var options = {
    "chart": {
        "type": "line",
        "styledMode": false,
        "width": null,
        "height": null,
        "marginTop": 30,
        "marginRight": 25,
        "className": "vertical-chart line-chart points-no-fill line-chart-marker",
        "zooming": {
            "mouseWheel": {
                "enabled": false
            }
        },
        "style": {
            "fontFamily": "Lucida Grande, Lucida Sans Unicode, Arial, Helvetica, sans-serif",
            "fontSize": "12px"
        },
        "events": {},
        "resetZoomButton": {
            "position": {
                "x": 100,
                "y": 10
            },
            "relativeTo": "chart"
        }
    },
    "boost": {
        "enable": false,
        "useGPUTranslations": false
    },
    "exporting": {
        "enabled": false,
        "fallbackToExportServer": false
    },
    "title": {
        "text": ""
    },
    "xAxis": {
        "gridLineWidth": 0,
        "gridLineDashStyle": "Solid",
        "gridLineColor": "#eeeeee",
        "className": "gridLineStyledMode wrapXaxisLabel",
        "type": "datetime",
        "crosshair": true,
        "minTickInterval": 86400000,
        "categories": false,
        "maxCharCount": 20,
        "title": {
            "y": 5
        },
        "labels": {
            "rotation": 0
        },
        "scrollbar": {
            "liveRedraw": true,
            "barBorderRadius": 6,
            "height": 10,
            "margin": 10
        },
        "events": {},
        "tickInterval": 86400000
    },
    "yAxis": {
        "title": {
            "text": "Total Runtime (h)",
            "y": 0
        },
        "gridLineDashStyle": "shortdot",
        "visible": true,
        "plotLines": [],
        "labels": {},
        "events": {}
    },
    "responsive": {
        "rules": [
            {
                "condition": {},
                "chartOptions": {
              ...