Highcharts Demo

author(s): Torstein Hønsi

HTML

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

<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
    chart: {
        zoomType: 'xy'
        
        
    },
    title: {
        text: 'Brownsville in the Daily News'
    },
    subtitle: {
        text: 'Crime vs. crime coverage, 2000 through 2016'
    },
    xAxis: [{
        categories: ['2000', '2001', '2002', '2003', '2004','2005', '2006', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015', '2016'],
        crosshair: true
    }],
    yAxis: [{ // Primary yAxis
        labels: {
            format: '{value}',
            style: {
                color: Highcharts.getOptions().colors[0]
            }
        },
        title: {
            text: ' ',
            style: {
                color: Highcharts.getOptions().colors[0]
            }
        }
    }, { // Secondary yAxis
        title: {
            text: ' ',
            style: {
                color: Highcharts.getOptions().colors[1]
            }
        },
        labels: {
            format: '{value} percent',
            style: {
                color: Highcharts.getOptions().colors[1]
            }
        },
        opposite: true
    }],
    tooltip: {
        shared: true
    },
    legend: {
        layout: 'vertical',
        align: 'left',
        x: 150,
        verticalAlign: 'top',
        y: 60,
        floating: true,
        backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
    },
    series: [{
        name: 'Number of major felony crimes',
        type: 'column',
        
        data: [2714, 2616, 2459, 2280, 2213, 2174, 2149, 2127, 2154, 2011, 2009, 2135, 2249, 2094, 1879, 1735, 1603],
        tooltip: {
            valueSuffix: ''
        }

    }, {
        name: 'Stories that are crime-related',
        type: 'spline',
        yAxis: 1,
        data: [14.56, 48.38, 30.43, 63.75, 44.3, 42.35, 42.33, 50, 51.89, 45.63, 33.88, 38.6, 36.68, 39.24, 37.86, 51.78, 65.87],
				
        tooltip: {
            valueSuffix: ' percent'
      ...