Highcharts Demo

author(s): Torstein Hønsi

by koh_edwin

HTML

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

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

CSS

#container {
    height: 400px;
}

.highcharts-tooltip > span {
    background: rgb(255 255 255 / 85%);
    border: 1px solid silver;
    border-radius: 3px;
    box-shadow: 1px 1px 2px #888;
    padding: 8px;
}

sup {
    vertical-align: 8px;
    font-size: 10px;
}

JavaScript

Highcharts.chart('container', {
    title: {
        text: 'Full HTML tooltip with border, background and shadow'
    },

    tooltip: {
        backgroundColor: null,
        borderWidth: 0,
        shadow: false,
        useHTML: true,
        style: {
            padding: 0
        }
    },

    xAxis: {
        useHTML: true,
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
        labels: {style: {fontSize: 14, fontWeight:300},
						formatter: function () {
							return  this.axis.defaultLabelFormatter.call(this).replace('-','-<br>')
            		}}
    },
yAxis: {
       	useHTML: true,
        title: {useHTML: true, text: '25<sup> er</sup> Percent'},
        labels: {style: {fontSize: 18, fontWeight:300},
						formatter: function () {
							return  this.axis.defaultLabelFormatter.call(this).replace('-','-<br>')+'X'
            		}}
    },
    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
});