Double Logarithmic and other Axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pekai
Newbie
Newbie
Posts: 2
Joined: Wed Oct 20, 2004 4:00 am
Location: Germany
Contact:

Double Logarithmic and other Axis

Post by Pekai » Wed Dec 01, 2004 11:16 am

Hi,

for one of our customers I have to programm different views of his series. The Axis must in one case be double logarithmic, and in another it has to follow a delicate formula to calculate the steps and increments.
Is there any way to do this?

If there is no other possibility I can transform the Values to display in the desired Form, but in this case the Axis Labels will not display the correct values.
Is there any possibility to "correct" the Labels?

Best regards,

Pekai

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

Post by Narcís » Wed Dec 01, 2004 11:56 am

Hi Pekai,

Axis are fully customizable. You can set the increments you need. You can also set the minimum and maximum values as other arguments.

You can also only show the labels you want using custom axis labels. There is an example of this at the TeeChart for .NET demo which comes with the installer and can found at the Start Menu\Programs\ TeeChart folder. The example to search for is called "custom labels"
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

Pekai
Newbie
Newbie
Posts: 2
Joined: Wed Oct 20, 2004 4:00 am
Location: Germany
Contact:

Increment and Min, Max is not enough

Post by Pekai » Wed Dec 01, 2004 12:14 pm

Hi,

thanks for the answer, but I think Min/Max and an increment ist not enough. The "Increment" is different for every step. The axis values must be completely set by a complex formula.

It would be nice to inherit from the axis class and to override the CalcYPosValue or CalcXPosValue. But they are not virtual.

Anybody an solution for this?

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Dec 06, 2004 10:40 am

Hi.

Using custom axis labels you can calculate desired axis increments and (visible) labels and then pass them to chart axis. The following code demonstrates how to add custom axis labels to log-axis:

Code: Select all

      tChart1.Axes.Left.Logarithmic = true;
      tChart1.Axes.Left.SetMinMax(0.1,10);
      Steema.TeeChart.AxisLabels labels = tChart1.Axes.Left.Labels;
      labels.Items.Clear();
      // decade 1e-1 to 1e+0
      labels.Items.Add(0.1);
      labels.Items.Add(0.2);
      labels.Items.Add(0.3);
      labels.Items.Add(0.45);
      labels.Items.Add(0.6);
      labels.Items.Add(0.75);
      // decade 1e+0 to 1e+1
      labels.Items.Add(1.0);
      labels.Items.Add(2.0);
      labels.Items.Add(3.0);
      labels.Items.Add(4.5);
      labels.Items.Add(6.0);
      labels.Items.Add(7.5);
      labels.Items.Add(10.0);
Of course, this is only an example, you can use much more complex code to calculate custom axis increments (for each step) and axis labels you want to display (based on axis minimum and maximum value). The big advantage of this approach is you can fully customize increment(s) and axis labels.
Marjan Slatinek,
http://www.steema.com

Post Reply