Multiple series datetime values year overlap

TeeChart for ActiveX, COM and ASP
Post Reply
Paccie
Newbie
Newbie
Posts: 1
Joined: Thu Aug 26, 2004 4:00 am
Location: Zaltbommel The Netherlands
Contact:

Multiple series datetime values year overlap

Post by Paccie » Thu Nov 11, 2004 10:26 am

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....

Pep
Site Admin
Site Admin
Posts: 3305
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Nov 11, 2004 5:34 pm

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

Post Reply