Log Axis Labels

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Log Axis Labels

Post by lilo » Thu Nov 11, 2010 2:51 am

Hi,

I need log plots for my app.

I am having trouble displaying the following lagarithmic scale:

MinYTLog = 1
MaxYTLog = 1000
MinXTLog = 1
MaxXTLog = 1000

Points1.Chart.Axes.Bottom.Logarithmic = True
Points1.Chart.Axes.Right.Logarithmic = True
Points1.Chart.Axes.Left.Logarithmic = True

Points1.Chart.Axes.Bottom.Labels.OnAxis = True
Points1.Chart.Axes.Left.Labels.OnAxis = True
Points1.Chart.Axes.Right.Labels.OnAxis = True


Points1.Chart.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto'
Points1.Chart.Axes.Left.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto
Points1.Chart.Axes.Right.Labels.Style = Steema.TeeChart.AxisLabelStyle.Auto

Points1.Chart.Axes.Right.AutomaticMaximum = False
Points1.Chart.Axes.Bottom.AutomaticMaximum = False
Points1.Chart.Axes.Left.AutomaticMaximum = False
Points1.Chart.Axes.Right.AutomaticMinimum = False
Points1.Chart.Axes.Bottom.AutomaticMinimum = False
Points1.Chart.Axes.Left.AutomaticMinimum = False

Points1.Chart.Axes.Bottom.Maximum = MaxXTLog2
Points1.Chart.Axes.Bottom.Minimum = MinXTLog2
Points1.Chart.Axes.Bottom.MaximumOffset = 0
Points1.Chart.Axes.Bottom.MinimumOffset = 0

Points1.Chart.Axes.Left.Maximum = MaxYTLog2
Points1.Chart.Axes.Left.Minimum = MinYTLog2
Points1.Chart.Axes.Right.Maximum = MaxYTLog2
Points1.Chart.Axes.Right.Minimum = MinYTLog2
Points1.Chart.Axes.Left.MaximumOffset = 0
Points1.Chart.Axes.Left.MinimumOffset = 0
Points1.Chart.Axes.Right.MaximumOffset = 0
Points1.Chart.Axes.Right.MinimumOffset = 0

Points1.Chart.Axes.Bottom.Labels.ValueFormat = "0.#"
Points1.Chart.Axes.Left.Labels.ValueFormat = "0.#"
Points1.Chart.Axes.Right.Labels.ValueFormat = "0.#"

Points1.Clear()
Points1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
Points1.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
Dim i As Long
For i = 1 To NumberofSamples
Points1.Add(XVal(i - 1), YVal(i - 1), "", Color(i - 1))
Next i

See picture
LogChart1.jpg
LogChart1.jpg (37.41 KiB) Viewed 9389 times

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Log Axis Labels

Post by lilo » Thu Nov 11, 2010 9:07 am

If I plot a points chart with log scale in a new project, it works fine.

I cannot get it to work in my existing project.

If I use

Points1.Chart.Axes.Bottom.AutomaticMaximum = True
Points1.Chart.Axes.Left.AutomaticMaximum = True
Points1.Chart.Axes.Bottom.AutomaticMinimum = True
Points1.Chart.Axes.Left.AutomaticMinimum = True

it works fine.

If i use

Points1.Chart.Axes.Bottom.AutomaticMaximum = False
Points1.Chart.Axes.Left.AutomaticMaximum = False
Points1.Chart.Axes.Bottom.AutomaticMinimum = False
Points1.Chart.Axes.Left.AutomaticMinimum = False

it won't plot all the labels?

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Log Axis Labels

Post by Sandra » Thu Nov 11, 2010 12:52 pm

Hello lilo,

I couldn't reproduce your problem using your attached information here. Could you send us a simple project because we can reproduce your problem exactly here?

Thanks,
Best Regards,
Sandra Pazos / 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

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Log Axis Labels

Post by lilo » Thu Nov 11, 2010 1:00 pm

Hi Sandra

OK, Sorry about that...
When I copied a form with a tchart on it, it generated a few errors.
I deleted the TChart and reloaded it into my existing project and it works fine.

lilo

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Log Axis Labels

Post by Sandra » Thu Nov 11, 2010 1:23 pm

Hello lilo,
I am glad that your problem is solved :).

Thanks,
Best Regards,
Sandra Pazos / 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

lilo
Newbie
Newbie
Posts: 61
Joined: Thu Sep 23, 2010 12:00 am

Re: Log Axis Labels

Post by lilo » Thu Nov 11, 2010 2:44 pm

Hi,

The real cause of the problem is not having this property set:

Points1.Chart.Axes.Bottom.Increment = 0
Points1.Chart.Axes.Left.Increment = 0
Points1.Chart.Axes.Right.Increment = 0
Points1.Chart.Axes.Top.Increment = 0

lilo

Post Reply