Why do I only have 2 labels on left axis?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Why do I only have 2 labels on left axis?

Post by Dave » Thu Apr 03, 2014 10:08 am

Hi

Ive set the following to define the left axis;

myChart.Axes.Left.Labels.Exponent = true;
myChart.Axes.Left.Labels.ValueFormat = "00e-0";


However when I plot a curve on the line only 2 labels are shown; 0 and 1.3(e-13) despite the fact my plot extend from e-15 to e-18

Do I need to set some value to have more labels shown on the left axis

Thanks!

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Re: Why do I only have 2 labels on left axis?

Post by Dave » Fri Apr 04, 2014 7:21 pm

Anyone with any ideas?

It seems like when you do;

myChart.Axes.Left.Labels.Exponent = true


The labels don't display. However if

myChart.Axes.Left.Labels.Exponent = false


then the labels do show but they are all zero because the values are so tiny.

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Re: Why do I only have 2 labels on left axis?

Post by Dave » Fri Apr 04, 2014 9:15 pm

I wrote a test program and the following worked.

spectrumChart.Axes.Left.Labels.Exponent = true;
spectrumChart.Axes.Left.Labels.ValueFormat = "#.0 \"x10\" E+0";


Will test on our own project later.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Why do I only have 2 labels on left axis?

Post by Christopher » Mon Apr 07, 2014 1:28 pm

Dave,
Dave wrote: spectrumChart.Axes.Left.Labels.Exponent = true;
spectrumChart.Axes.Left.Labels.ValueFormat = "#.0 \"x10\" E+0";


Will test on our own project later.
Please let us know if we can help you further in this area.
Best Regards,
Christopher Ireland / 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

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Re: Why do I only have 2 labels on left axis?

Post by Dave » Tue Apr 08, 2014 1:49 pm

Hi Christopher

Apparently it works fine when the exponent is -10 or less. However for -10,-11, 12 etc the labels aren't displayed. We've got round this by labelling the axis uJ instead of J. So weve effectively multiplied the values by 1 million and everything is ok. This issue may have been fixed in a later version of Teechart. The one we are using is about 4 years old I think.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Why do I only have 2 labels on left axis?

Post by Christopher » Wed Apr 09, 2014 1:18 pm

Dave wrote:The one we are using is about 4 years old I think.
In the latest release, the following code:
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.Legend.Visible = false;
Line series1 = new Line(tChart1.Chart);
Random rnd = new Random();

for (int i = 0; i < 10; i++)
{
series1.Add(i, rnd.NextDouble() * 10000000000000);
}

tChart1.Axes.Left.Labels.Exponent = true;
tChart1.Axes.Left.Labels.ValueFormat = "#.0 \"x10\" E+0";
}
gives this:
exponential.PNG
exponential.PNG (22.51 KiB) Viewed 12817 times
Best Regards,
Christopher Ireland / 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

Dave
Advanced
Posts: 139
Joined: Mon Sep 22, 2008 12:00 am

Re: Why do I only have 2 labels on left axis?

Post by Dave » Sun May 04, 2014 9:14 am

Hi Christopher

We are using TeeChart version 3.5.3187.15585 and C#.NET

Bizarrely we found if the exponent was too small it didn't draw the labels. We have it working fine now by changing the units which allowed us to reduce the exponent.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Why do I only have 2 labels on left axis?

Post by Christopher » Mon May 05, 2014 9:50 am

Hello Dave,
Dave wrote: We are using TeeChart version 3.5.3187.15585 and C#.NET
You may consider upgrading your version of TeeChart to enjoy all the improvements that have been made to it over the years :)
Best Regards,
Christopher Ireland / 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

Post Reply