Page 1 of 1

Configuring axis to show values other than zeros

Posted: Wed Aug 18, 2010 6:15 pm
by 15656690
I created a line graph with the following data, and the axes only display zeros rather than the actual values. How can I configure the graph with the TeeChart Editor to show actual values rather than just zeros?

Image

X ------------------------------- Y
-0.00012610378 ------ 4.246028E-07
-8.9191194E-05 ------ 3.3068038E-06
-6.0818983E-05 ------ 7.4953332E-06
-4.4402157E-05 ------ 9.9808687E-06
-3.4476653E-05 ------ 1.0505884E-05
-2.2452473E-05 ------ 8.6475715E-06
-1.6344982E-05 ------ 6.5047134E-06
-1.3379476E-05 ------ 4.4950153E-06
-1.2662627E-05 ------ 2.9649053E-06
-1.2509146E-05 ------ 1.7031279E-06
-1.223942E-05 ------ 8.0760361E-07
-1.1746763E-05 ------ 3.2082358E-07
-1.1011605E-05 ------ 1.1028818E-07
-1.0639812E-05 ------ 3.5825204E-08

Re: Configuring axis to show values other than zeros

Posted: Thu Aug 19, 2010 10:06 am
by 10050769
Hello PPI,

TChart axes display zero values, because your XValues and YValues over 15 decimals and by default a Double value contains 15 decimal digits of precision as explained in this link: http://msdn.microsoft.com/en-us/library/643eft0t.aspx. Also, I recommend you take a look in this thread where is explained as you display decimals in the axes.

On the other hand, If you want use exponent values, you need to add next lines of code :

Code: Select all

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

            tChart1.Axes.Bottom.Labels.Exponent = true;
            tChart1.Axes.Bottom.Labels.ValueFormat = "#.0 \"x10\" E+0";
            tChart1.Axes.Bottom.Labels.Angle = 90;
I hope will helps.

Thanks,