Page 1 of 1

No effect with Axes.Bottom.Labels.Separation = 0;

Posted: Thu Aug 29, 2013 6:29 am
by 15666870
Dear all,


Version: TeeChartNET2013_4.1.2013.07300
Visual Studio 2012
Windows 7 32 bit

We have a chart with bottom axis as follows:

tChart1.Aspect.ClipPoints = true; //Cut values that are outside ChartRect
tChart1.Aspect.View3D = false;
tChart1.AutoRepaint = false;
tChart1.Axes.Bottom.Automatic = false;
tChart1.Axes.Bottom.Labels.DateTimeFormat = "HH:mm:ss";
tChart1.Axes.Bottom.Labels.Font.Name = "Arial";
tChart1.Axes.Bottom.Labels.Font.Size = 10;
tChart1.Axes.Bottom.Labels.RoundFirstLabel = false;
tChart1.Axes.Bottom.Labels.Separation = 0; //Disable automatic control of the increment factor
tChart1.Axes.Bottom.Labels.Style = AxisLabelStyle.Value; //Labels display axis scales
tChart1.Axes.Bottom.Title.Font.Name = "Arial";
tChart1.Axes.Bottom.Title.Font.Size = 12;
tChart1.Axes.Depth.Visible = false;
tChart1.Axes.DepthTop.Visible = false;
tChart1.Axes.Left.Visible = false;
tChart1.Axes.Right.Visible = false;
tChart1.Axes.Top.Visible = false;


Even though tChart1.Axes.Bottom.Labels.Separation = 0 the labels with grid lines are changed automatically
as seen on the enclosed screen dumps.

The increment of the bottom axis of the chart shown on the screen dumps is set like this:
tChart1.Axes.Bottom.Increment = Utils.DateTimeStep[(int)DateTimeSteps.OneHour];

The difference between the two screen dumps is that another Y-axis was added,
and thereby the width of the chart was reduced a litte (on purpose).
In this case the labels should simply overlap, as I then intend to hide every other label in the "tChart1_GetAxisLabel" event.

How can it be that the labels and grid lines are still automatically adjusted, and how can this mechanism be turned off,
if not by setting tChart1.Axes.Bottom.Labels.Separation to 0?


Thanks in advance!

Re: No effect with Axes.Bottom.Labels.Separation = 0;

Posted: Fri Aug 30, 2013 1:55 pm
by yeray
Hi,

The only way I can think on would be to use custom labels to define the exact labels you want to show.
See the example at "All Features\Welcome !\Axes\Labels\Custom labels" in the features demo.

Re: No effect with Axes.Bottom.Labels.Separation = 0;

Posted: Sat Aug 31, 2013 12:51 pm
by 15666870
Does this mean that the function of Labels.Separation in TChart .net version is not the same as the function in the VCL version??

In the VCL version (2010) setting Labels.Separation to 0 turned the automatic overlap prevention off!

Re: No effect with Axes.Bottom.Labels.Separation = 0;

Posted: Mon Sep 02, 2013 9:51 am
by narcis
Hi JohnS,

Labels.Separation won't let labels to overlap in .NET. You are right, this behavior differs from the VCL version.

Re: No effect with Axes.Bottom.Labels.Separation = 0;

Posted: Mon Sep 02, 2013 11:05 am
by 15666870
Hi NarcĂ­s,

Thanks for the answer.

With the VCL version I allowed the labels to overlap, and then I hided every second label in the "tChart1_GetAxisLabel" event myself.
This way I still had all grid lines, but only a label on every second grid line.
How can I achieve this with the .net version?

By the way: can you help us out with the critical issue with the license problem described in my other post?
It starts to get embarrassing for us (and for Steema...?).
We paid for a license, so it is ironic, that the license appears to cause problems.

Re: No effect with Axes.Bottom.Labels.Separation = 0;

Posted: Mon Sep 02, 2013 11:45 am
by narcis
Hi JohnS,
With the VCL version I allowed the labels to overlap, and then I hided every second label in the "tChart1_GetAxisLabel" event myself.
This way I still had all grid lines, but only a label on every second grid line.
How can I achieve this with the .net version?
You can add blank spaced custom labels every second point, for example:

Code: Select all

      tChart1.Axes.Bottom.Labels.Items.Clear();

      for (int i = 0; i < bar1.Count; i++)
      {
        string text = (i % 2 != 0) ? " " : bar1.XValues[i].ToString();
        tChart1.Axes.Bottom.Labels.Items.Add(bar1.XValues[i], text);
      }
By the way: can you help us out with the critical issue with the license problem described in my other post?
It starts to get embarrassing for us (and for Steema...?).
We paid for a license, so it is ironic, that the license appears to cause problems.
Sure, I just posted a reply on that thread.