IAxisLabels.Exponent Odd or ?
IAxisLabels.Exponent Odd or ?
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
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
-
- Log Axis Labels wrong
- LogAxisLabelError.png (16.07 KiB) Viewed 13745 times
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: IAxisLabels.Exponent Odd or ?
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.
Hope this helps!
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
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: IAxisLabels.Exponent Odd or ?
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.
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.
Re: IAxisLabels.Exponent Odd or ?
Hi jfrancis,
If I understood well, you could solve it using OnGetAxisLabel event:
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: IAxisLabels.Exponent Odd or ?
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.
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.
Re: IAxisLabels.Exponent Odd or ?
Hi John Francis,
Yes, I've added this to the wish list to be fixed in future releases (TV52014469).
Yes, I've added this to the wish list to be fixed in future releases (TV52014469).
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: IAxisLabels.Exponent Odd or ?
Thanks, can you update when the fix is included?
Re: IAxisLabels.Exponent Odd or ?
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.
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 58
- Joined: Fri Nov 15, 2002 12:00 am
- Location: Naples, FL
- Contact:
Re: IAxisLabels.Exponent Odd or ?
Please point me to sample code for formatting exponents and subscripts when in the TextOut() method.
Re: IAxisLabels.Exponent Odd or ?
Hi Hans,
Have you tried simply changing the font size? For example:
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,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |