Need help on implementing chart with xml data using owc

S

Swamy

Hi,
I've to display charts in infopath form and I took the approach of
supplying data to xmldata property of the chart. I was following the example
on MSDN http://msdn.microsoft.com/library/en-us/dnexxml/html/xml10162000.asp
and was partially succeeded but couldnt find any help in generating the xml
data Compliant to the chart. For eg, in the normal charts we can specify
number for the chart type, but that is not supported in this approach.

Here I'm including the part of xsl I'm using for the transform if it can help.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="http://www.microsoft.com/" version="1.0">
<xsl:eek:utput method="xml" version="1.0" encoding="UTF-8" indent="no" />
<xsl:template match="/">
<xml xmlns:x="urn:schemas-microsoft-com:eek:ffice:excel">
<x:WebChart>
<x:OWCVersion>9.0.0.2710</x:OWCVersion>
<x:Width>20664</x:Width>
<x:Height>9260</x:Height>
<x:Chart>
<x:plotArea>
<x:Interior>
<x:Color>#F0F0F0</x:Color>
</x:Interior>
<x:Graph>
<x:Type>Column</x:Type>
<x:SubType>Standard</x:SubType>
<xsl:for-each select="/AggXml/Project">
<x:Series>
<x:Border>
<x:Color>#000000</x:Color>
</x:Border>
<x:Interior>
<x:Color><xsl:value-of select="user:GetColor(position())" /></x:Color>
</x:Interior>
<x:Caption>
<x:DataSource>-1</x:DataSource>
<x:Data><xsl:value-of select="Name" />,</x:Data>
</x:Caption>
<x:Index>1</x:Index>
<x:Category>
<x:DataSource>-1</x:DataSource>
<x:Data><xsl:value-of select="Name" />,</x:Data>
</x:Category>
<x:Value>
<x:DataSource>-1</x:DataSource>
<x:Data><xsl:value-of select="Time" />,</x:Data>
</x:Value>
</x:Series>
</xsl:for-each>
<x:ScaleID>69343828</x:ScaleID>
<x:ScaleID>100</x:ScaleID>

<x:Overlap>100</x:Overlap>
<x:GapWidth>150</x:GapWidth>

</x:Graph>

</x:plotArea>
<x:Legend>
<x:placement>Right</x:placement>
</x:Legend>
</x:Chart>
<x:Scaling>
<x:ScaleID>69343828</x:ScaleID>
</x:Scaling>
<x:Scaling>
<x:ScaleID>69343968</x:ScaleID>
</x:Scaling>
<x:Scaling>
<x:ScaleID>100</x:ScaleID>
</x:Scaling>
</x:WebChart>
</xml>
</xsl:template>

Any help is highly appreciated. Thanks!!
 
T

Thao Moua [ms]

Usually you do not want to create your own chart XML as this is difficult and
you have to create the hierachy correctly. Your best approach is to create
the chart in another container and then export the finished chart's XML to be
used in infopath.

Thao Moua
OWC Chartspace Support

This posting is provided "AS IS" with no warranties, and
confers no rights. Use of included script samples are
subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

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

Similar Threads

Crash on charting 0
XMLData and ChartSpace 2

Top