Hi
I have a line series with about 1000 points.
I would like to have some of the points have a visible mark e.g. a square and then be able to click these points and act on the event. But I do not want the rest of the points to be marked and clickable.
Is that possible? How?
Thanks in advance
Lars Iversen
Individual Points marked by a square and clickable
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lars,
Yes, this is possible. You need to do like this:
Please notice that you need to associate a series click event as well. This is because we detected that ClickPointer event is wrongly implemented and thus it wouldn't be raised. Now we are trying to implement a solution for future releases but, in the meantime, this trick is necessary.
Yes, this is possible. You need to do like this:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
line1.FillSampleValues();
line1.Pointer.Visible=true;
}
private void line1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventArgs e)
{
if ((series.YValues[e.ValueIndex]%2)==0)
e.Style=Steema.TeeChart.Styles.PointerStyles.Rectangle;
else
e.Style=Steema.TeeChart.Styles.PointerStyles.Nothing;
}
private void line1_ClickPointer(Steema.TeeChart.Styles.CustomPoint series, int valueIndex, int x, int y)
{
tChart1.Header.Text="Point "+valueIndex.ToString()+" clicked";
}
private void line1_Click(object sender, MouseEventArgs e)
{
//Trick to force ClickPointer event being raised
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lars,
The event is raised because the pointer is also visible for those points but set to Nothing. However, you can ignore them by using something like this:
The event is raised because the pointer is also visible for those points but set to Nothing. However, you can ignore them by using something like this:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
line1.FillSampleValues();
line1.Pointer.Visible=true;
}
private void line1_GetPointerStyle(Steema.TeeChart.Styles.CustomPoint series, Steema.TeeChart.Styles.CustomPoint.GetPointerStyleEventArgs e)
{
if (Screenpoints(e.ValueIndex))
e.Style=Steema.TeeChart.Styles.PointerStyles.Rectangle;
else
e.Style=Steema.TeeChart.Styles.PointerStyles.Nothing;
}
private bool Screenpoints(int index)
{
return line1.YValues[index] % 2 == 0;
}
private void line1_ClickPointer(Steema.TeeChart.Styles.CustomPoint series, int valueIndex, int x, int y)
{
if (Screenpoints(valueIndex))
tChart1.Header.Text = "Point " + valueIndex.ToString() + " clicked";
}
private void line1_Click(object sender, MouseEventArgs e)
{
//Trick to force ClickPointer event being raised
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph
Hi Narcís
But all thiss assumes that it is for the points with the value 0 that I want to be clickable. But that is not the case.
In my head it is like this:
I have many points.
Some of the points has a text-label others do not.
The points with the text label has to be clickable the rest may not be clickable.
Is it not possible to get like a "point-object" from a series and work on properties like label, yvalue, xvalue, pointerstyle etc and then when that point is clicked ask if it has a square mark as pointerstyle and work from there?
(Maybe this is real newbie question)
Thanks
Lars Iversen
But all thiss assumes that it is for the points with the value 0 that I want to be clickable. But that is not the case.
In my head it is like this:
I have many points.
Some of the points has a text-label others do not.
The points with the text label has to be clickable the rest may not be clickable.
Is it not possible to get like a "point-object" from a series and work on properties like label, yvalue, xvalue, pointerstyle etc and then when that point is clicked ask if it has a square mark as pointerstyle and work from there?
(Maybe this is real newbie question)
Thanks
Lars Iversen
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lars,
Screenpoints is true when the indexed point Y value is a multiple of 2. That's just an easy sample condition I used to make an example which you can change for something like this:
to check wether a point has a text label or not. The "point-object" class you can use is Steema.TeeChart.Styles.SeriesXYPoint which is what is used in the example above when doing line1[index].
Screenpoints is true when the indexed point Y value is a multiple of 2. That's just an easy sample condition I used to make an example which you can change for something like this:
Code: Select all
private bool Screenpoints(int index)
{
return line1[index].Label!="";
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 61
- Joined: Wed Jun 22, 2005 4:00 am
- Location: cph