Page 1 of 1

Multiple series datetime values year overlap

Posted: Thu Nov 11, 2004 10:26 am
by 9083748
Hi,

I'm trying and tweaking with properties, but I cann't get it right.
I have 2 series of xy values.
serie 1 starts with april 2003 and ends with december 2003
serie 2 starts with januari 2004 and ends at november 2004

When adding these series I want them grouped on month level. So I want a X-Axis that starts with 1 and ands with 12.

When I use the datetime values and set de display value to "mm" I get the values 04, 05, 06, 07, 08, 09, 10, 11, 12, 01, 02, 03, 04, 05.....etc.

Now you say....change the serie values to a numeric field...., but thats where I have another problem. The datespan is flexible and changable by the user, so when they select a periode from april to march the numeric values aren't usable....

Does anyone have a sollution for my problem....

Posted: Thu Nov 11, 2004 5:34 pm
by Pep
Hi,

one way could be creating a custom axis and making it invisible :

Code: Select all

Private Sub Form_Load()
With TChart1
    .AddSeries scLine
    .AddSeries scLine
    .Series(0).XValues.DateTime = True
    .Series(1).XValues.DateTime = True
    .Axis.Bottom.Labels.DateTimeFormat = "mm"
    .Axis.Bottom.Increment = .GetDateTimeStep(dtOneMonth)
    For i = 1 To 12
        .Series(0).AddXY DateValue("01/" & i & "/03"), Rnd(10), "", clTeeColor
        .Series(1).AddXY DateValue("01/" & i & "/04"), Rnd(10), "", clTeeColor
    Next i
    CustAxis = .Axis.AddCustom(True)
    .Series(0).HorizontalAxisCustom = CustAxis
    .Axis.Custom(CustAxis).Visible = False
End With
End Sub