Page 1 of 1
Click event for Label ?
Posted: Wed Feb 25, 2004 4:50 pm
by 8123134
Hi, is it possible to catch events for clicking on the labels for
a series (the value/name on the y-axis)?
Regards
/Jakob
Posted: Thu Feb 26, 2004 10:32 am
by Pep
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.
Posted: Thu Feb 26, 2004 10:47 am
by 8123134
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
Posted: Thu Feb 26, 2004 3:22 pm
by Pep
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.
Posted: Mon Mar 15, 2004 3:46 pm
by 8123134
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
Posted: Tue Mar 16, 2004 1:19 pm
by Chris
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.
Posted: Tue Mar 16, 2004 2:49 pm
by 8123134
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
Posted: Wed Mar 17, 2004 9:30 am
by Chris
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;