R
r7dis8qh
I've been struggling to get a correct chart from an XML source - all
the values in the chart are displayed as 1
I've got it down to about the simplest possible code, can anyone
explain to me where I'm going wrong?
my asp:
<%
Set oChartSpace = Server.CreateObject("OWC11.Chartspace")
Set C = oChartSpace.Constants
oChartSpace.Clear
oChartSpace.ConnectionString = "Provider=MSPersist;"
oChartSpace.CommandText = Server.MapPath(".") & "\test1.xml"
oChartSpace.SetData c.chDimCategories, 0, "ID"
oChartSpace.SetData c.chDimValues, 0, "SALES"
oChartSpace.ExportPicture Server.MapPath(".") & "\" & "test1.gif",
"gif", 700, 440
Response.Write "<img src=""test1.gif"" >"
%>
the sample xml:
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='ID' rs:number='1' rs:nullable='true'>
<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='4000'/>
</s:AttributeType>
<s:AttributeType name='SALES' rs:number='2' rs:nullable='true'>
<s:datatype dt:type='number' rs:dbtype='varnumeric'
dt:maxLength='38' rs:scale='255' rsrecision='255'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row ID='id1' SALES='3'/>
<z:row ID='id2' SALES='8'/>
<z:row ID='id3' SALES='1'/>
<z:row ID='id4' SALES='8'/>
<z:row ID='id5' SALES='7'/>
<z:row ID='id6' SALES='8'/>
</rs:data>
</xml>
the values in the chart are displayed as 1
I've got it down to about the simplest possible code, can anyone
explain to me where I'm going wrong?
my asp:
<%
Set oChartSpace = Server.CreateObject("OWC11.Chartspace")
Set C = oChartSpace.Constants
oChartSpace.Clear
oChartSpace.ConnectionString = "Provider=MSPersist;"
oChartSpace.CommandText = Server.MapPath(".") & "\test1.xml"
oChartSpace.SetData c.chDimCategories, 0, "ID"
oChartSpace.SetData c.chDimValues, 0, "SALES"
oChartSpace.ExportPicture Server.MapPath(".") & "\" & "test1.gif",
"gif", 700, 440
Response.Write "<img src=""test1.gif"" >"
%>
the sample xml:
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly'>
<s:AttributeType name='ID' rs:number='1' rs:nullable='true'>
<s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='4000'/>
</s:AttributeType>
<s:AttributeType name='SALES' rs:number='2' rs:nullable='true'>
<s:datatype dt:type='number' rs:dbtype='varnumeric'
dt:maxLength='38' rs:scale='255' rsrecision='255'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row ID='id1' SALES='3'/>
<z:row ID='id2' SALES='8'/>
<z:row ID='id3' SALES='1'/>
<z:row ID='id4' SALES='8'/>
<z:row ID='id5' SALES='7'/>
<z:row ID='id6' SALES='8'/>
</rs:data>
</xml>