Fixed scale of (timestamp) x-axis

TeeChart for ActiveX, COM and ASP
Post Reply
Mike
Newbie
Newbie
Posts: 40
Joined: Wed Jan 28, 2004 5:00 am

Fixed scale of (timestamp) x-axis

Post by Mike » Tue May 24, 2005 8:21 am

hello,

I use TeeChart 6.0.0.5 ActiveX in ASP pages.

I read data from SQL database via ODBC. I read the data in a for...next loop for several measurement circuits.

I add the data to a Series with .DataSource = 'Recordset' --> totally I have several Series in one Chart.

How can I set the x-axis visible scale to e.g. 1 day (by using GetDateTimeStep) so that the visible part of the x-axis shows always the 1 day data (and the data points adjusted to the correct positions according to their timestamp). Any extra data (not fitting to the current timescale) should be accessible via pages (with Chart.Page).

My Chart is working at the moment so that I can select the timescale from various possibilities, but it only affects on the "density" of the x-axis labels; e.g. if time scale 1 minute is selected, the timestamp label is shown every minute, and if 1 hour is selected, the timestamp label shows every hour. BUT it has no effect on the x-axis scaling.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue May 24, 2005 9:01 am

Hello Mike,

You may use TChart1.Axis.Bottom.SetMinMax as in the VB code below:

Code: Select all

Private Sub Command1_Click()
    TChart1.Axis.Bottom.SetMinMax 0, 5
End Sub

Private Sub Command2_Click()
  With TChart1.Axis.Bottom
    .SetMinMax .Minimum - 5, .Maximum - 5
  End With
End Sub

Private Sub Command3_Click()
  With TChart1.Axis.Bottom
    .SetMinMax .Minimum + 5, .Maximum + 5
  End With
End Sub

Private Sub Command4_Click()
    TChart1.Axis.Bottom.SetMinMax TChart1.Series(0).Count - 6, TChart1.Series(0).Count - 1
End Sub

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 20
    TChart1.Axis.Bottom.SetMinMax 0, 5
End Sub
There's an example of this using DateTime labels at the TeeChart features demo available at the TeeChart program group, searching for "setminmax".
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply