Click event for Label ?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Jakob
Newbie
Newbie
Posts: 13
Joined: Fri Dec 05, 2003 5:00 am

Click event for Label ?

Post by Jakob » Wed Feb 25, 2004 4:50 pm

Hi, is it possible to catch events for clicking on the labels for
a series (the value/name on the y-axis)?

Regards
/Jakob

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Feb 26, 2004 10:32 am

Hi Jakob,

I've post one example which show you how to do this in VB.Net (WebApplication) to the steema.public.attachments newsgroup.
Hope that help you.

Jakob
Newbie
Newbie
Posts: 13
Joined: Fri Dec 05, 2003 5:00 am

Post by Jakob » Thu Feb 26, 2004 10:47 am

Hi!

I've post one example which show you how to do this in VB.Net (WebApplication) to the steema.public.attachments newsgroup.
I'm sorry, which newsgroup is this? I cant find this newsgroup anywhere?

Regards
/Jakob

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Feb 26, 2004 3:22 pm

Hi Jakob,

steema.public.attachments newsgroup.
You can find it at: news://www.berneda.com
If you're not able to connect with that post an email address here and I'll send it directly to you.

Jakob
Newbie
Newbie
Posts: 13
Joined: Fri Dec 05, 2003 5:00 am

Post by Jakob » Mon Mar 15, 2004 3:46 pm

Hi. I have looked at this sample, but it handles marks instead of labels.

I am trying to solve this by implementing the onClickBackground event, but the problem is that when I get there, the Labels collection of my axis is empty?

Code: Select all

private void onClickBackground(object sender,  ImageClickEventArgs e)
{
foreach( AxisLabelItem li in tChart1.Axes.Left.Labels.Items)
{
  if( li.ShapeBounds.Contains(e.X, e.Y) )
  {
     .....
What am I doing wrong?

Regards
/Jakob

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Tue Mar 16, 2004 1:19 pm

Hi Jacob,
What am I doing wrong?
Well, AxisLabelItem is used for Custom Labels, no default labels, as can be seen in the Feature Demo under:
All Features -> Welcome! -> Axes -> Labels -> Custom Labels.

To use your technique you would have to populate your Left Axis with Custom Labels.

I will add a ClickAxisLabel event to the wishlist of the TeeChart for .NET component.
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Jakob
Newbie
Newbie
Posts: 13
Joined: Fri Dec 05, 2003 5:00 am

Post by Jakob » Tue Mar 16, 2004 2:49 pm

Hi Christopher,

I have tried this, I added custom labels to my left axis, and in the onClickBackground event, I can find the labels.

However: The ShapeBounds property of the label items are always 0, so how can I find out which one that was clicked?

Regards
/Jakob

Christopher
Site Admin
Site Admin
Posts: 1349
Joined: Thu Jan 01, 1970 12:00 am
Location: Riudellots de la Selva, Catalonia
Contact:

Post by Christopher » Wed Mar 17, 2004 9:30 am

Hi Jacob,
I have tried this, I added custom labels to my left axis, and in the onClickBackground event, I can find the labels.

However: The ShapeBounds property of the label items are always 0, so how can I find out which one that was clicked?
You can get this to work by setting the AxisLabelItem to Transparent = false, e.g.

Code: Select all

tChart1.Axes.Left.Labels.Items.Add(50, "HELLO");
Steema.TeeChart.AxisLabelItem tLabel1 = tChart1.Axes.Left.Labels.Items[0];
tLabel1.Transparent = false;
tLabel1.Pen.Visible = false;
tLabel1.Brush.Visible = false;
Thank you!

Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/

Post Reply