I would like to know if it is possible to select a marker on a chart programmatically.
I have a line graph and a separate data grid.
Clicking a marker in a line chart will highlight the corresponding row in the data grid, and clicking a line in the data grid will highlight the corresponding marker in the line chart.
In the example below, I can fulfill the first requirement. $('#chartdiv').bind('jqplotDataClick', function (ev, seriesIndex, pointIndex, data)
returns a data point that I can use to find the corresponding row of the data grid.
But I'm stuck on the back.
In my example, I replaced the datagrid with a button for simplicity.
Is there a SetSelectedMarker
or some similar method that I don't know?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>jqPlot examples</title> <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.7.1.min.js" type="text/javascript"></script> <style type="text/css"> ul.tooltip { list-style-type:none; padding:0px; margin:0px; } </style> <script class="include" type="text/javascript" src="js/jquery.jqplot.1.0.0r1095/dist/jquery.jqplot.min.js"></script> <script class="include" type="text/javascript" src="js/jquery.jqplot.1.0.0r1095/dist/plugins/jqplot.canvasTextRenderer.min.js"></script> <script class="include" type="text/javascript" src="js/jquery.jqplot.1.0.0r1095/dist/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script> <script class="include" type="text/javascript" src="js/jquery.jqplot.1.0.0r1095/dist/plugins/jqplot.highlighter.js"></script> <script type="text/javascript"> </script> </head> <body> <div id="chartdiv" style="height:400px;width:600px; "></div> <input id="button" type="button" value="click"/> </body> </html>
Thanks for any help
Paddy source share