0
votes

Is there any way to store IDs in Bar Charts and then getting the ID of a clicked Bar in JQplot Bar chart? This ID won't be shown on any axis. This is the code which I am using, but it just shows Point Index, or its x-axis value, how to get the ID?

 $('#'+chartName).bind('jqplotDataClick',
                function(ev, seriesIndex, pointIndex, data) {
                    alert('series: ' + seriesIndex + ', point: ' + pointIndex + ', data: ' + data);
                }
            );
1

1 Answers

0
votes

The pointIndex is not the x-axis value, so it should be fine to use as an Id for a clicked bar. It is the data object that contains the actual x/y values.

If you have multiple series, then the Id could be determined by also taking into account the seriesIndex.