Oracle Analytics Publisher

Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture

Create a Pie Chart with colored slices based on the description (RTF Publisher)

Received Response
47
Views
2
Comments
_vero_
_vero_ Rank 4 - Community Specialist

Hello Team,

we would like to create a pie chart in Oracle Bi Publisher RTF in which the pie slices are colored using a conditional formatting. This is possibile in the BI analytics like in the following image.

image.png

However, we tried to modify the XML code in the pie advanced tab. Our goal is to give a particular color for each event description to get the same pie chart that we see in the Bi Analytics.

This is the original code, in which we tried to give to the id series a color in the builder tab, but we cannot choose the specific description (it selects the attribute in alphabetical order):

<Graph seriesEffect="SE_NONE" graphType= "PIE"><LegendArea visible="true"/>
<SeriesItems><Series id="0" color="#FF0000"/></SeriesItems>
<SliceLabel visible="true"><ViewFormat decimalDigit="1" decimalDigitUsed="true"/>
</SliceLabel>

<DataValues><xsl:for-each-group select=".//DATASET_STATE" group-by="EVENT_DESCRIPTION"><xsl:sort select="current-group()/EVENT_DESCRIPTION"/>
<RowData><Cell><xsl:value-of select="sum(current-group()/STATE_ELAPSED[.!=''])"/></Cell></RowData></xsl:for-each-group></DataValues>
</LocalGridData>
</Graph>

<LocalGridData colCount="1" rowCount="{count(xdoxslt:group(.//DATASET_STATE, 'EVENT_DESCRIPTION'))}">
<RowLabels><xsl:for-each-group select=".//DATASET_STATE" group-by="EVENT_DESCRIPTION"><xsl:sort select="current-group()/EVENT_DESCRIPTION"/>
<Label><xsl:value-of select="current-group()/EVENT_DESCRIPTION"/></Label></xsl:for-each-group></RowLabels>

This is the new code, that doesn't work properly:

<Graph seriesEffect="SE_NONE" graphType= "PIE"><LegendArea visible="true"/>

<SeriesItems><xsl:for-each-group select=".//DATASET_STATE" group-by="EVENT_DESCRIPTION"><xsl:sort select="current-group()/EVENT_DESCRIPTION"/><Series id="0" color="#FF0000"/><Series id="{position()}"><xsl:attribute name="color"><xsl:when test="current-group()/EVENT_DESCRIPTION = 'Aborted'">#FF0000</xsl:when>
xsl:otherwise#FFFF00</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</Series>
</xsl:for-each-group>

<SliceLabel visible="true"><ViewFormat decimalDigit="1" decimalDigitUsed="true"/>
</SliceLabel>

<DataValues><xsl:for-each-group select=".//DATASET_STATE" group-by="EVENT_DESCRIPTION"><xsl:sort select="current-group()/EVENT_DESCRIPTION"/>
<RowData><Cell><xsl:value-of select="sum(current-group()/STATE_ELAPSED[.!=''])"/></Cell></RowData></xsl:for-each-group></DataValues>
</LocalGridData>
</Graph>

</SeriesItems><LocalGridData colCount="1" rowCount="{count(xdoxslt:group(.//DATASET_STATE, 'EVENT_DESCRIPTION'))}">
<RowLabels><xsl:for-each-group select=".//DATASET_STATE" group-by="EVENT_DESCRIPTION"><xsl:sort select="current-group()/EVENT_DESCRIPTION"/>
<Label><xsl:value-of select="current-group()/EVENT_DESCRIPTION"/></Label></xsl:for-each-group></RowLabels>

We don't know why when we use xsl:choose it automatically takes the link that is present in the code.

Can anyone help us? Thanks

Answers

  • Mallikarjuna Kuppauru-Oracle
    Mallikarjuna Kuppauru-Oracle Rank 8 - Analytics Strategist

    Hi @_vero_

    We don't know why when we use xsl:choose it automatically takes the link that is present in the code. —> which link its taking as per above code, can you share me more details?

    Regards,

    Arjun

  • _vero_
    _vero_ Rank 4 - Community Specialist

    Hi Arjun,

    in this code there isn't the link that every now and then appears automatically in the xml of the graphs. I report it below:

    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    In any case, is there a way to set the coloring of the pie slices in the same way as analytics as you see in the image above?

    Thanks in advance