This plugin for the javascript charting library highcharts will add histograms as a new chart type.
Add the following script line to the head section of your html file:
<script src="https://raw.githubusercontent.com/ulo/highcharts-histogram/master/highcharts-histogram.js"></script>
Just specify 'histogram' as chart type. The plugin will bin your data and create the corresponding column chart:
$('#graph').highcharts({
title: {text: 'distribution of x'},
chart: {type: 'histogram'},
series: [{data: x}]
})