Hello everybody, I was making an application that required plotting a bar graph of some data in my database. The thing is that I managed to get the code written below to plot the graph but the thing is that I couldn't find a way to display the x values on the x axis. What is being displayed is the number of the record in the database. Can anybody help please!!!!

Sub plot()
Dim xValues, yValues As Variant
Dim rst As Recordset
Dim Freq(1000), WS(1000) As Double
Dim X As Integer

Dim dbMyDB As Database
Set dbMyDB = OpenDatabase("db1.mdb")
Set rst = dbMyDB.OpenRecordset("TWindSpeed")

For X = 0 To (rst.RecordCount - 1)
Freq(X) = rst("Freq")
WS(X) = rst("WS")
Next X

xValues = WS
yValues = Freq

Dim oChart As WCChart
Set oChart = frmfreqdist.ChartSpace1.Charts.Add

oChart.HasTitle = True
oChart.Title.Caption = "Frequency Distribution"

Dim oSeries As WCSeries
Set oSeries = oChart.SeriesCollection.Add

With oSeries

.Caption = "1995"
.SetData chDimCategories, chDataLiteral, xValues
.SetData chDimValues, chDataLiteral, yValues
.Type = chChartTypeColumnStacked
End With

oChart.Axes.Add oChart.Axes(chAxisPositionLeft).Scaling chAxisPositionRight, chValueAxis
oChart.Axes(chAxisPositionLeft).NumberFormat = "0"
oChart.Axes(chAxisPositionLeft).HasTitle = True
oChart.Axes(chAxisPositionLeft).Title.Caption = "Frequency"
oChart.Axes(chAxisPositionLeft).MajorUnit = 10

End Sub