OWC10 web chart

A

abhilashcs

I am using OWC10 web chat with chChartTypeScatterLine

The following is the BV script to display the data in the chart... bu
i am not able to display the X axis value. Currently the X axis value i
DateTime. When i hard code this DateTime, the chart shows the date an
time, when i use the array values it is not showing.. pls help me

<script language="vbscript">
Sub Window_OnLoad()
'Extract the contents of the XML Data island and insert it int
two
'arrays: one array for the chart categories and one array fo
the
'chart values.
Dim nCount, nodes, i
Dim array1_Value, array2_Value, array3_Value',MaxMin_Value
Set nodes = dsXML.XMLDocument.childNodes.item(0).childNodes
nCount = nodes.length-1

if nCount > 0 then
Redim aTimeStamp(nCount)
Redim aWaterLevel(nCount)
Redim array1(nCount)
Redim array2(nCount)
Redim array3(nCount)


array1_Value = nodes.item(nCount).ChildNodes.item(0).text
array2_Value = nodes.item(nCount).ChildNodes.item(1).text
array3_Value = nodes.item(nCount).ChildNodes.item(2).text

'Create a chart from the array data.
'Bind the chart to the recordset.
Dim c
Set c = CSpace.Constants
Dim oChart, oSer
CSpace.Clear

Set oChart = CSpace.Charts.Add

Dim oSeries1, oSeries2,oSeries3
dim oConst
CSpace.Clear
Set oConst = CSpace.Constants
Set oChart = CSpace.Charts.Add

for each axis in oChart.Axes
axis.HasTitle = True
if axis.Type = c.chCategoryAxis then
axis.Title.Caption = "Time"
else
axis.Title.Caption = "Water Level"

end if
next

For i=1 to nCount
aTimeStamp(i) = nodes.item(i-1).ChildNodes.item(0).text
aWaterLevel(i) = nodes.item(i-1).ChildNodes.item(1).text

array1(i) = array1_Value
array2(i) = array2_Value
array3(i) = array3_Value

Next

Set oSeries1 = oChart.SeriesCollection.Add
With oSeries1
.Caption = "Calls"
.Type = oConst.chChartTypeScatterLine
.SetData oConst.chDimXValues, -1,_
Array(#11/1/2006 12:02#, #11/2/2006 12:04#, #11/5/200
12:08#, #11/7/2006 12:10#,#11/24/2006 12:20#,#11/27/200
13:34#,#12/06/2006 14:44#,#12/10/2006 18:20#,#1/3/2007 20:10#)

.SetData oConst.chDimYValues,-1,aWaterLevel

End With

With oChart.Axes(oConst.chAxisPositionBottom)
.NumberFormat="ddmmmyy h:mm"
End With

end if
End Sub
</script>


may mail id is (e-mail address removed)
 

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