Page 1 of 1
Labels.Separation bug?
Posted: Fri Nov 21, 2003 6:44 pm
by 8122607
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?
Posted: Mon Nov 24, 2003 9:36 am
by Marc
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
Posted: Tue Nov 25, 2003 3:22 am
by 8122607
I sent a demo form that shows the issue.
Posted: Mon Jan 26, 2004 7:23 pm
by 8122607
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!!!!!
Posted: Tue Jan 27, 2004 12:59 pm
by Marc
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