IAxisLabels.Exponent Odd or ?

TeeChart for ActiveX, COM and ASP
Post Reply
jfrancis
Newbie
Newbie
Posts: 9
Joined: Fri Nov 02, 2007 12:00 am

IAxisLabels.Exponent Odd or ?

Post by jfrancis » Fri Sep 25, 2009 1:02 am

I tried using the "IAxisLabels.Exponent" set to TRUE to get exponent super scripts using the ValueFormat of "00e-0".

It looks real nice, but the tick labels are wrong. When I plot linear the ticks line up with my data just right. The when I change to a log scale and this formating the values displayed are "10 with superscript of 0" for the 100s tick, for the 1000s I get "10 with a superscript of 1"

I've upload an image
Attachments
LogAxisLabelError.png
Log Axis Labels wrong
LogAxisLabelError.png (16.07 KiB) Viewed 13687 times

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

Re: IAxisLabels.Exponent Odd or ?

Post by Narcís » Fri Sep 25, 2009 4:05 pm

Hi jfrancis,

I don't think axis labels are wrong. It's just that they are set in a logarithmic scale now and therefore they are not on the same position as in al linear scale. Try using the code below commenting in and out the ValueFormat line and you'll see how axis change with logarithmic scales.

Code: Select all

    TChart1.Aspect.View3D = False
    
    TChart1.AddSeries scFastLine
    TChart1.Series(0).FillSampleValues 10000
    
    TChart1.Axis.Bottom.Labels.ValueFormat = "00e-0"
    TChart1.Axis.Bottom.Logarithmic = True
Hope this helps!
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

jfrancis
Newbie
Newbie
Posts: 9
Joined: Fri Nov 02, 2007 12:00 am

Re: IAxisLabels.Exponent Odd or ?

Post by jfrancis » Mon Sep 28, 2009 4:32 pm

Sorry I was not clear.

What the two plots show the same data with an x-axis linear (bottom image) and then plotting the x-axis using log scale (top image).

The left three data points plot at "10" in linear and 10^0 ( which is 1 ) in log. I think it should of been 10^1

The middle three data points plot at "100" in linear and 10^1 ( which is 10 ) in log. I think it should of been 10^2

The right four points plot at "200" in linear and the 10^1.1 ( which is ~12.59 ) in log. I think it should of been 10^2.3

Note: I used ^ to show 10 raised to the power of.

I hope this clears up my concern.

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IAxisLabels.Exponent Odd or ?

Post by Yeray » Tue Sep 29, 2009 12:05 pm

Hi jfrancis,

If I understood well, you could solve it using OnGetAxisLabel event:

Code: Select all

Private Sub TChart1_OnGetAxisLabel(ByVal Axis As Long, ByVal SeriesIndex As Long, ByVal ValueIndex As Long, LabelText As String)
  If Axis = 3 Then
    LabelText = Format(Val(LabelText) * 10, "00e-0")
  End If
End Sub
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jfrancis
Newbie
Newbie
Posts: 9
Joined: Fri Nov 02, 2007 12:00 am

Re: IAxisLabels.Exponent Odd or ?

Post by jfrancis » Tue Oct 06, 2009 3:49 pm

Yes,

I could solve the problem by doing the coding and handling the event myself.

Basically I'm saying is that your charting library is in ERROR and are you going to fix it?

Thanks,
John Francis

PS: I'm coding in C++ and MFC.

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IAxisLabels.Exponent Odd or ?

Post by Yeray » Wed Oct 07, 2009 8:56 am

Hi John Francis,

Yes, I've added this to the wish list to be fixed in future releases (TV52014469).
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

jfrancis
Newbie
Newbie
Posts: 9
Joined: Fri Nov 02, 2007 12:00 am

Re: IAxisLabels.Exponent Odd or ?

Post by jfrancis » Wed Oct 07, 2009 4:24 pm

Thanks, can you update when the fix is included?

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IAxisLabels.Exponent Odd or ?

Post by Yeray » Thu Oct 08, 2009 7:35 am

Hi jfrancis,

I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's implemented on them.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Hans Wolfgang
Newbie
Newbie
Posts: 58
Joined: Fri Nov 15, 2002 12:00 am
Location: Naples, FL
Contact:

Re: IAxisLabels.Exponent Odd or ?

Post by Hans Wolfgang » Sat Nov 14, 2009 2:25 am

Please point me to sample code for formatting exponents and subscripts when in the TextOut() method.

Yeray
Site Admin
Site Admin
Posts: 9617
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: IAxisLabels.Exponent Odd or ?

Post by Yeray » Mon Nov 16, 2009 12:33 pm

Hi Hans,

Have you tried simply changing the font size? For example:

Code: Select all

Private Sub Form_Load() 
  TChart1.Aspect.View3D = False
  TChart1.AddSeries scBar
  
  TChart1.Series(0).FillSampleValues 6
End Sub

Private Sub TChart1_OnAfterDraw()
  Dim TextWidth As Integer
  Dim Text As String
  Text = "2 x 5"
  TextWidth = TChart1.Canvas.TextWidth(Text)
  TChart1.Canvas.TextOut 100, 100, Text
  TChart1.Canvas.Font.Size = 4
  TChart1.Canvas.TextOut 100 + TextWidth, 100, "10"
End Sub
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply