Axis labels wont take font changes

TeeChart for ActiveX, COM and ASP
Post Reply
OptUser
Newbie
Newbie
Posts: 20
Joined: Mon Nov 21, 2005 12:00 am

Axis labels wont take font changes

Post by OptUser » Tue Mar 09, 2010 8:33 pm

Hi,

I have a problem with the font of the bottom axis labels. When I clear the label collection and add them myself, the font for those labels reset to a default font and size and cannot be changed.

Attached to the post there is a project I've built to show the problem.
The issue is found in TeeChart ActiveX Version 8.0.0.6 and 7.0.1.3

I really need to fix that problem, please advise what can I do about it.

Thanks in advance.
Attachments
ChartAxisLabelBug.zip
VB project showing the problem.
(2.47 KiB) Downloaded 499 times

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

Re: Axis labels wont take font changes

Post by Yeray » Wed Mar 10, 2010 3:53 pm

Hi OptUser,

I've reproduced it so I've added it to the defect list to be fixed in future releases (TV52014727). It seems that font changes aren't applied to the axis labels when using custom labels.
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

OptUser
Newbie
Newbie
Posts: 20
Joined: Mon Nov 21, 2005 12:00 am

Re: Axis labels wont take font changes

Post by OptUser » Mon Mar 15, 2010 9:52 pm

Hi, thanks your response.

Can you suggest a workaround I can use meanwhile it is being fixed?
I need to define specific values for the bottom axis and the only way I could make it work is clearing the label list.

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

Re: Axis labels wont take font changes

Post by Yeray » Tue Mar 16, 2010 10:57 am

Hi OptUser,

Of course, you always can draw text directly to the canvas. Here is an example:

Code: Select all

Private Sub Form_Load()  
  TChart1.Aspect.View3D = False
  
  TChart1.AddSeries scLine
  TChart1.Series(0).FillSampleValues 25
  
  TChart1.Axis.Bottom.Labels.Clear
  
  Dim i As Integer
  For i = 0 To TChart1.Series(0).Count - 1
    TChart1.Axis.Bottom.Labels.Add TChart1.Series(0).XValues.Value(i), " "
  Next i
End Sub

Private Sub TChart1_OnAfterDraw()
  Dim i As Integer
  With TChart1.Canvas
    .Font.Name = "Tahoma"
    .Font.Size = 7
    .Font.Bold = True
    .Font.Color = vbBlue
  
    For i = 0 To TChart1.Series(0).Count - 1
      .RotateLabel TChart1.Series(0).CalcXPos(i) - (.TextHeight("hello") / 2), TChart1.Axis.Bottom.Position + .TextWidth("hello") + TChart1.Axis.Bottom.TickLength, "hello", 90
    Next i
  End With
End Sub
Note that first of all, I've cleared the labels and added custom labels with the text " " to show the grids but not any text.
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