W3C home > Mailing lists > Public > xsl-editors@w3.org > October to December 2000

Help!

From: Grega Gros <grosg@gvestnik.si>
Date: Mon, 4 Dec 2000 13:12:10 +0100
Message-ID: <B7AC39E12036D41197B900508BA370551DCAFF@mail.gvestnik.si>
To: "'xsl-editors@w3.org'" <xsl-editors@w3.org>
Hello !


My name is Grega.


I have a problem and I think that you can help mee !

I'm bilding a chart in XSL and I'm stuck.

I can't find it on your page http://www.w3.org/TR/xsl/


I've got a sample from net, I peeld it a little bit and this is what is left
of it:

! focus on red text !

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" >
<xsl:script>
var ci = 0;
var bi = 0;
var lastcolor = "";
var colors = new Array("orange", "blue", "red", "green");
var barcolors = new Array("#B0E0B0", "#B0B0F0", "#F0B0B0", "white");
var name = new Array("71", "72", "73", "74","75", "76", "77", "78", "79",
"80");

function GCN() 
{
  return name[ci++];
}


function GetColor() 
{
    return colors[ci++];
}
function GetBarColor() 
{
    lastcolor = barcolors[bi++];
    return lastcolor;
}
function GetLastBarColor() 
{
    return lastcolor;
}
function GetDate(node)
{
    var sa = node.text.split("/");
    return sa[0] + "/" + sa[1];
}

var first = true;
var nodename = "";
function GetName(node)
{
    nodename = node.getAttribute("type");
    first = true;
    return nodename;
}

// This function exists to pad the chart with zeros to make sure the 
// lines do not left align themselves.
var lastnode = "";
function GetValue(node)
{
    var result = first ? "0" : "";
    var child = node.selectSingleNode(nodename);
    if (child) {        
        if (child.text != "") {
            first = false;
            result = child.text;
        }
    }
    return result;
}

</xsl:script>
<xsl:template match="/">
<xml xmlns:x="urn:schemas-microsoft-com:office: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>White</x:Color>
    </x:Interior>
    <x:Graph>
      <x:Type>Column</x:Type>
      <x:SubType>Stacked</x:SubType>
xsl:for-each select="list/Schema/ElementType/element[@type != 'id' $and$
@type != 'date' $and$ @view ='bar' $and$ @view != 'false']">
        <x:Series>
          <x:Border>
            <x:Color><xsl:eval>GetBarColor()</xsl:eval></x:Color>
          </x:Border>
          <x:Interior>
            <x:Color><xsl:eval>GetLastBarColor()</xsl:eval></x:Color>
          </x:Interior>
          <x:Caption>
            <x:DataSource>-1</x:DataSource>
            <x:Data><xsl:eval>GetName(this)</xsl:eval></x:Data>  
          </x:Caption>
          <x:Index>1</x:Index>
          <x:Value>
            <x:DataSource>-1</x:DataSource>
            <x:Data><xsl:for-each
select="/list/item[date]"><xsl:eval>GetValue(this)</xsl:eval>,</xsl:for-each
></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:Axis>
       <x:AxisID>69337272</x:AxisID>
       <x:ScaleID>100</x:ScaleID>
       <x:Type>Value</x:Type>
       <x:MajorGridlines>
       </x:MajorGridlines>
       <x:MajorTick>Outside</x:MajorTick>
       <x:Placement>Right</x:Placement>
     </x:Axis>

     <x:Axis>
       <x:AxisID>69344504</x:AxisID>
       <x:ScaleID>69343828</x:ScaleID>
       <x:Type>Category</x:Type>
       <x:MajorTick>Outside</x:MajorTick>
       <x:Placement>Bottom</x:Placement>
     </x:Axis>
 </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>
</xsl:stylesheet>

My questions are:

<x:Type>Column</x:Type>  which types are available 
<x:SubType>Stacked</x:SubType> which SubTypes are available 

where can I find a library that contains that cinde information

thats all for now !


If you would be so cinde and answer my e-mail, you have ma life gratitude !


Sory about spelling !


Have a nice day.


Regards, Grega !
Received on Monday, 4 December 2000 07:12:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:51 GMT