Hi Leslie,
Here's a VB.NET example that illustrates how you can bind an OWC Chart to
an XML Data Source and build an XY Scatter chart:
AxChartSpace1.ConnectionString = "provider=mspersist"
AxChartSpace1.CommandText = "c:\proddata.xml"
AxChartSpace1.HasPlotDetails = True
AxChartSpace1.Charts(0).Type =
OWC10.ChartChartTypeEnum.chChartTypeScatterMarkers
AxChartSpace1.SetData(OWC10.ChartDimensionsEnum.ch DimXValues, 0,
"ProductID")
AxChartSpace1.SetData(OWC10.ChartDimensionsEnum.ch DimYValues, 0,
"UnitPrice")
The XML used in this sample is based off of the Products table in the
Northwind sample database:
<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' rs:CommandTimeout='30'>
<s:AttributeType name='ProductID' rs:number='1'>
<s:datatype dt:type='int' dt:maxLength='4' rs:precision='10'
rs:fixedlength='true' rs:maybenull='false'/>
</s:AttributeType>
<s:AttributeType name='UnitPrice' rs:number='2' rs:nullable='true'
rs:writeunknown='true'>
<s:datatype dt:type='number' rs:dbtype='currency' dt:maxLength='8'
rs:precision='19' rs:fixedlength='true'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row ProductID='1' UnitPrice='18'/>
<z:row ProductID='2' UnitPrice='19'/>
<z:row ProductID='24' UnitPrice='4.5'/>
<z:row ProductID='34' UnitPrice='14'/>
<z:row ProductID='35' UnitPrice='18'/>
<z:row ProductID='38' UnitPrice='263.5'/>
<z:row ProductID='39' UnitPrice='18'/>
<z:row ProductID='43' UnitPrice='46'/>
<z:row ProductID='67' UnitPrice='14'/>
<z:row ProductID='70' UnitPrice='15'/>
<z:row ProductID='75' UnitPrice='7.75'/>
<z:row ProductID='76' UnitPrice='18'/>
</rs:data>
</xml>
It's important to note that when you use the MSPersist provider to bind an
OWC chart to an XML data source that the XML data source use the Recordset
Persistance shema -- if the XML does not follow this schema, the provider
will be unable to interpret the data as a recordset.
Additional Resources:
HOW TO: Find Office Web Components (OWC) Programming Documentation and
Samples
http://support.microsoft.com/default...b;en-us;319793
Use An XML Data Source with the Office XP Chart Component (Q286212)
http://support.microsoft.com/?id=286212
Saving ADO Recordsets in XML Format
http://msdn.microsoft.com/library/ps...k/xmli546n.htm
Hope this helps you!
Lori Turner
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
Content-Class: urn:content-classes:message
From: "Leslie" <le****@leslieconsulting.com>
Sender: "Leslie" <le****@leslieconsulting.com>
References: <07****************************@phx.gbl>
<dM**************@cpmsftngxa06.phx.gbl> Subject: RE: Chartspace
Date: Mon, 10 Nov 2003 07:28:11 -0800
Lines: 71
Message-ID: <09****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOnn0AWTMbbQgtfRwuVXEg9DgAmmg==
Newsgroups: microsoft.public.dotnet.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:115138
NNTP-Posting-Host: TK2MSFTNGXA12 10.40.1.164
X-Tomcat-NG: microsoft.public.dotnet.general
Tim,
Thanks for your query. Actually I have still not gotten
either a fix for my specific question--how to create an
XYScatter plot using XML as the data source; nor has
anyone been able to point out to me detailed documentation
on how to set up an XY Scatter plot. The documentation
you mentioned in an earlier post is not specific to XY
Scatter plots and I have spent a lot of hours guessing at
the syntax. Very frustrating.
I have also been corresponding on the web.components list
and have not gotten anywhere with that, either.
Please point me to detailed documentation for this.
Thank-you.
Leslie
>-----Original Message-----
>Hi Leslie,
>
>Thanks for your post.
>
>I recommend you refer to "Microsoft Office Web Components
Object Models" in >MSDN or MSDN onlene at
><http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/owcvba10/h >tml/octocMSOWCObjectModels.asp?frame=true> which provide
detailed >information on chartspace as well as other objects,
methods, properties and >events.
>
>For the Type property specifically, you can access it
with lists of >constants in MSDN or MSDN online at:
>Type Property
>http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/owcvba10/ht >ml/ocproType.asp?frame=true
>
>I believe the following MSDN aritcle is also helpful:
>Off the Chart Access
>http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/dnoffpro01/ >html/OfftheChartAccess.asp
>
>By the way, it you have further questions regarding
Office developerment, I >recommend you resort to the following newsgroups:
>microsoft.public.office.developer
>microsoft.public.officedev
>
>Hope this helps.
>
>Regards,
>
>HuangTM
>Microsoft Online Partner Support
>MCSE/MCSD
>
>Get Secure! -- www.microsoft.com/security
>This posting is provided "as is" with no warranties and
confers no rights. >
>.
>