Page 1 of 1

Log Axis Labels

Posted: Thu Nov 11, 2010 2:51 am
by 15057312
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 9491 times

Re: Log Axis Labels

Posted: Thu Nov 11, 2010 9:07 am
by 15057312
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?

Re: Log Axis Labels

Posted: Thu Nov 11, 2010 12:52 pm
by 10050769
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,

Re: Log Axis Labels

Posted: Thu Nov 11, 2010 1:00 pm
by 15057312
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

Re: Log Axis Labels

Posted: Thu Nov 11, 2010 1:23 pm
by 10050769
Hello lilo,
I am glad that your problem is solved :).

Thanks,

Re: Log Axis Labels

Posted: Thu Nov 11, 2010 2:44 pm
by 15057312
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