I need to label ends of all axes with their names. I can't use titles because they are drawn in the middle of axes (or maybe there is way to draw them at the end if axis?). So I tried to use custom labels. But if I use Axis.Labels.Items.Add method all other label are erased. How can I add end label without erasing the others?
One more question: is there any way to draw arrows at the end of axis that will behave like a part of this axis (rotate, elevate and zoom with it)?
Thank you.
Custom labels in addition to usual ones
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bairog,
You can try using an annotation tool positioned at the end of the axis, for example:
You can try using an annotation tool positioned at the end of the axis, for example:
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
line1.FillSampleValues();
Bitmap bmp = tChart1.Bitmap;
}
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
Steema.TeeChart.Tools.Annotation AnnotationBottom = new Steema.TeeChart.Tools.Annotation(tChart1.Chart);
AnnotationBottom.Text = "My Bottom Title";
AnnotationBottom.Left = tChart1.Axes.Bottom.IEndPos + 20;
AnnotationBottom.Top = tChart1.Axes.Bottom.Position + 20;
}
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 |
I use 3D openGL chart. So there is problem with positioning depth axis annotation: annotations are drawn in the XY (front) plane, so I can't put it to the correct place (to the end of depth axis) and after rotation/elevation it appers at the wrong position. Maybe there is a way to set annotation's Z position? Or maybe you can recommend me something else to label the end of depth axis?
Thank you.
Thank you.
I use non-orthogonal 3D chart so your code workes incorrectly:
We've discussed this problem here
There is enother notice:
We've discussed this problem here
There is enother notice:
AfterDraw event does not work(no annotation appears), I use series' AfterDrawValues event instead and it worked properly (by the way it was not the first time I've discovered this). Do you have any idea why this happens?narcis wrote:Hi bairog,
You can try using an annotation tool positioned at the end of the axis, for example:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi bairog,
AfterDraw event will work fine provided you use the Bitmap trick in my code example to force the event being fired.
There's no way to set a Z position for annotation tools. However drawing on TeeChart's canvas allows you setting a z position:
Anyway, as I told you in other threads, this text will be also rotated/elevated with the chart.
AfterDraw event will work fine provided you use the Bitmap trick in my code example to force the event being fired.
There's no way to set a Z position for annotation tools. However drawing on TeeChart's canvas allows you setting a z position:
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.Font.Color = Color.Red;
g.Font.Size = 12;
g.TextOut(tChart1.Axes.Bottom.IEndPos + 20, tChart1.Axes.Bottom.Position,
tChart1.Axes.Depth.IEndPos, "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 |
-
- Newbie
- Posts: 38
- Joined: Thu Feb 01, 2007 12:00 am
I am trying to do something similar to what is mentioned in this issue.
I want to place a label on each of my vertical axes.
If I use the AfterDraw handler and within there I create the annotation tools to make the labels, it works except for the fact that the labels don't actually appear on my graph until the NEXT time the draw is fired.
I notice that there does not appear to be a AfterDrawValues handler any more so that seems to not be an option.
I see what you refer to as the bitmap trick but that would cause the chart to have to render twice. And with some of our larger plots, this would be a horrible performance hit.
Is there another way to get these labels to draw properly at the time the chart itself is drawn?
Thanks.
Aaron Peronto
I want to place a label on each of my vertical axes.
If I use the AfterDraw handler and within there I create the annotation tools to make the labels, it works except for the fact that the labels don't actually appear on my graph until the NEXT time the draw is fired.
I notice that there does not appear to be a AfterDrawValues handler any more so that seems to not be an option.
I see what you refer to as the bitmap trick but that would cause the chart to have to render twice. And with some of our larger plots, this would be a horrible performance hit.
Is there another way to get these labels to draw properly at the time the chart itself is drawn?
Thanks.
Aaron Peronto
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Aaron,
You could either try using the Bitmap trick in the form constructor or Load event or try using the annotation tool creation code in BeforeDrawAxes event or BeforeDrawSeries event.
You could either try using the Bitmap trick in the form constructor or Load event or try using the annotation tool creation code in BeforeDrawAxes event or BeforeDrawSeries event.
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: 38
- Joined: Thu Feb 01, 2007 12:00 am
Excellent!
Putting the code in the BeforeDrawSeries works fine.
I was not sure when all of the information for the axes positions and visibility would be complete and available for me to determine which axes are visible and should have labels drawn and where those labels should be located based on the position of each axis.
This works perfectly.
Thanks again.
Putting the code in the BeforeDrawSeries works fine.
I was not sure when all of the information for the axes positions and visibility would be complete and available for me to determine which axes are visible and should have labels drawn and where those labels should be located based on the position of each axis.
This works perfectly.
Thanks again.