Is there any example showing how to use methods like 'getItem' and 'getItemIndex' in igDataChart. On this page http://help.infragistics.com/jQuery/2013.1/ui.igDataChart only method signature is shown.
ACTUALLY, I'M TRYING TO FIND WHICH DATA-POINT IS CLICKED, SINCE THERE IS NO EVENT OR METHOD AVAILABLE FOR DATA-POINT CLICK, I TRIED USING SERIES EVENTS.
I tried using the method getItemIndexFromSeriesPixel as below,
//On Series Mouse left Button Up, call logSeriesClick
seriesMouseLeftButtonUp: function (event, args) { logSeriesClick(event, args); },
//Using the mouse position, get the item beneath it.
function logSeriesClick(event, args) {
var xPos = Math.round(args.positionX * 10) / 10; var yPos = Math.round(args.positionY * 10) / 10 logEvent('Series MouseUp (x, y): ' + xPos + ", " + yPos); var item = chart.igDataChart("getItemIndexFromSeriesPixel", "series1", { x: xPos, y: yPos }); logEvent(item);
}
But I'm unable to get any index, the 'item' variable is always having the chart object.
Hello ptilwani,
You can get the item directly from ui.item element.
seriesMouseLeftButtonDown: function (evt, ui) {
alert("Item label: "+ui.item.Label+" Item.Index "+ui.item.Index+ " Item value: "+ ui.item.Value1);
},
For additional reference please check the attached sample where I show how you can use this event.
Please let me know if you need any additional details on this matter.
Thanks Elena, It worked.
But it is not working for 'area' chart. Is this functionality specific to few chart types?