Highcharts Demo

author(s): Torstein Hønsi

by ninachroscicka

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; max-width: 800px; margin: 0 auto"></div>

JavaScript

Highcharts.chart('container', {
    chart: {
        type: 'scatter',
        zoomType: 'xy'
    },
    title: {
        text: 'Height Versus Weight of 507 Individuals by Gender'
    },
    subtitle: {
        text: 'Source: Heinz  2003'
    },
    xAxis: {
        title: {
            enabled: true,
            text: 'Height (cm)'
        },
        startOnTick: true,
        endOnTick: true,
        showLastLabel: true
    },
    yAxis: {
        title: {
            text: 'Weight (kg)'
        }
    },
    plotOptions: {
				scatter: {
					dataLabels: {
						format: "{point.name}",
						enabled: true
												},
						enableMouseTracking: false 
							}
},
    series: [{
        name: 'Female',
        color: 'rgba(223, 83, 83, .5)',
        data: [{"name":"Point 1","x":160,"y":50}]

    }, {
        name: 'Male',
        color: 'rgba(119, 152, 191, .5)',
        data: [{"name":"Point 2","x":170,"y":70}]
    }]
});