Page 1 of 1

Date in bar series X-axis

Posted: Fri Jan 26, 2007 9:19 am
by 9529928
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.

Posted: Fri Jan 26, 2007 10:41 am
by yeray
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/

Posted: Fri Jan 26, 2007 10:47 am
by 9529928
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.

Posted: Fri Jan 26, 2007 10:57 am
by narcis
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.