Labels issue with 2 series
Posted: Tue Dec 07, 2010 3:28 pm
Hi,
I would like to chart 2 series with .XValues.DateTime = False . 1st one charted on form load and 2nd one on button click.
2nd serie is larger then 1st serie. In this case I have the issue listed below.
Example code
Have you any idea how can I correct this.
I would like to chart 2 series with .XValues.DateTime = False . 1st one charted on form load and 2nd one on button click.
2nd serie is larger then 1st serie. In this case I have the issue listed below.
Example code
Code: Select all
Option Explicit
Private Sub Command1_Click()
TChart1.AddSeries (scFastLine)
TChart1.Series(1).asFastLine.TreatNulls = tnSkip
TChart1.Series(1).XValues.DateTime = False
Dim i As Integer
Dim value As Double
value = 45
For i = 1 To 720
value = value + 0.03 * (Math.Rnd() - Math.Rnd())
TChart1.Series(1).AddXY i, value, Format(Now - 720 + i, "dd/mm/yy"), clTeeColor
Next i
End Sub
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.Axis.Bottom.Labels.DateTimeFormat = "dd/mm/yy"
TChart1.AddSeries (scFastLine)
TChart1.Series(0).asFastLine.TreatNulls = tnSkip
TChart1.Series(0).XValues.DateTime = False
Dim i As Integer
Dim value As Double
value = 45
For i = 300 To 720
value = value + 0.03 * (Math.Rnd() - Math.Rnd())
TChart1.Series(0).AddXY i, value, Format(Now - 365 + i, "dd/mm/yy"), clTeeColor
Next i
End Sub