JSFiddle - React, Tailwind, and code Playground

by Janica Kaneshiro

HTML

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

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

<table id="datatable">
	<thead>
		<tr>
			<th></th>
			<th>Indiana</th>
			<th>Monroe County</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<th>Year 2013</th>
			<td>122000</td>
			<td>151000</td>
		</tr>
		<tr>
			<th>Year 2014</th>
			<td>126000</td>
			<td>156900</td>
		</tr>
	</tbody>
</table>

JavaScript

$(function () {
    $('#container').highcharts({
        data: {
            table: 'datatable'
        },
        chart: {
            type: 'column'
        },
        title: {
            text: 'Median Sales Price'
        },
        yAxis: {
            allowDecimals: false,
            title: {
                text: 'Units'
            }
        },

        tooltip: {
            formatter: function () {
                return '<b>' + this.series.name + '</b><br/>' +
                    this.point.y + ' ' + this.point.name.toLowerCase();
            }
        }
    });
});