I have installed the latest version of TeeChart.Net Nov 2004. I was waiting for this release so the year labels would relate to the data. This is done and it looks great. Now my problem is the lables overlap when a large number of years are displayed.
Is there a way to display say every fifth label. The Grid is fine on Yearly incraments. Tried 'TChart1.Axes.Bottom.Labels.Separation ' didn't work.
TChart1.Axes.Bottom.Labels.DateTimeFormat = "yy" is still to crowded and TChart1.Axes.Bottom.Labels.Angle = 90 is not an option.
if I drop TChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneYear) It looks OK but again the labels would not relate to the data.
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim StartDate As New DateTime(1962, 1, 1)
Dim PointDate As New DateTime(1962, 1, 1)
Dim x As Single
Dim EnderDate As New DateTime(2010, 1, 1)
TChart1.Legend.Visible = False
For i As Integer = 1 To 360
x = x + Rnd()
Line1.Add(PointDate, x, "")
PointDate = PointDate.AddMonths(1)
Next
Line1.XValues.DateTime = True
TChart1.Axes.Bottom.Automatic = False
TChart1.Axes.Bottom.Labels.Separation = 10
TChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneYear)
TChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy"
TChart1.Axes.Bottom.SetMinMax(StartDate, EnderDate)
End Sub
Thanks
Bottom Labels Overlapping
I saw this in one of the other posts
private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if ((Steema.TeeChart.Axis)sender==tChart1.Axes.Bottom)
e.LabelText = e.LabelText + " .";
}
I can't figure out the VB.Net equivalent code. Will this work if I make every third label = ""
private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if ((Steema.TeeChart.Axis)sender==tChart1.Axes.Bottom)
e.LabelText = e.LabelText + " .";
}
I can't figure out the VB.Net equivalent code. Will this work if I make every third label = ""
Hi Avatar,
you can use the folowing code (it will show every third axis label) :
Also, There are even a couple of free translation tools :
tool #1: http://www.aspalliance.com/aldotnet/exa ... slate.aspx
tool #2: http://www.kamalpatel.net/ConvertCSharp2VB.aspx
you can use the folowing code (it will show every third axis label) :
Code: Select all
Private Sub TChart1_GetAxisLabel(ByVal sender As Object, ByVal e As Steema.TeeChart.GetAxisLabelEventArgs) Handles TChart1.GetAxisLabel
If (CType(sender, Steema.TeeChart.Axis) Is TChart1.Axes.Bottom) Then
If (Convert.ToInt16(e.LabelText).ToString() Mod 3 <> 0) Then
e.LabelText = ""
End If
End If
End Sub
tool #1: http://www.aspalliance.com/aldotnet/exa ... slate.aspx
tool #2: http://www.kamalpatel.net/ConvertCSharp2VB.aspx
Pep Jorge
http://support.steema.com
http://support.steema.com