Date in bar series X-axis

TeeChart for ActiveX, COM and ASP
Post Reply
tsoffers
Newbie
Newbie
Posts: 5
Joined: Thu Jan 12, 2006 12:00 am
Location: Oevel, Belgium
Contact:

Date in bar series X-axis

Post by tsoffers » Fri Jan 26, 2007 9:19 am

Hi,

when using a bar series graph, we display the date in the horizontal axis. This works fine when multiple dates are displayed (more than one bar), but when only a single bar is displayed, no date is shown (just something like 00-00-00). The VB code seems to be fine, in both cases the series .datetime property is set to 'True', and there doesn't really seem to be more we can do. So I was thinking this could be a bug in our TeeChart program. Version info: TeeChart Pro v7.0.0.6.

some code extractions:
.TChart1.Axis.Bottom.Increment = .TChart1.GetDateTimeStep(dtOneDay)

...

For i = 0 To .SeriesCount - 1
.Series(i).DataSource = rsDBHistoric
.Series(i).YValues.ValueSource = rsDBHistoric.Fields(i + 1).Name
.Series(i).XValues.ValueSource = rsDBHistoric.Fields(0).Name
.Series(i).XValues.DateTime = True
.Series(i).Name = "CS" & (i + 1)
Next

...

Thanks in advance for your answer. If you need more info, please let me know.

Tom.

Yeray
Site Admin
Site Admin
Posts: 9533
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Fri Jan 26, 2007 10:41 am

Hi tsoffers,

the following simple example code works fine with latest activex version (v7.0.1.3):

Code: Select all

Private Sub Form_Load()
    TChart1.AddSeries scBar
    TChart1.AddSeries scBar
    
    TChart1.Series(0).FillSampleValues 6
    TChart1.Series(1).FillSampleValues 6
    
    TChart1.Series(0).XValues.DateTime = True
    TChart1.Series(1).XValues.DateTime = True
    
    TChart1.Axis.Bottom.Increment = TChart1.GetDateTimeStep(dtOneDay)
    TChart1.Legend.CheckBoxes = True
End Sub
If the problem persists could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup or you can send them via our new upload page at http://www.steema.net/upload/
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

tsoffers
Newbie
Newbie
Posts: 5
Joined: Thu Jan 12, 2006 12:00 am
Location: Oevel, Belgium
Contact:

Post by tsoffers » Fri Jan 26, 2007 10:47 am

Thanks Yeray,

the thing is it works fine with us as well, except when only one series (bar graph) is shown: in this case the date isn't displayed correctly (or not at all). Could you check this as well?

Thanks,
Tom.

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

Post by Narcís » Fri Jan 26, 2007 10:57 am

Hi Tom,

This is exactly what we tried to achieve enabling legend checkboxes in the example Yeray posted. The example code works fine here even when only one series is visible in the chart.

Can you please test if the code snippet below works fine at your end?

Thanks in advance.
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