JQPlot Bar Charts with HTML links - jQuery / jQPlot Method

I am interested in adding an html link on bar chart?

This example draws on the excellent usage documentation provided by the author Chris Leonello http://www.jqplot.com/. Specifically an extract from the barTest.html file

In the interests of simplicity it only uses the code necessary to demonstrate the link method. There are bound to be other ways of achieving this same end, the wonderful thing about programming - so many different ways to achieve the same thing. Here is one of them.

According to the documentation, "Extra data can be added to the series like so: [[1,4,'mid'], [3 5,'hi'], [7,2,'low']]" [ from Plugins PointLabels in the documentation ]. This adds extra data in the data array. Neat.

So add the required links in the data array, access them through the array as data[2] and replace the default jqplotDataClick function with a simple one to open the link.

The example here is documented with two options - open in the same window or open in a new one. Use whichever suits you.

To see the code, view the source of this document.

Moused Over: Nothing
Clicked: will trigger a jump to the specified link location.