Hi,
We are a few versions behind with TeeChart (3.5.3188.18561), but all has been working fine until now... We have a few charts with fairly long bottom axis labels, so we are rotating the text. The problem is that this leaves huge white margins under the chart...
Is there a way to fix this? We would rather not update to a recent version of TeeChart because there are always many backward-compatibility issues, and we simply have no time for that.
Best,
Michal
Huge margins on plots with long rotated axis labels
-
- Newbie
- Posts: 64
- Joined: Fri Jun 16, 2006 12:00 am
Huge margins on plots with long rotated axis labels
Best,
Michal Blazejczyk
Lead Programmer
Genome Quebec
Michal Blazejczyk
Lead Programmer
Genome Quebec
Re: Huge margins on plots with long rotated axis labels
Hi Michal,
Yes, I've seen that the bottom margin calculated when having long bottom axis labels with an oblique angle seems to be like the angle were 90.
I've added it to the defect list to be revised in future releases (TF02014926).
Yes, I've seen that the bottom margin calculated when having long bottom axis labels with an oblique angle seems to be like the angle were 90.
I've added it to the defect list to be revised in future releases (TF02014926).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 64
- Joined: Fri Jun 16, 2006 12:00 am
Re: Huge margins on plots with long rotated axis labels
Hi,
Does it mean that it doesn't work well in even recent versions, either? That's sad...
Best,
Michal
Does it mean that it doesn't work well in even recent versions, either? That's sad...
Best,
Michal
Re: Huge margins on plots with long rotated axis labels
Hi Michal,
What I've seen is that we fixed a similar problem some time ago that may be related (TF02013509) but it's not exactly the same.
What I've seen is that we fixed a similar problem some time ago that may be related (TF02013509) but it's not exactly the same.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 64
- Joined: Fri Jun 16, 2006 12:00 am
Re: Huge margins on plots with long rotated axis labels
Hi Yeray,
In this case I'm even more surprised because issue TF02013509 you mention is a manifestation of the same problem that I described. It was reported in October 2008, and it is still not fixed???
Could you suggest a workaround, i.e. a way of detecting this situation, and manually making the plot area bigger so that there is no white space under the axis labels?
Best,
Michal
In this case I'm even more surprised because issue TF02013509 you mention is a manifestation of the same problem that I described. It was reported in October 2008, and it is still not fixed???
Could you suggest a workaround, i.e. a way of detecting this situation, and manually making the plot area bigger so that there is no white space under the axis labels?
Best,
Michal
Best,
Michal Blazejczyk
Lead Programmer
Genome Quebec
Michal Blazejczyk
Lead Programmer
Genome Quebec
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Huge margins on plots with long rotated axis labels
Hi Michal,
It seems TF02013509 fixed this for labels at 90 degrees but not for other possible valuesIn this case I'm even more surprised because issue TF02013509 you mention is a manifestation of the same problem that I described. It was reported in October 2008, and it is still not fixed???
What about something as the code below? You can tweak the AfterDraw event a little bit to enhance the workaround.Could you suggest a workaround, i.e. a way of detecting this situation, and manually making the plot area bigger so that there is no white space under the axis labels?
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Legend.Visible = false;
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
string label = "this is a very long label for testing";
line1.Add(3, label);
line1.Add(5, label);
line1.Add(7, label);
line1.Add(2, label);
tChart1.Axes.Bottom.Labels.Angle = 0;
tChart1.GetAxisLabel += new Steema.TeeChart.GetAxisLabelEventHandler(tChart1_GetAxisLabel);
tChart1.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDraw);
Timer timer1 = new Timer();
timer1.Interval = 1000;
timer1.Tick += new EventHandler(timer1_Tick);
timer1.Enabled = true;
}
void tChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
int angle = tChart1.Axes.Bottom.Labels.Angle;
if (angle != 0)
{
int labelSize = tChart1.Axes.Bottom.MaxLabelsWidth();
double factor = Math.Sin(angle);
double margin = labelSize * Math.Abs(factor);
tChart1.Panel.MarginUnits = Steema.TeeChart.PanelMarginUnits.Pixels;
tChart1.Panel.MarginBottom = margin;
}
}
void timer1_Tick(object sender, EventArgs e)
{
tChart1.Axes.Bottom.Labels.Angle = (tChart1.Axes.Bottom.Labels.Angle + 10 % 360);
}
void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if (sender.Equals(tChart1.Axes.Bottom))
{
if (e.LabelText.Length > 15)
{
e.LabelText = string.Format("{0}{1}", e.LabelText.Substring(0, 15), "...");
}
}
}
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 |