Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Line Chart Doubt

  1. #1
    Join Date
    Jul 2009
    Posts
    22

    Default Line Chart Doubt

    Hi all,

    I have a simple line char in my dashboard with 3 columns, month, year and value.
    In a query to my database i see, eg:
    9 2008 25
    10 2008 16
    9 2009 16
    10 2009 17
    For each month (X) I want 2 lines (2008 and 2009) with the corresponding values (Y).

    But in my graphic only displays one line with the summary of the years
    9 41
    10 33

    Can anybody help me to understand why it's not displaying both lines? Is my graphic missing any property?

    Here's my xaction:

    <?xml version="1.0" encoding="utf-8"?>
    <action-sequence>
    <name>LineChart3.xaction</name>
    <title>CDF Demo</title>
    <version>1</version>
    <logging-level>TRACE</logging-level>
    <documentation>
    <author>Pedro Alves</author>
    <description>LineChart component demo</description>
    <help/>
    <result-type>none</result-type>
    <icon/>
    </documentation>


    <inputs/>


    <outputs>
    <image-tagtype="string"/>
    </outputs>


    <resources/>


    <actions>
    <action-definition>
    <component-name>SQLLookupRule</component-name>
    <action-type>Relational</action-type>
    <action-inputs/>
    <action-outputs>
    <query-resulttype="result-set"mapping="query_result"/>
    <idtype="integer"/>
    <nametype="string"/>
    </action-outputs>
    <component-definition>
    <live><![CDATA[true]]></live>
    <jndi><![CDATA[jndi_seven]]></jndi>
    <query><![CDATA[SELECT
    sf_ficha_de_cliente_productos__c.Month,
    sf_ficha_de_cliente_productos__c.Year,
    ((SUM(Ref_en_Rotura__c)/SUM(N_Ref_Teorico__c))*100) AS 'Stock'
    FROM
    seven.sf_ficha_de_cliente_productos__c
    GROUP BY sf_ficha_de_cliente_productos__c.Year, sf_ficha_de_cliente_productos__c.Month

    ORDER BY sf_ficha_de_cliente_productos__c.Year, sf_ficha_de_cliente_productos__c.Month]]>
    </query>
    </component-definition>
    </action-definition>


    <action-definition>
    <component-name>ChartComponent</component-name>
    <action-type>Line Chart</action-type>
    <action-inputs>
    <chart-datatype="result-set"mapping="query_result"/>
    </action-inputs>
    <action-outputs>
    <image-tagtype="string"/>
    </action-outputs>
    <component-definition>
    <chart-attributes>
    <chart-type>LineChart</chart-type>
    <title-font>
    <font-family>Arial</font-family>
    <size>14</size>
    <is-bold>true</is-bold>
    </title-font>
    <border-visible>false</border-visible>
    <orientation>vertical</orientation>
    <include-legend>false</include-legend>
    <is-3D>false</is-3D>
    <series>sf_ficha_de_cliente_productos__c.Month</series>
    <is-stacked>false</is-stacked>
    <foreground-alpha>0.75</foreground-alpha>
    <background-alpha>1</background-alpha>
    <url-template><![CDATA[#]]></url-template>
    <url-target>_self</url-target>
    <use-base-url>false</use-base-url>
    <domain-label-rotation>0.7</domain-label-rotation>
    <chart-backgroundtype="color">#FFFFFF</chart-background>
    <plot-backgroundtype="color">#F8F8F8</plot-background>
    <label-font>
    <font-family>Arial</font-family>
    <size>8</size>
    <is-bold>false</is-bold>
    <is-italic>false</is-italic>
    </label-font>
    <color-palette>
    <color>#3399FF</color>
    <color>#99CCFF</color>
    <color>#FFFF00</color>
    <color>#00FF00</color>
    <color>#006666</color>
    </color-palette>
    </chart-attributes>
    <width><![CDATA[600]]></width>
    <height><![CDATA[200]]></height>
    <by-row><![CDATA[false]]></by-row>
    <transparency>100</transparency>
    </component-definition>
    </action-definition>


    </actions>
    </action-sequence>

    Thank you.
    Ana Martins

  2. #2
    Join Date
    Jul 2007
    Posts
    2,497

    Default

    You're defining a line char in your xaction. You also need to play with the by-row
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  3. #3
    Join Date
    Jul 2009
    Posts
    22

    Default

    Hi Pedro,

    Now i only chaged <by-row><![CDATA[true]]></by-row> and put this line after <chart-type>LineChart</chart-type> (before this the line was at the end of xml) but my graphic is the same, only one line with the summary.

    I need to change something else?

    Thank you.
    Last edited by anamartins; 03-22-2010 at 11:22 AM.
    Ana Martins

  4. #4
    Join Date
    Jul 2009
    Posts
    22

    Default

    Hi again,
    I have the same problem with a Bar Chart. I think taht i am making the same mistake in both cases but where?

    Can anyone help me?
    Thank you.

    Bar Chart xaction:
    <?xml version="1.0" encoding="utf-8"?>
    <action-sequence>

    <name>BarChart2.xaction</name>

    <title>roturaStock</title>

    <version>1</version>

    <logging-level>TRACE</logging-level>

    <documentation>
    <author>Pedro Alves</author>
    <description>BarChart component demonstration</description>
    <help/>
    <result-type>none</result-type>
    <icon/>
    </documentation>


    <outputs>
    <image-tagtype="string"/>

    </outputs>


    <resources/>


    <actions>
    <action-definition>
    <component-name>JavascriptRule</component-name>

    <action-type>JavaScript</action-type>

    <action-outputs>
    <conditiontype="string"/>
    </action-outputs>

    </action-definition>


    <action-definition>
    <component-name>SQLLookupRule</component-name>

    <action-type>Relational</action-type>

    <action-inputs>
    <conditiontype="string"/>
    </action-inputs>

    <action-outputs>
    <query-resulttype="result-set"mapping="query_result"/>
    </action-outputs>

    <component-definition>
    <jndi><![CDATA[jndi_seven]]></jndi>
    <live><![CDATA[true]]></live>
    <query><![CDATA[SELECT
    sf_ficha_de_cliente_productos__c.Marca__c AS 'Marca',
    sf_ensena__c.CANAL__c AS 'Canal',
    ((SUM(Ref_en_Rotura__c)/SUM(N_Ref_Teorico__c))*100) AS 'RoturasStock'
    FROM
    seven.sf_ensena__c INNER JOIN seven.sf_ficha_de_cliente_productos__c ON sf_ensena__c.Id = sf_ficha_de_cliente_productos__c.Ensena__c
    {condition}
    GROUP BY sf_ficha_de_cliente_productos__c.Marca__c, sf_ensena__c.CANAL__c]]>
    </query>
    </component-definition>
    </action-definition>


    <action-definition>
    <component-name>ChartComponent</component-name>

    <action-type>Chart</action-type>

    <action-inputs>
    <chart-datatype="result-set"mapping="query_result"/>
    </action-inputs>

    <action-outputs>
    <image-tagtype="string"/>
    </action-outputs>

    <component-definition>
    <chart-attributes>
    <chart-type>BarChart</chart-type>
    <by-row>true</by-row>
    <title-font>
    <font-family>Arial</font-family>
    <size>14</size>
    <is-bold>true</is-bold>
    </title-font>
    <border-visible>false</border-visible>
    <orientation>vertical</orientation>
    <include-legend>false</include-legend>
    <is-3D>true</is-3D>
    <foreground-alpha>0.8</foreground-alpha>
    <background-alpha>1</background-alpha>
    <series>CANAL__c</series>
    <url-target>_self</url-target>
    <use-base-url>false</use-base-url>
    <domain-label-rotation>0.7</domain-label-rotation>
    <chart-backgroundtype="color">#FFFFFF</chart-background>
    <plot-backgroundtype="color">#F8F8F8</plot-background>
    <label-font>
    <font-family>Arial</font-family>
    <size>8</size>
    <is-bold>false</is-bold>
    <is-italic>false</is-italic>
    </label-font>
    <color-palette>
    <color>#218EC5</color>
    <color>#FFFF00</color>
    <color>#00FF00</color>

    </color-palette>
    </chart-attributes>
    <width><![CDATA[780]]></width>
    <transparency>100</transparency>
    <height><![CDATA[250]]></height>
    </component-definition>
    </action-definition>


    </actions>

    </action-sequence>
    Ana Martins

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.