Query #1: I need to get the exact cell I have clicked on
We can achieve this requirement using the pointRegionClick event of chart widget. We have prepared a simple sample for this requirement in the following link
Please refer the following code snippet to achieve this
[JS]
$("#container").ejChart(
{
//Other chart configurations
pointRegionClick: 'onclick',
});
function onclick(sender) {
//Index of the clicked point
var pointIndex = sender.data.region.Region.PointIndex,
//Index of the series
seriesIndex = sender.data.region.Region.SeriesIndex,
//Get point object using series index and point index
dataPoint = sender.model.series[seriesIndex].points[pointIndex];
//alert is used for demonstration purpose
alert("X value : " + dataPoint.x
+ "\n Y value : " + dataPoint.y
+ "\n Text : " + dataPoint.text);
//Other operations after clicking chart
} |
Please let us know if you have any concern.
Regards,
Anand