OnClickSeries Vs Transparent

TeeChart for ActiveX, COM and ASP
Post Reply
AlbertoRG
Newbie
Newbie
Posts: 16
Joined: Fri Dec 05, 2014 12:00 am

OnClickSeries Vs Transparent

Post by AlbertoRG » Fri Apr 24, 2015 1:49 pm

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.
Attachments
marks.JPG
marks.JPG (29.13 KiB) Viewed 11317 times
Thanks, best regards.

Yeray
Site Admin
Site Admin
Posts: 9534
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: OnClickSeries Vs Transparent

Post by Yeray » Fri Apr 24, 2015 3:41 pm

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
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

AlbertoRG
Newbie
Newbie
Posts: 16
Joined: Fri Dec 05, 2014 12:00 am

Re: OnClickSeries Vs Transparent

Post by AlbertoRG » Fri Apr 24, 2015 4:22 pm

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
Thanks, best regards.

AlbertoRG
Newbie
Newbie
Posts: 16
Joined: Fri Dec 05, 2014 12:00 am

Re: OnClickSeries Vs Transparent

Post by AlbertoRG » Fri Apr 24, 2015 4:31 pm

Hi aGain..

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

Thanks again.
Thanks, best regards.

AlbertoRG
Newbie
Newbie
Posts: 16
Joined: Fri Dec 05, 2014 12:00 am

Re: OnClickSeries Vs Transparent

Post by AlbertoRG » Fri Apr 24, 2015 4:49 pm

Hi Yeray.

It works good for me. Issue fixed.

Thanks, have a good weekend.

Alberto.
Thanks, best regards.

Post Reply