Using datetime as category ?

I

isg8

Hi all.

I am trying to make a graph where categories are dates with times
while the values are numeric, e.g.:

1/1/2005 12:10 am 20
1/1/2005 12:25 am 20
1/2/2005 1:00 am 20

Instead of displaying 3 dots on the graph, it displays 2, with th
first one having a value of 40!

Here's my code:

Dim i
Dim aLabel
Dim aCounts

With GetResult.Tables(0)

ReDim aLabel(.Rows.Count - 1)
ReDim aCounts(.Rows.Count - 1)

For i = 0 To .Rows.Count - 1
aLabel(i) = .DefaultView.Item(i).Item("TimeStamp")
aCounts(i)
.DefaultView.Item(i).Item("Compliance").ToString()
Next
End With


objGetTopVirusCht.SeriesCollection(0).SetData(ChartDimensionsEnum.chDimValues
ChartSpecialDataSourcesEnum.chDataLiteral, aCounts)

objGetTopVirusCht.SetData(ChartDimensionsEnum.chDimCategories
ChartSpecialDataSourcesEnum.chDataLiteral, aLabel
 
P

ppjim

isg8,

The default is grouping times together. Try the following code or various
adjustments to see if it helps you:
With ChartSpace1
' Disable time scaling on the category axis.
Chart1.Axes(1).GroupingType = .Constants.chAxisGroupingNone

' Set X axis tick label interval for every 7 days
Chart1.Axes(1).TickLabelSpacing = 7

End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top