RSUpgradeParetoChart.xsl 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: rspecupgrade
  5. (C) Copyright IBM Corp. 2005, 2010
  6. US Government Users Restricted Rights - Use, duplication or disclosure
  7. restricted by GSA ADP Schedule Contract with IBM Corp.
  8. -->
  9. <!-- COPYRIGHT_DATA { 'YEAR':[2005, 2009], 'RELEASE':['colorado_wave1'], 'VISIBLE':'YES', 'COMPONENT':'rspecupgrade' }-->
  10. <!--All lines above the COPYRIGHT_DATA line will be replaced when copyright notices are generated. -->
  11. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:baltic="http://developer.cognos.com/schemas/report/1/" xmlns="http://developer.cognos.com/schemas/report/2.0/" xmlns:date="http://exslt.org/dates-and-times" xmlns:exsl="http://exslt.org/common" xmlns:xalan="http://xml.apache.org/xalan" xmlns:java="http://xml.apache.org/xalan/java" extension-element-prefixes="xalan date exsl" exclude-result-prefixes="xalan java baltic date exsl">
  12. <xsl:template name="paretoChartTemplate">
  13. <paretoChart>
  14. <xsl:call-template name="processAttsTemplate">
  15. <xsl:with-param name="p_cur" select="baltic:paretoChart"/>
  16. </xsl:call-template>
  17. <xsl:call-template name="depthTemplate"/>
  18. <xsl:attribute name="orientation"><xsl:choose><xsl:when test="baltic:paretoChart/@paretoType='barStacked'">horizontal</xsl:when><xsl:otherwise>vertical</xsl:otherwise></xsl:choose></xsl:attribute>
  19. <xsl:call-template name="standardChartAttributesTemplate"/>
  20. <xsl:call-template name="generateMasterDetailLinks2">
  21. <xsl:with-param name="p_frame" select="."/>
  22. </xsl:call-template>
  23. <xsl:call-template name="legendTemplate"/>
  24. <xsl:call-template name="axisParetoTemplate"/>
  25. <cumulationLine>
  26. <xsl:attribute name="color"><xsl:text>#cc9933</xsl:text></xsl:attribute>
  27. <xsl:attribute name="dataPointShape">
  28. <xsl:choose>
  29. <xsl:when test="baltic:paretoChart/baltic:cumulativeLine/@markerShape">
  30. <xsl:value-of select="baltic:paretoChart/baltic:cumulativeLine/@markerShape"/>
  31. </xsl:when>
  32. <xsl:otherwise>
  33. <xsl:text>circle</xsl:text>
  34. </xsl:otherwise>
  35. </xsl:choose>
  36. </xsl:attribute>
  37. <xsl:attribute name="dataPointSize">
  38. <!-- Note: markerSize is in pixels and must be converted to points for dataPointSize (see Trakker 550271). -->
  39. <xsl:choose>
  40. <xsl:when test="baltic:paretoChart/baltic:cumulativeLine/@markerSize">
  41. <xsl:value-of select="baltic:paretoChart/baltic:cumulativeLine/@markerSize * 0.75"/>
  42. </xsl:when>
  43. <xsl:otherwise>
  44. <xsl:text>5</xsl:text>
  45. </xsl:otherwise>
  46. </xsl:choose>
  47. </xsl:attribute>
  48. <cumulationLabel>
  49. <xsl:call-template name="addStyle">
  50. <xsl:with-param name="for" select="'cumulationLineLabel'"/>
  51. <xsl:with-param name="default" select="'false'"/>
  52. </xsl:call-template>
  53. <chartContents>
  54. <xsl:for-each select="baltic:paretoChart/baltic:cumulativeLine/baltic:chartText">
  55. <xsl:call-template name="chartPlainTextTemplate"/>
  56. </xsl:for-each>
  57. </chartContents>
  58. </cumulationLabel>
  59. <xsl:variable name="v_Y2" select="baltic:axis[@axisPosition='Y2']"/>
  60. <xsl:if test="$v_Y2">
  61. <cumulationAxis>
  62. <xsl:call-template name="copyAxisAttsTemplate">
  63. <xsl:with-param name="p_el" select="$v_Y2"/>
  64. </xsl:call-template>
  65. <xsl:call-template name="axisTitleTemplate">
  66. <xsl:with-param name="p_cur" select="$v_Y2"/>
  67. <xsl:with-param name="p_y2">true</xsl:with-param>
  68. </xsl:call-template>
  69. <xsl:call-template name="gridlinesTemplate">
  70. <xsl:with-param name="p_lineStyle">dash</xsl:with-param>
  71. <xsl:with-param name="p_color">#99ccff</xsl:with-param>
  72. </xsl:call-template>
  73. <xsl:call-template name="mergeStylesFromAxisAndAxisLabelsTemplate">
  74. <xsl:with-param name="p_axis" select="$v_Y2"/>
  75. <xsl:with-param name="p_y2" select="'true'"/>
  76. </xsl:call-template>
  77. </cumulationAxis>
  78. </xsl:if>
  79. </cumulationLine>
  80. <xsl:variable name="v_refQuery" select="@refQuery"/>
  81. <xsl:variable name="p_testMoveMeasureToColEdge">
  82. <xsl:if test="not(@columnEdgeIncluded ='false') and //baltic:BIQuery[@name=$v_refQuery]/baltic:summary/baltic:columnEdge/baltic:cellMembers">1</xsl:if>
  83. </xsl:variable>
  84. <xsl:variable name="v_paretoBarClusters">
  85. <xsl:call-template name="chartLevelTemplate">
  86. <xsl:with-param name="p_mode" select="'columnEdge'"/>
  87. <xsl:with-param name="p_testMoveMeasureToColEdge" select="$p_testMoveMeasureToColEdge"/>
  88. </xsl:call-template>
  89. </xsl:variable>
  90. <xsl:if test="$v_paretoBarClusters/*">
  91. <paretoBarClusters>
  92. <xsl:copy-of select="$v_paretoBarClusters"/>
  93. </paretoBarClusters>
  94. </xsl:if>
  95. <xsl:variable name="v_paretoBars">
  96. <xsl:call-template name="chartLevelTemplate">
  97. <xsl:with-param name="p_mode" select="'rowEdge'"/>
  98. </xsl:call-template>
  99. </xsl:variable>
  100. <xsl:if test="$v_paretoBars/*">
  101. <paretoBars>
  102. <xsl:copy-of select="$v_paretoBars"/>
  103. </paretoBars>
  104. </xsl:if>
  105. <xsl:call-template name="defaultMeasureTemplate">
  106. <xsl:with-param name="p_testByCount" select="'no'"/>
  107. </xsl:call-template>
  108. <xsl:call-template name="commonChartTemplate"/>
  109. <xsl:call-template name="commonChartMarkerTemplate"/>
  110. <xsl:call-template name="commonChartBaselineTemplate">
  111. <xsl:with-param name="chartType" select="'paretoChart'"/>
  112. </xsl:call-template>
  113. </paretoChart>
  114. </xsl:template>
  115. <xsl:template name="axisParetoTemplate">
  116. <xsl:for-each select="baltic:axis">
  117. <xsl:variable name="v_axisPosition" select="@axisPosition"/>
  118. <xsl:choose>
  119. <xsl:when test="$v_axisPosition = 'X'">
  120. <xsl:call-template name="ordinalAxis">
  121. <xsl:with-param name="p_gridLines" select="0"/>
  122. </xsl:call-template>
  123. </xsl:when>
  124. <xsl:when test="$v_axisPosition = 'Y1'">
  125. <numericalAxisPareto>
  126. <xsl:call-template name="copyAxisAttsTemplate"/>
  127. <xsl:call-template name="axisTitleTemplate"/>
  128. <xsl:call-template name="gridlinesTemplate">
  129. <xsl:with-param name="p_chart" select=".."/>
  130. </xsl:call-template>
  131. <xsl:call-template name="mergeStylesFromAxisAndAxisLabelsTemplate"/>
  132. </numericalAxisPareto>
  133. </xsl:when>
  134. </xsl:choose>
  135. </xsl:for-each>
  136. </xsl:template>
  137. </xsl:stylesheet>