US and Worldwide: +1 (866) 660-7555
+ Reply to Thread
Results 1 to 4 of 4

Thread: data label in bar chart

  1. #1

    Default data label in bar chart

    Hi guys.

    How can I show the value of a bar in top of them??
    I've tried these tags, but nothing happened:

    <expression name="field_nameChart" class="org.pentaho.plugin.jfreereport.reportcharts .BarChartExpression">
    <properties>
    <property name="categoricalLabelFormat">{2}</property>
    </properties>
    </expression>
    Could someone help me??
    Last edited by brevleq; 01-25-2010 at 08:08 AM.

  2. #2
    Join Date
    Mar 2008
    Posts
    181

    Default

    Hi!

    try

    Code:
    <property name="itemsLabelVisible">true</property>

  3. #3

    Default

    I've tried you code but the result is the same!
    Here is my xaction file. Perhaps I forget put something...

    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence>
    <title>Grafico indicador cobertura pre-natal</title>
    <version>1</version>
    <logging-level>ERROR</logging-level>
    <documentation>
    <author>Geotech Ltda</author>
    <description>Cria o gráfico de barras contendo a porcentagem de cobertura de pré-natal.</description>
    <help/>
    <result-type/>
    <icon/>
    </documentation>

    <inputs/>

    <outputs>
    <grafico type="string"/>
    </outputs>

    <resources>
    <catalog>
    <solution-file>
    <location>/gestacao.xml</location>
    <mime-type>text/plain</mime-type>
    </solution-file>
    </catalog>
    </resources>

    <actions>
    <action-definition>
    <component-name>MDXLookupRule</component-name>
    <action-type>getData</action-type>
    <action-resources>
    <catalog type="resource"/>
    </action-resources>
    <action-outputs>
    <query-results type="result-set" mapping="resultado"/>
    </action-outputs>
    <component-definition>
    <jndi><![CDATA[gestacao]]></jndi>
    <location><![CDATA[mondrian]]></location>
    <query><![CDATA[select NON EMPTY {[Measures].[porc_cons_prenatal]} ON COLUMNS,
    NON EMPTY ([exercicio].[All exercicios].Children) ON ROWS
    from [Cobertura Pre Natal]]]></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="resultado"/>
    </action-inputs>
    <action-outputs>
    <image-tag type="string" mapping="grafico"/>
    </action-outputs>
    <component-definition>
    <chart-attributes>
    <chart-type>BarChart</chart-type>
    <border-visible>false</border-visible>
    <title-font>
    <size>12</size>
    <is-bold>true</is-bold>
    </title-font>
    <expression name="field_nameChart" class="org.pentaho.plugin.jfreereport.reportcharts .BarChartExpression">
    <properties>
    <property name="itemsLabelVisible">true</property>
    </properties>
    </expression>
    <url-template>javascript:barChartClicked("{exercicio}") ;</url-template>
    <paramName>exercicio</paramName>
    <domain-title>Exercícios</domain-title>
    <domain-title-font>
    <font-family>Arial</font-family>
    <size>14</size>
    <is-bold>false</is-bold>
    </domain-title-font>
    <range-title>Porcentagem (%)</range-title>
    <range-title-font>
    <font-family>Arial</font-family>
    <size>14</size>
    <is-bold>false</is-bold>
    </range-title-font>
    <range-minimum>0</range-minimum>
    <range-maximum>100</range-maximum>
    <max-bar-width>0.15</max-bar-width>
    <width>300</width>
    <height>300</height>
    <title>% cobertura de pré-natal</title>
    <is-3D>false</is-3D>
    </chart-attributes>
    </component-definition>
    </action-definition>

    </actions>
    </action-sequence>

  4. #4
    Join Date
    Mar 2008
    Posts
    181

    Default

    I don't know too much about charts and I am also still struggling with it but maybe you could try setting all of the properties like...
    Code:
    <expression name="field_nameChart" class="org.pentaho.plugin.jfreereport.reportcharts  .BarChartExpression">  
                <properties>
                  <property name="rangeStickyZero" class="java.lang.Boolean">false</property>
                  <property name="backgroundColor">white</property>
                  <property name="showLegend" class="java.lang.Boolean">true</property>
                  <property name="chartHeight">0</property>
                  <property name="showBorder" class="java.lang.Boolean">false</property>
                  <property name="titleText">Charge per Category</property>
                  <property name="plotBackgroundAlpha">1.0</property>
                  <property name="chartSectionOutline" class="java.lang.Boolean">false</property>
                  <property name="rangeIncludesZero" class="java.lang.Boolean">false</property>
                  <property name="returnFileNameOnly" class="java.lang.Boolean">false</property>
                  <property name="seriesColor">#0066cc</property>
                  <property name="rangePeriodCount">0.0</property>
                  <property name="categoryTitleFont">Dialog-plain-8</property>
                  <property name="titleFont">SansSerif-BOLD-10</property>
                  <property name="categoricalLabelDecimalFormat">€#,###.00</property>
                  <property name="antiAlias" class="java.lang.Boolean">true</property>
                  <property name="drawLegendBorder" class="java.lang.Boolean">true</property>
                  <property name="horizontal" class="java.lang.Boolean">false</property>
                  <property name="labelFont">SansSerif--8</property>
                  <property name="plotForegroundAlpha">1.0</property>
                  <property name="dataSource">Data Collector 0</property>
                  <property name="logarithmicAxis" class="java.lang.Boolean">false</property>
                  <property name="noDataMessage">CHART.USER_NO_DATA_AVAILABLE</property>
                  <property name="itemsLabelVisible">false</property>
                  <property name="returnImageReference" class="java.lang.Boolean">false</property>
                  <property name="legendFont">SansSerif--8</property>
                  <property name="title">Charge per Category</property>
                  <property name="stackedBarRenderPercentages" class="java.lang.Boolean">false</property>
                  <property name="categoricalItemLabelRotation">0.0</property>
                  <property name="humanReadableLogarithmicFormat" class="java.lang.Boolean">false</property>
                  <property name="drawBarOutline" class="java.lang.Boolean">false</property>
                  <property name="legendLocation">bottom</property>
                  <property name="stacked" class="java.lang.Boolean">false</property>
                  <property name="useDrawable" class="java.lang.Boolean">true</property>
                  <property name="chartWidth">0</property>
                  <property name="categoryTickFont">-plain-12</property>
                  <property name="rangeMaximum">1.0</property>
                  <property name="categoricalLabelFormat">{2}</property>
                  <property name="rangeMinimum">0.0</property>
                  <property name="showGridlines" class="java.lang.Boolean">true</property>
                  <property name="threeD" class="java.lang.Boolean">false</property>
                  <property name="labelRotation">1.5707963267948966</property>
                </properties>
    </expression>

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts