Page 1 of 1
Labels on bottom axis
Posted: Mon Nov 02, 2009 9:55 pm
by 14045174
I happen to have a graph with labels on the bottom axis. The labels are long, so to see the text I've rotated them by 315 degrees...
In Win32 I was getting the following result, which was fine:
- Labels Win32.jpg (7.55 KiB) Viewed 5175 times
But the same graph under .NET does not work. The default behavior is broken and I cannot find any way to fix if (and no custom code, please! My users do not know how to write it!)
- Labels .NET.jpg (8.5 KiB) Viewed 5177 times
Re: Labels on bottom axis
Posted: Tue Nov 03, 2009 3:11 pm
by yeray
Hi UserLS,
I've been able to reproduce it and I've added it to the wish list to be improved in future releases (TF02014529). In the meanwhile, you could use OnGetAxisLabels event to workaround this doing something similar to this:
Code: Select all
void Bottom_GetAxisDrawLabel(object sender, Steema.TeeChart.GetAxisDrawLabelEventArgs e)
{
if (checkBox1.Checked)
{
if ((tChart1.Axes.Bottom.Labels.Angle > 90) & (tChart1.Axes.Bottom.Labels.Angle < 180))
{
e.Y = e.Y + 20;
}
else if ((tChart1.Axes.Bottom.Labels.Angle > 180) & (tChart1.Axes.Bottom.Labels.Angle < 270))
{
e.Y = e.Y + 20;
}
else if ((tChart1.Axes.Bottom.Labels.Angle > 270) & (tChart1.Axes.Bottom.Labels.Angle < 360))
{
e.Y = e.Y + 20;
e.X = e.X + 15;
}
}
}
Re: Labels on bottom axis
Posted: Mon Nov 30, 2009 10:09 pm
by 14045174
Besides the fact that this code looks very strange (why 20 pixels? why 15 pixels? Should it depend on the fonts?), I did add it and assigned event to the axis, but the event is fired only when graph is physically shown on your screen. Doing it in memory does not trigger the event even when calling the Draw() method. Also, if my bottom axis has a title and I am not showing anything below the graph (i.e. legend, footer, subfooter) than the suggested code makes my title disappear...
And this is just one of possibly several axes on the graph with different problems for each. Bottom line - can you guys fix your bugs, please?
Re: Labels on bottom axis
Posted: Fri Dec 04, 2009 4:06 pm
by yeray
Hi UserLS,
We have been investigating the issue and a fix for it is quite complicated as involves important code modifications. We will continue investigating it for future releases.