Page 1 of 1

Bottom axis labels

Posted: Fri Jun 27, 2008 7:28 am
by 9530819
Hi

I was certain there was a way to align bottom axis labels (custom) labels. In effect I need the label to draw on the right of the tick, not centered under it?

Still plodding along with version 7 (latest).

Thanks

EDIT: Just encountered something else. Is it possible to draw the grid lines on top of the Area series?

Posted: Mon Jun 30, 2008 8:44 am
by yeray
Hi Rossmc,

I think that in this demo there is achieved something very similar than what you are looking for:

Code: Select all

Private Sub Form_Load()
  With TChart1.Series(0)
    .Clear
    .Add 123, "First", clTeeColor
    .Add 456, "Second", clTeeColor
    .Add 321, "Third", clTeeColor
    .Add 234, "Last", clTeeColor
  End With
End Sub


Private Sub TChart1_OnDrawAxisLabel(ByVal Axis As Long, ByVal X As Long, ByVal Y As Long, LabelText As String)
  With TChart1
    If Check1.Value Then
      If Axis = 0 Then
        If X = TChart1.Axis.Bottom.CalcXPosValue(TChart1.Axis.Bottom.Minimum) Then  '  first label
         .Canvas.Font.Bold = True
         .Canvas.TextAlign = ctaLeft
        Else
          If X = TChart1.Axis.Bottom.CalcXPosValue(TChart1.Axis.Bottom.Maximum) Then ' last label
           .Canvas.Font.Bold = True
           .Canvas.TextAlign = ctaRight
          Else
           .Canvas.Font.Bold = False
          End If
        End If
      End If
    End If
  End With
End Sub
And, if I understand you second question, I think you are looking for this:

Code: Select all

TChart1.Axis.DrawAxesBeforeSeries = False