Page 1 of 1

How to find custom axis series from click on background

Posted: Thu Aug 23, 2007 9:45 am
by 9643998
Hi,

I have a WebChart with line series, each one on a custom axis.
After clicking on the background, I need to know on which series I clicked.
I can not use the ClickSeries event, since the click need not be exactly on the series line,
but anywhere on the rectangular area on which the series appears.
So I guess the ClickBackground event should be used, where I have the x,y screen coordinates of the click point.
How do I find the appropriate series from them?

Posted: Thu Aug 23, 2007 9:58 am
by narcis
Hi MeirS,

In that case you should loop either vertically or horizontally through the chart pixels (using WebChart1.Chart.ChartRect coordinates) or through axes positions (WebChart1.Chart.Axes.Custom[0].IStartPos and WebChart1.Chart.Axes.Custom[0].IEndPos) and check if any series is within this range using its Clicked method, for example:

Code: Select all

WebChart1.Chart.Series[0].Clicked(e.X,e.Y);
Hope this helps!