Hi,
I would like my 3d chart to have a tool like the ColorLine, but with the resulting rectangle filled in and partially transparent. Is there a way to do that with a ColorLine, or will I need to draw a shape myself?
If I need to draw it myself, what method can I use to draw a rectangle oriented like a ColorLine tool based on the left axis, with all 4 corners having the same X value?
Jay
ColorLine with fill?
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jay,
I'm afraid ColorLine doesn't support this. However you can achieve what you request custom drawing on TeeChart's canvas in its AfterDraw event and using something like this:
I'm afraid ColorLine doesn't support this. However you can achieve what you request custom drawing on TeeChart's canvas in its AfterDraw event and using something like this:
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int rectPos = tChart1.Axes.Left.CalcYPosValue(points1.MinYValue() + ((points1.MinYValue() + points1.MaxYValue()) / 2));
g.Pen.Color = Color.Red;
g.Brush.Color = Color.Red;
g.Brush.Transparency = 50;
g.RectangleY(tChart1.Axes.Bottom.IStartPos, rectPos, tChart1.Axes.Bottom.IEndPos, 0, tChart1.Axes.Depth.IEndPos);
}
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 |
ColorLine with fill?
Narcís,
Thanks for the suggestion. I need a vertical rectangle instead of a horizontal one, but I don't see a RectangleX method. None of the other Rectangle methods seem to do what I want. Is there another method I could use?
Jay
Thanks for the suggestion. I need a vertical rectangle instead of a horizontal one, but I don't see a RectangleX method. None of the other Rectangle methods seem to do what I want. Is there another method I could use?
Jay
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jay,
Yes, in that case you can use RectangleZ:
Yes, in that case you can use RectangleZ:
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int hRectPos = tChart1.Axes.Left.CalcYPosValue(points1.MinYValue() + ((points1.MinYValue() + points1.MaxYValue()) / 2));
int vRectPos = tChart1.Axes.Bottom.CalcXPosValue(points1.MinXValue() + ((points1.MinXValue() + points1.MaxXValue()) / 2));
g.Pen.Color = Color.Red;
g.Brush.Color = Color.Red;
g.Brush.Transparency = 50;
g.RectangleY(tChart1.Axes.Bottom.IStartPos, hRectPos, tChart1.Axes.Bottom.IEndPos, 0, tChart1.Axes.Depth.IEndPos);
g.RectangleZ(vRectPos, tChart1.Axes.Left.IStartPos, tChart1.Axes.Left.IEndPos, 0, tChart1.Axes.Depth.IEndPos);
}
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 |
ColorLine with fill?
Thanks!
Now if there was a way get the chart series lines to pass "through" the rectangle instead of being drawn "in front of" it or "behind" it, that would be REALLY cool! Very hard to do though, I imagine...
Jay
Now if there was a way get the chart series lines to pass "through" the rectangle instead of being drawn "in front of" it or "behind" it, that would be REALLY cool! Very hard to do though, I imagine...
Jay
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Jay,
Yes, this is possible doing the custom drawing in the BeforeDrawSeries event. Something like this:
Yes, this is possible doing the custom drawing in the BeforeDrawSeries event. Something like this:
Code: Select all
private void DrawRectangles(Steema.TeeChart.Drawing.Graphics3D g)
{
int hRectPos = tChart1.Axes.Left.CalcYPosValue(points1.MinYValue() + ((points1.MinYValue() + points1.MaxYValue()) / 2));
int vRectPos = tChart1.Axes.Bottom.CalcXPosValue(points1.MinXValue() + ((points1.MinXValue() + points1.MaxXValue()) / 2));
g.Pen.Color = Color.Red;
g.Brush.Visible = true;
g.Brush.Color = Color.Red;
g.Brush.Transparency = 50;
g.RectangleY(tChart1.Axes.Bottom.IStartPos, hRectPos, tChart1.Axes.Bottom.IEndPos, 0, tChart1.Axes.Depth.IEndPos);
g.RectangleZ(vRectPos, tChart1.Axes.Left.IStartPos, tChart1.Axes.Left.IEndPos, 0, tChart1.Axes.Depth.IEndPos);
}
private void tChart1_BeforeDrawSeries(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
DrawRectangles(g);
}
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 |