Page 1 of 1

X-axis datetime format

Posted: Wed Jan 05, 2005 9:14 am
by 9080645
hello,

I'm using ActiveX TeeChart 6.0.0.4 in my ASP pages. I need to create a linechart with x-axis having datetime data. I get the data from MS SQL Server database.

How could I define the x-axis so that it is spread evenly through the recordset? With this I mean that if I have some datapoints stamped in the beginning of October, then no data through November and again data in December, the graph should show the October data points in left, then leave the "center" of the graph empty (thus, it has no data) and again showing the December data in the right???

Basically, I need to be able to select the x-axis period for 12 weeks, for example, and then plot the data points in the correct places, according to their timestamp in the database.

thanks for any information!!

Happy New Year 2005!!!!

Mike

Posted: Wed Jan 12, 2005 5:44 pm
by Pep
Hi Mike,
How could I define the x-axis so that it is spread evenly through the recordset? With this I mean that if I have some datapoints stamped in the beginning of October, then no data through November and again data in December, the graph should show the October data points in left, then leave the "center" of the graph empty (thus, it has no data) and again showing the December data in the right???
You can see a good example which shows how to populate the Chart through ADO recordset under :
http://localhost/TeeChart7/ADOTeeChart7.asp

About the definition for the DateTime axes, you can use similar code to the following :

Code: Select all

    With TChart1
        .Series(0).XValues.DateTime = True
        .Series(0).XValues.ValueSource = rs.Fields(0).Name
        .Axis.Bottom.Increment = TChart1.GetDateTimeStep(dtOneWeek)
        .Axis.Bottom.Labels.Style = talValue
        .Axis.Bottom.Labels.Angle = 90
        .Axis.Bottom.Labels.DateTimeFormat = "dd/MM/yyyy hh:mm"
    End With
Happy New Year 2005!!!!
Many thanks !! and goes the same for you :wink: