Labels.Separation bug?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
MTB
Newbie
Newbie
Posts: 30
Joined: Tue Mar 11, 2003 5:00 am
Location: USA
Contact:

Labels.Separation bug?

Post by MTB » Fri Nov 21, 2003 6:44 pm

In my charts, I'm experiencing very strange behavior whenever the following property is set to any value other than the default:

this.tChart1.Axes.Bottom.Labels.Separation = 20;

The above causes horizonal grid lines to appear very close together and the x-axis labels are so close as to be a solid black line. Any value has the same effect.

I would prefer to use use DateTime axes types, but various issues I've encountered have forced me away from this. Therefore, I have to set the axis labels to the dates in code.

However, the labels do not appear correctly -- they overlap. In order to fix that I have tried many things and none of the fixes work acceptably well.

How can I get the nicely separated horizontal (no angle) lables like a dateTime axis has by default?

Marc
Site Admin
Site Admin
Posts: 1214
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Mon Nov 24, 2003 9:36 am

Hello,

I can't reproduce this using a basic Chart with a Line Series. Please could you let us know what factors we need to set to reproduce the problem Chart or send us an exported .ten file of the Chart (to support@steema.com)

The separation property may have the effect of bunching as it overrides default inter label spacing to set a fixed minimum distance between Labels, regardless of Label size.

With thanks,
Best regards,
Marc Meumann
Steema Support

MTB
Newbie
Newbie
Posts: 30
Joined: Tue Mar 11, 2003 5:00 am
Location: USA
Contact:

Post by MTB » Tue Nov 25, 2003 3:22 am

I sent a demo form that shows the issue.

MTB
Newbie
Newbie
Posts: 30
Joined: Tue Mar 11, 2003 5:00 am
Location: USA
Contact:

Post by MTB » Mon Jan 26, 2004 7:23 pm

Hi,

I appreciate the prior help on this topic, but this problem is still an open issue for me. The workaround provided previously is insufficient, and the latest release has apparently not addressed this problem.

Here is the background. Steema support previously sent me a solution to this issue, based on my demo of the problem. Here is the code that was provided for the workaround, in case others wish to use it:

private void PlotLine1()
{
for(int i = 0; i < dateTimeArray.Length; ++i) {
if(i % 35 == 0) {
line3.Add(dateTimeIndexes, curve, labels);
}
else {
line3.Add(dateTimeIndexes, curve);
}
}
line3.RefreshSeries();
tChart1.Axes.Left.AdjustMaxMin();
}//PlotLine1

However, there are several problems with this workaround. Mainly, it is too simplistic. For example, what about the case when there are only 5 data points on the x-axis. Obviously, the chart should show all 5, but with this workaround, only one label is shown. At the other extreme, if there are thousands of x-axis data points, the proposed workaround doesn't solve the original problem at all. The labels still bunch up and overlap.

What is needed is an intelligent algorithm, similar to the one already built into TeeChart. Of course I might be able to design and implement such an algorithm with some effort, but I am hoping Steema support can provide me with some ready to use code. I'm sure you have something to address this because the charts are normally able to display the labels without bunching.

The root problem in my case is that I'm forced to use custom axis labels because of the ColorGrid requirements. I'm told some changes are coming for the ColorGrid, but until then I assume I must keep using custom axis lables.

I hope you can share with me some code for making custom axis labels display properly (no bunching and always an appropriate number of labels for the amount of data). Thanks!!!!! :wink:

Marc
Site Admin
Site Admin
Posts: 1214
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Tue Jan 27, 2004 12:59 pm

Hello,

This is a bug, TeeChart should handle the sizing of Label spacing when Separation is not set to 0. We have re-examined the problem in relation to the sample project you sent and the issue has been resolved for the next maintenance release (update imminent).

Regards,
Marc Meumann
Steema Support

Post Reply