Axistitle above the axis
Axistitle above the axis
Hello
I have a question about the axis.title:
The Text appears always in the middle of the axis. Can i move this label and place it above the axis?
Greetings
Elric
I have a question about the axis.title:
The Text appears always in the middle of the axis. Can i move this label and place it above the axis?
Greetings
Elric
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello Elric,
I'm afraid not. You can change it's size and angle but not the position. However you can draw directly on the canvas so that you can place your "custom title" wherever you want.
For help on how to draw on the canvas please have a look at Tutorial 13 - Custom Drawing on the Chart Panel. The tutorials are available at the TeeChart program group.
I'm afraid not. You can change it's size and angle but not the position. However you can draw directly on the canvas so that you can place your "custom title" wherever you want.
For help on how to draw on the canvas please have a look at Tutorial 13 - Custom Drawing on the Chart Panel. The tutorials are available at the TeeChart program group.
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 |
Hello Narcis
I still have serveral problems to place the custom label at the correct position above the axis, because the number and position of the axes are variable (user can make series and axes (in)visible). So i have between 1 and 10 axes on the left side and the legend above.
The problem is the following: Because of the variable number of series, the height of legend is not fix and so the height of the left axes depends on the height of the legend. How can i calculate the "Top"-value of my custom labels, if i dont know the height of the axes. The "Left"-value is a problem, too, because i only have the relative position (to the chart) of the axis.
Do you have any idea?
Greetings
Elric
I still have serveral problems to place the custom label at the correct position above the axis, because the number and position of the axes are variable (user can make series and axes (in)visible). So i have between 1 and 10 axes on the left side and the legend above.
The problem is the following: Because of the variable number of series, the height of legend is not fix and so the height of the left axes depends on the height of the legend. How can i calculate the "Top"-value of my custom labels, if i dont know the height of the axes. The "Left"-value is a problem, too, because i only have the relative position (to the chart) of the axis.
Do you have any idea?
Greetings
Elric
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Elric,
Yes, you can get the axes size and position implementing the AfterDraw event like:
Yes, you can get the axes size and position implementing the AfterDraw event like:
Code: Select all
private void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int Size = tChart1.Axes.Left.IAxisSize;
tChart1.Axes.Left.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
int Pos=tChart1.Axes.Left.Position;
label1.Text="Left Axis Size: " + Size.ToString() + ", Lext Axis Position: " + Pos.ToString();
}
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 |
Hello Narcis
Thank you again for your answer. I always ignored the "IAxisSize", maybe because I presumed its a interface not a public integer. I hope you accept my excuse.
So the space above the axis is
May I ask you for another hint for calculating axis position. Because I have up to 10 axes on left side and all have very different values, so the axis all has different width. (f.e. I have axis labels with "100000" and other axis with "0.1"). At the moment I calculate the width of a axis like this:
In most cases I get the correct width, but not always (f.e. if the "Maximum" has the not biggest text). Is there a easier way to get the width of a axis?
Thank you. Greetings,
Elric
Thank you again for your answer. I always ignored the "IAxisSize", maybe because I presumed its a interface not a public integer. I hope you accept my excuse.
So the space above the axis is
Code: Select all
Axis.IEndPos - Axis.Size
Code: Select all
o.Axis.Labels.LabelWidth(Trend.Axis.Maximum) + o.Axis.Ticks.Length + 8
Thank you. Greetings,
Elric
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Elric,
Using this code you set screen co-ordinate where axis is drawn, or to set the axis relative position to the chart use:
Don't mention it !I hope you accept my excuse.
Yes, you can use:May I ask you for another hint for calculating axis position.
Code: Select all
tChart1.Axes.Bottom.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
tChart1.Axes.Bottom.Position = 5;
Code: Select all
tChart1.Axes.Bottom.PositionUnits = Steema.TeeChart.PositionUnits.Pixels;
tChart1.Axes.Bottom.RelativePosition = 5;
Yes, use tChart1.Axes.Bottom.AxisPen.Width.Is there a easier way to get the width of a axis?
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 |
Hello Narcis
Thats not what I wanted, sorry. Maybe I described my problem misrepresent. I know how to set the position of a axis, what I wanted is a easier way to calculate the correct position of the axes, so that they dont overlap. The property "tChart1.Axes.Bottom.AxisPen.Width" only shows the width of the pen, that draws that single axis line.
I need the whole space a (left) axis (including labels) needs: it is the sum of
Width of the axis line (AxisPen.Width),
Lenght of the major ticks (Axis.Ticks.Length) and
Lenght of the longest AxisLabel (to get this, I must look over all AxisLabels and search for the longest value).
My question is: exists a property that gives me that sum, or must I calculate thís sum as described above? (If you dont have a answer right now, dont matter, because my code works at the moment, its even very inconvenient).
Greetings,
Elric
Thats not what I wanted, sorry. Maybe I described my problem misrepresent. I know how to set the position of a axis, what I wanted is a easier way to calculate the correct position of the axes, so that they dont overlap. The property "tChart1.Axes.Bottom.AxisPen.Width" only shows the width of the pen, that draws that single axis line.
I need the whole space a (left) axis (including labels) needs: it is the sum of
Width of the axis line (AxisPen.Width),
Lenght of the major ticks (Axis.Ticks.Length) and
Lenght of the longest AxisLabel (to get this, I must look over all AxisLabels and search for the longest value).
My question is: exists a property that gives me that sum, or must I calculate thís sum as described above? (If you dont have a answer right now, dont matter, because my code works at the moment, its even very inconvenient).
Greetings,
Elric
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hello Elric,
Thanks for your explanation and sorry for not having understood what you request before. No, there's not a property that gives you that dimension, you have to calculate it.
Thanks for your explanation and sorry for not having understood what you request before. No, there's not a property that gives you that dimension, you have to calculate it.
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 |