Rank: Advanced Member
Groups: Administrators, DataVizJavaScript, jQueryChart, jQueryDV, MvcChart, Registered Joined: 1/3/2011(UTC) Posts: 483
Thanks: 0 times Was thanked: 87 time(s) in 87 post(s)
|
You can try using the following code: Code: <script lang="javascript" type="text/javascript">
$(document).ready(function () {
$('#jqChart').jqChart({ title: { text: 'Line Chart' }, tooltips: { type: 'shared' }, animation: { duration: 1 }, series: [ { type: 'line', title: 'Series 1', strokeStyle: '#418CF0', lineWidth: 2, data: [[1, 62], [2, 60], [3, 68], [4, 58], [5, 52], [6, 60], [7, 48]] }, { type: 'line', title: 'Series 2', strokeStyle: '#FCB441', lineWidth: 2, data: [[1, 46], [2, 40], [3, 62], [4, 65], [5, 60], [6, 36], [7, 70]] } ] });
$('#button').click(function () {
var chart = $('#jqChart').jqChart('chart'); var axes = chart.axes.items;
var xAxis = axes[0]; var yAxis = axes[1];
// the coordiates of (1, 62) data point. var xCoord = xAxis.getPosition(1); var yCoord = yAxis.getPosition(62);
}); }); </script>
</head> <body> <div> <div id="jqChart" style="width: 500px; height: 300px;"></div> <input type="button" id="button" value="Click" /> </div> </body> Best Regards, Dragan Matek jqChart Inc.
|
1 user thanked Dragan for this useful post.
|
|