Set Axis Label Value Format

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Set Axis Label Value Format

Post by amol » Thu Aug 27, 2015 10:13 am

Hi Steema Support,

We want to set axis Label Value format using code:- tchart1.Axes.Bottom.Labels.ValueFormat ="#.000E+0";
but it does not show any changes or work expected. We are attaching demo for the same.

Thanks in advance.
ManageAxis.rar
Demo file for Set Axis Label Value Format
(56.61 KiB) Downloaded 887 times
Thanks
PlanoResearch

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Set Axis Label Value Format

Post by Narcís » Thu Aug 27, 2015 10:40 am

Hi PlanoResearch,

That's because you are using custom axis labels and you are not setting custom axis labels strings to this desired format, you should set the desired string format in the Double.ToString method, for example:

Code: Select all

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

      tChart1.Axes.Bottom.Labels.Items.Add(tChart1.Axes.Bottom.Minimum, tChart1.Axes.Bottom.Minimum.ToString("###0.00"));

      double incrBottom = tChart1.Axes.Bottom.Increment;
      double labelvalueBottom = tChart1.Axes.Bottom.Minimum + incrBottom; //increment in steps of 500

      while ((labelvalueBottom) <= tChart1.Axes.Bottom.Maximum)//tChart1.Axes.Bottom.Minimum ++ incr
      {
        tChart1.Axes.Bottom.Labels.Items.Add(labelvalueBottom, labelvalueBottom.ToString("###0.00"));
        labelvalueBottom += incrBottom;
      }
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Re: Set Axis Label Value Format

Post by amol » Fri Aug 28, 2015 12:33 pm

Thanks! Steema Support it works successfully!!!

Post Reply