Page 1 of 1

OnClickSeries Vs Transparent

Posted: Fri Apr 24, 2015 1:49 pm
by 16670909
Hi Team.

Im having a litle issue with the OnClickSeries event.

In some scenarios im using marks InsideSlice when using Pie charts or MarksLocation = mlStart when using bars and the problem is that the OnClickSeries is not fired if the end user click on the mark and not on the bar/slice. In some situations its critical due the mark surface (because long text) is bigger than the bar. In the attached screenshot, if i click arround the green area then im not able to fire the OnClickSeries event..any suggestion?

Thanks in advance.

Re: OnClickSeries Vs Transparent

Posted: Fri Apr 24, 2015 3:41 pm
by yeray
Hello,

Try using the Chart OnClick event instead:

Code: Select all

Private Sub TChart1_OnClick()
  Dim valueIndex As Integer
  valueIndex = TChart1.Series(0).Clicked(TChart1.MousePosition.X, TChart1.MousePosition.Y)
  If (valueIndex > -1) Then
    MsgBox "series clicked"
  End If
End Sub

Re: OnClickSeries Vs Transparent

Posted: Fri Apr 24, 2015 4:22 pm
by 16670909
Thanks Yeray.

It seems to work but i still need to grab the SeriesIndex and ValueIndex.

I can get SeriesIdex from OnMouseEnterSeries and keep it in a global var but i cant see how to get the ValueIndex.

Thanks

Re: OnClickSeries Vs Transparent

Posted: Fri Apr 24, 2015 4:31 pm
by 16670909
Hi aGain..

Sorry, forget about my last post..it was already in your sample code.

Thanks again.

Re: OnClickSeries Vs Transparent

Posted: Fri Apr 24, 2015 4:49 pm
by 16670909
Hi Yeray.

It works good for me. Issue fixed.

Thanks, have a good weekend.

Alberto.