How to color an axis?
How to color an axis?
In my project I need to colour 3 parts of the bottom axis into 3 different colors. How can I do this in teechart v2?
Thank you.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bairog,
I can think of 2 options here:
1. Use custom axes as told in Tutorial 4 - Axis Control and at the features demo (All Features\Welcome!\Axis). You'll find tutorials and demo at TeeChart's program group.
2. Overlap existing bottom axis with custom drawing, for example:
I can think of 2 options here:
1. Use custom axes as told in Tutorial 4 - Axis Control and at the features demo (All Features\Welcome!\Axis). You'll find tutorials and demo at TeeChart's program group.
2. Overlap existing bottom axis with custom drawing, for example:
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int YPos =tChart1.Axes.Bottom.Position;
g.Pen.Width = 2;
g.Pen.Color = Color.Green;
g.Line(tChart1.Axes.Bottom.IStartPos, YPos,
tChart1.Axes.Bottom.CalcXPosValue(5), YPos);
g.Pen.Color = Color.Yellow;
g.Line(tChart1.Axes.Bottom.CalcXPosValue(5), YPos,
tChart1.Axes.Bottom.CalcXPosValue(10), YPos);
g.Pen.Color = Color.Red;
g.Line(tChart1.Axes.Bottom.CalcXPosValue(10), YPos,
tChart1.Axes.Bottom.IEndPos, YPos);
}
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 |