muonlab » jqplot

random .NET and web development musings

jqPlot is an awesome javascript graphing library, supporting loads of cool features. Except clickable bar charts.

Here is a plugin which allows you to capture click events for bar charts.

Use it like this:

$.jqplot('Graph', data, {
	ClickableBars: { 
		onClick: function(i, j, data){
			alert("Clicked series: " + i + ", data point: " + j + ", data: " + data);
		}
	}
});

This won’t work on horizontal or stacked graphs without modification, but it would be a fairly trivial change.

The code is available on github.