Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: Columns in bar chart

  1. #1

    Default Columns in bar chart

    Hi,
    I have a table whith two columns (valor1 and valor2) and a primary key (id -> 6 and 5).

    The chart shows three bars for each id but I only want the chart show two columns (valor1 and valor2)

    How can I do it?

    Code:
        <action-definition> 
          <component-name>SQLLookupRule</component-name>
          <action-type>Relational</action-type>
          <action-inputs/>
          <action-outputs> 
            <query-result type="result-set" mapping="query_result"/> 
          </action-outputs>
          <component-definition> 
            <jndi><![CDATA[sample]]></jndi>  
            <live><![CDATA[true]]></live>  
            <query><![CDATA[select id, valor1, valor2
    from val_table]]></query> 
          </component-definition> 
        </action-definition>
      
        <action-definition> 
          <component-name>ChartComponent</component-name>
          <action-type>Bar Chart</action-type>
          <action-inputs> 
            <chart-data type="result-set" mapping="query_result"/>
          </action-inputs>
          <action-outputs> 
            <image-tag type="string"/> 
          </action-outputs>
          <component-definition> 
            <chart-attributes> 
              <chart-type>BarChart</chart-type>  
              <orientation>vertical</orientation>  
              <chart-background type="color">#FFFFFF</chart-background>  
              <plot-background type="color">#EEEEEE</plot-background>  
              <url-template><![CDATA[javascript:loadDepartmentDial('{department}')]]></url-template>  
              <series-name>id</series-name>
              <use-base-url>false</use-base-url>  
              <url-target>_self</url-target>  
              <title-font> 
                <font-family>Arial</font-family>  
                <size>12</size>  
                <is-bold>false</is-bold>  
                <is-italic>false</is-italic> 
              </title-font>  
              <is-3D>true</is-3D>
              <is-stacked>false</is-stacked>
            </chart-attributes>  
            <width><![CDATA[450]]></width>  
            <height><![CDATA[300]]></height>  
            <title><![CDATA[Sample]]></title>  
            <by-row>false</by-row> 
          </component-definition> 
        </action-definition>
    Regards.

    How does series name attribute work?
    Attached Images Attached Images  
    Sorry for my bad english, I´m learning
    La Aventura Es La Aventura

  2. #2

    Default

    Try removing the 'id' from your select statement. So your statement should be: 'select valor1, valor2 from val_table'.

    Hope this helps.

    Cheers!

  3. #3

    Default

    Hi...
    I have same problem...I have read all docs about charting reference with no results...i tried to use <series-name> but nothing happened...
    what about? I'm going crazy...

  4. #4
    Join Date
    Feb 2008
    Posts
    25

    Default

    try by-row = true

  5. #5

    Default

    It seems to me that I had a similar problem until I explicitly made the title column (the first column) a string instead of an integer. In my case, I wanted to use the year for the grouping title, but it kept plotting the year as one of the charts until I prepended the year with some text (e.g. "FY " for fiscal year).

    Perhaps something like:

    Code:
    select 'ID: ' + CONVERT(varchar(2), id) as ID, valor1, valor2
    from val_table
    Note that my example uses MS-SQL's convert function; YMMV.
    Have you hugged your computer geek today?

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.