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">
<xslutput method="xml" version="1.0" encoding="UTF-8" indent="no" />
<xsl:template match="/">
<xml xmlns:x="urn:schemas-microsoft-comffice:excel">
<x:WebChart>
<x:OWCVersion>9.0.0.2710</x:OWCVersion>
<x:Width>20664</x:Width>
<x:Height>9260</x:Height>
<x:Chart>
<xlotArea>
<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>
<xataSource>-1</xataSource>
<xata><xsl:value-of select="Name" />,</xata>
</x:Caption>
<x:Index>1</x:Index>
<x:Category>
<xataSource>-1</xataSource>
<xata><xsl:value-of select="Name" />,</xata>
</x:Category>
<x:Value>
<xataSource>-1</xataSource>
<xata><xsl:value-of select="Time" />,</xata>
</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>
</xlotArea>
<x:Legend>
<xlacement>Right</xlacement>
</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!!
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">
<xslutput method="xml" version="1.0" encoding="UTF-8" indent="no" />
<xsl:template match="/">
<xml xmlns:x="urn:schemas-microsoft-comffice:excel">
<x:WebChart>
<x:OWCVersion>9.0.0.2710</x:OWCVersion>
<x:Width>20664</x:Width>
<x:Height>9260</x:Height>
<x:Chart>
<xlotArea>
<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>
<xataSource>-1</xataSource>
<xata><xsl:value-of select="Name" />,</xata>
</x:Caption>
<x:Index>1</x:Index>
<x:Category>
<xataSource>-1</xataSource>
<xata><xsl:value-of select="Name" />,</xata>
</x:Category>
<x:Value>
<xataSource>-1</xataSource>
<xata><xsl:value-of select="Time" />,</xata>
</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>
</xlotArea>
<x:Legend>
<xlacement>Right</xlacement>
</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!!