Show a point that does not lie on a series
Show a point that does not lie on a series
In an application using tchart, is there anyway to show marker on some x and y value which is not on the series (line/curve)?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lakshmi,
Yes, you can do something like the code below custom drawing on TeeChart's canvas.
Yes, you can do something like the code below custom drawing on TeeChart's canvas.
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int x=tChart1.Axes.Bottom.CalcPosValue(5.3);
int y=tChart1.Axes.Left.CalcPosValue(76.2);
g.TextOut(x,y,"My custom text");
}
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 |
Show a point that does not lie on a series
Hi Narcis,
g.TextOut does solve the problem, but our requirement is to draw a mark such "X" or a circle at a given X & Y value. I guess we can do this using g.Ellipse or g.Line. But I was wondering if there was a easier way to do it, say by just giving X & Y value T-Chart should be able to draw the mark.
Also related question is, I use g.Ellipse or g.Line and draw the mark, I would need a way to even erase the mark, how can we achieve that? I guess one way would be to call invalidate, right?
g.TextOut does solve the problem, but our requirement is to draw a mark such "X" or a circle at a given X & Y value. I guess we can do this using g.Ellipse or g.Line. But I was wondering if there was a easier way to do it, say by just giving X & Y value T-Chart should be able to draw the mark.
Also related question is, I use g.Ellipse or g.Line and draw the mark, I would need a way to even erase the mark, how can we achieve that? I guess one way would be to call invalidate, right?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lakshmi,
To achieve that you may like to use a bubble series which already have their own marks implemented. In a bubble series you can specify the X and Y coordinates for the center and the radius for each bubble.g.TextOut does solve the problem, but our requirement is to draw a mark such "X" or a circle at a given X & Y value. I guess we can do this using g.Ellipse or g.Line. But I was wondering if there was a easier way to do it, say by just giving X & Y value T-Chart should be able to draw the mark.
Then you should also consider using Annotation tools as I told you in previous posts.Also related question is, I use g.Ellipse or g.Line and draw the mark, I would need a way to even erase the mark, how can we achieve that? I guess one way would be to call invalidate, right?
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 |
Show a point that does not lie on a series
Hi Narcis,
If i use a bubble series and only one point in that series the bubble mark does not appear.
It needs more than one point to be added to the series for the marks to be visible. Am I right?
ANy thoughts?
If i use a bubble series and only one point in that series the bubble mark does not appear.
It needs more than one point to be added to the series for the marks to be visible. Am I right?
ANy thoughts?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lakshmi,
No, it works fine using only one bubble in a chart but it's somewhat tricky as you need to use:
You could also try using a shape series instead of a bubble series.
No, it works fine using only one bubble in a chart but it's somewhat tricky as you need to use:
Code: Select all
private void Form1_Load(object sender, System.EventArgs e)
{
bubble1.Add(0,0,10,"My bubble",Color.Red);
bubble1.Marks.Visible=true;
tChart1.Axes.Bottom.SetMinMax(bubble1.XValues[0]-bubble1.RadiusValues[0],bubble1.XValues[0]+bubble1.RadiusValues[0]);
tChart1.Axes.Left.SetMinMax(bubble1.YValues[0]-bubble1.RadiusValues[0],bubble1.YValues[0]+bubble1.RadiusValues[0]);
}
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 |
Show a point that does not lie on a series
Thanks Narcis for suggesting shape series.
But I have a problem.
I have draw closely seperated vertical lines (0.1 distance) and the bubble/shape is drawn on the "band" of these closely seperated vertical lines.
So the bubble/shape gets hidden behind these vertical lines since they are so close. I tried setting the transparency value for the bubble/shape but it does not work.
Any ideas/suggestions?
But I have a problem.
I have draw closely seperated vertical lines (0.1 distance) and the bubble/shape is drawn on the "band" of these closely seperated vertical lines.
So the bubble/shape gets hidden behind these vertical lines since they are so close. I tried setting the transparency value for the bubble/shape but it does not work.
Any ideas/suggestions?
Show a point that does not lie on a series
Hi Narcis,
Would there be anyway to show the bubble/shape series on top of the closely seperated line series?
Thanks
Would there be anyway to show the bubble/shape series on top of the closely seperated line series?
Thanks
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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 |
Show a point that does not lie on a series
How do I find out whether a given point exists on series?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lakshmi,
You can try doing something like:
You can try doing something like:
Code: Select all
if (line1.YValues.IndexOf(value) != -1)
{
//Value exists
}
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 |
Show a point that does not lie on a series
Thanks Narcis,
Is there a way to explicitly set the Z-Order of a series? (rather than doing an exchange later on).
Is there a way to explicitly set the Z-Order of a series? (rather than doing an exchange later on).
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Lakshmi,
Yes, you can use something like this:
Yes, you can use something like this:
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
int old_order = line1.ZOrder;
line1.ZOrder = line2.ZOrder;
line2.ZOrder = old_order;
}
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 |