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!
No effect with Axes.Bottom.Labels.Separation = 0;
No effect with Axes.Bottom.Labels.Separation = 0;
- Attachments
-
- Would overlap, but automatic prevented.jpg (124.71 KiB) Viewed 8590 times
-
- Not overlapping yet.jpg (137.51 KiB) Viewed 8591 times
Re: No effect with Axes.Bottom.Labels.Separation = 0;
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.
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.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: No effect with Axes.Bottom.Labels.Separation = 0;
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!
In the VCL version (2010) setting Labels.Separation to 0 turned the automatic overlap prevention off!
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: No effect with Axes.Bottom.Labels.Separation = 0;
Hi JohnS,
Labels.Separation won't let labels to overlap in .NET. You are right, this behavior differs from the VCL version.
Labels.Separation won't let labels to overlap in .NET. You are right, this behavior differs from the VCL version.
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 |
Re: No effect with Axes.Bottom.Labels.Separation = 0;
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.
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.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: No effect with Axes.Bottom.Labels.Separation = 0;
Hi JohnS,
You can add blank spaced custom labels every second point, for example: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?
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);
}
Sure, I just posted a reply on that thread.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.
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 |