Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Bar Chart data set one row of data
Bar Chart data set one row of data [message #486022] Tue, 15 September 2009 22:43 Go to next message
Eclipse UserFriend
Originally posted by: spaddock.zdirect.com

I'm trying to create what I was hoping would be a simple bar chart.

I have a table, lets call it campaign. In that table I have fields like
total_phone_calls, total_web_hits, total_tv_spots, etc.

Those fields are aggregates that I've already computed ahead of time and
I'd like to plot them on a bar chart, and given them a name. I basically
need to plot 8 points is this possible? The Field Guide and every website
seems to want me to build group by statements and have multiple rows in my
resultset.

any help would be greatly appreciated I've been working on this problem
all afternoon.

Kindest regards,
Shayne
Re: Bar Chart data set one row of data [message #486160 is a reply to message #486022] Wed, 16 September 2009 14:58 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Shayne,

This is very possible. Where are you getting the data points from?

Jason

Shayne Paddock wrote:
> I'm trying to create what I was hoping would be a simple bar chart.
>
> I have a table, lets call it campaign. In that table I have fields like
> total_phone_calls, total_web_hits, total_tv_spots, etc.
> Those fields are aggregates that I've already computed ahead of time and
> I'd like to plot them on a bar chart, and given them a name. I
> basically need to plot 8 points is this possible? The Field Guide and
> every website seems to want me to build group by statements and have
> multiple rows in my resultset.
>
> any help would be greatly appreciated I've been working on this problem
> all afternoon.
>
> Kindest regards,
> Shayne
>
Re: Bar Chart data set one row of data [message #486171 is a reply to message #486160] Wed, 16 September 2009 15:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: spaddock.zdirect.com

The data points are all coming from one record in the table.

Select total_phone_calls, total_web_hits, total_tv_spots from campaign
where campaign_id = 123.

The only way I can think of doing this is with a bunch of union statements
which isn't exactly the most elegant solution.

If there's a simpler way of doing this I'd love to hear about it.


Kindest regards,
Shayne


Jason Weathersby wrote:

> Shayne,

> This is very possible. Where are you getting the data points from?

> Jason

> Shayne Paddock wrote:
>> I'm trying to create what I was hoping would be a simple bar chart.
>>
>> I have a table, lets call it campaign. In that table I have fields like
>> total_phone_calls, total_web_hits, total_tv_spots, etc.
>> Those fields are aggregates that I've already computed ahead of time and
>> I'd like to plot them on a bar chart, and given them a name. I
>> basically need to plot 8 points is this possible? The Field Guide and
>> every website seems to want me to build group by statements and have
>> multiple rows in my resultset.
>>
>> any help would be greatly appreciated I've been working on this problem
>> all afternoon.
>>
>> Kindest regards,
>> Shayne
>>
Re: Bar Chart data set one row of data [message #486174 is a reply to message #486171] Wed, 16 September 2009 15:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Shayne,

I understand now:> I do not know if this is simpler but you could drop
a hidden table above the chart that uses an oncreate script to load up a
javascript array that is then persisted to the rptdocument. Next in the
beforeGeneration of the chart script get the values and clear the
current data definition for the chart and add your javascript array.
Attached is a sample. Note in the sample the js array is loaded per
row, but you should be able to modify it to do it all on one row. Also
note that you need to just put dummy info in the chart builder for its
definition of values.

Jason


<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20"
id="1">
<property name="createdBy">Eclipse BIRT Designer Version
2.5.0.v20090603 Build &lt;2.5.0.v20090617-0630></property>
<property name="units">in</property>
<method name="beforeFactory"><![CDATA[
importPackage(Packages.java.util);
mySer = new ArrayList();
myCat = new ArrayList();

]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="layoutPreference">auto layout</property>
<property name="bidiLayoutOrientation">ltr</property>
<data-sources>
<oda-data-source
extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
id="6">
<property
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
<property name="odaURL">jdbc:classicmodels:sampledb</property>
<property name="odaUser">ClassicModels</property>
</oda-data-source>
</data-sources>
<data-sets>
<oda-data-set
extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
name="Data Set" id="7">
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
</structure>
<property name="dataSource">Data Source</property>
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">ORDERNUMBER</property>
<property name="nativeName">ORDERNUMBER</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">PRODUCTCODE</property>
<property name="nativeName">PRODUCTCODE</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">QUANTITYORDERED</property>
<property name="nativeName">QUANTITYORDERED</property>
<property name="dataType">integer</property>
</structure>
<structure>
<property name="position">4</property>
<property name="name">PRICEEACH</property>
<property name="nativeName">PRICEEACH</property>
<property name="dataType">float</property>
</structure>
<structure>
<property name="position">5</property>
<property name="name">ORDERLINENUMBER</property>
<property name="nativeName">ORDERLINENUMBER</property>
<property name="dataType">integer</property>
</structure>
</list-property>
<xml-property name="queryText"><![CDATA[select *
from orderdetails]]></xml-property>
</oda-data-set>
</data-sets>
<styles>
<style name="crosstab" id="4">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab-cell" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="table-header" id="57">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-footer" id="58">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-detail" id="59">
<property name="backgroundColor">#E6ECFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#000080</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-group-header-1" id="60">
<property name="backgroundColor">#809FFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="table-group-footer-1" id="61">
<property name="backgroundColor">#809FFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="special-header" id="62">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">medium</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="crosstab-detail" id="63">
<property name="backgroundColor">#E6ECFF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">x-small</property>
<property name="fontWeight">bold</property>
<property name="color">#000080</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
<style name="crosstab-header" id="64">
<property name="backgroundColor">#6078BF</property>
<property name="fontFamily">"Arial"</property>
<property name="fontSize">small</property>
<property name="fontWeight">bold</property>
<property name="color">#FFFFFF</property>
<property name="paddingTop">0px</property>
<property name="paddingLeft">0px</property>
<property name="paddingBottom">0px</property>
<property name="paddingRight">0px</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<property name="topMargin">1in</property>
<property name="leftMargin">1.25in</property>
<property name="bottomMargin">1in</property>
<property name="rightMargin">1.25in</property>
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property
name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="8">
<property name="width">100%</property>
<property name="dataSet">Data Set</property>
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr">true</expression>
</structure>
</list-property>
<list-property name="boundDataColumns">
<structure>
<property name="name">ORDERNUMBER</property>
<property name="displayName">ORDERNUMBER</property>
<expression
name="expression">dataSetRow["ORDERNUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRODUCTCODE</property>
<property name="displayName">PRODUCTCODE</property>
<expression
name="expression">dataSetRow["PRODUCTCODE"]</expression >
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">QUANTITYORDERED</property>
<property name="displayName">QUANTITYORDERED</property>
<expression
name="expression">dataSetRow["QUANTITYORDERED"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">PRICEEACH</property>
<property name="displayName">PRICEEACH</property>
<expression
name="expression">dataSetRow["PRICEEACH"]</expression>
<property name="dataType">float</property>
</structure>
<structure>
<property name="name">ORDERLINENUMBER</property>
<property name="displayName">ORDERLINENUMBER</property>
<expression
name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
<property name="dataType">integer</property>
</structure>
<structure>
<property name="name">Aggregation</property>
<property name="dataType">float</property>
<simple-property-list name="aggregateOn">
<value>NewTableGroup1</value>
</simple-property-list>
<property name="aggregateFunction">SUM</property>
<list-property name="arguments">
<structure>
<property name="name">Expression</property>
<expression
name="value">row["QUANTITYORDERED"]</expression>
</structure>
</list-property>
</structure>
</list-property>
<column id="37"/>
<column id="38"/>
<column id="39"/>
<column id="40"/>
<column id="41"/>
<header>
<row id="9">
<cell id="10">
<label id="11">
<text-property
name="text">ORDERNUMBER</text-property>
</label>
</cell>
<cell id="12">
<label id="13">
<text-property
name="text">PRODUCTCODE</text-property>
</label>
</cell>
<cell id="14">
<label id="15">
<text-property
name="text">QUANTITYORDERED</text-property>
</label>
</cell>
<cell id="16">
<label id="17">
<text-property
name="text">PRICEEACH</text-property>
</label>
</cell>
<cell id="18">
<label id="19">
<text-property
name="text">ORDERLINENUMBER</text-property>
</label>
</cell>
</row>
</header>
<group id="42">
<property name="groupName">NewTableGroup1</property>
<property name="interval">none</property>
<property name="sortDirection">asc</property>
<expression name="keyExpr">row["ORDERNUMBER"]</expression>
<structure name="toc">
<expression
name="expressionValue">row["ORDERNUMBER"]</expression>
</structure>
<property name="repeatHeader">true</property>
<property name="hideDetail">false</property>
<property name="pageBreakAfter">auto</property>
<property name="pageBreakBefore">auto</property>
<property name="pageBreakInside">auto</property>
<header>
<row id="43">
<method name="onCreate"><![CDATA[var catval =
this.getRowData().getColumnValue("ORDERNUMBER");
var serval = this.getRowData().getColumnValue("Aggregation");
importPackage(Packages.java.util);
importPackage(Packages.java.lang);

mySer.add( Double.parseDouble(serval) );
myCat.add( catval );]]></method>
<cell id="44">
<data id="55">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="45">
<data id="56">
<structure name="numberFormat">
<property
name="category">Fixed</property>
<property
name="pattern">###0</property>
</structure>
<property
name="resultSetColumn">Aggregation</property>
</data>
</cell>
<cell id="46"/>
<cell id="47"/>
<cell id="48"/>
</row>
</header>
<footer>
<row id="49">
<cell id="50"/>
<cell id="51"/>
<cell id="52"/>
<cell id="53"/>
<cell id="54"/>
</row>
</footer>
</group>
<detail>
<row id="20">
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr">true</expression>
</structure>
</list-property>
<cell id="21">
<data id="22">
<property
name="resultSetColumn">ORDERNUMBER</property>
</data>
</cell>
<cell id="23">
<data id="24">
<property
name="resultSetColumn">PRODUCTCODE</property>
</data>
</cell>
<cell id="25">
<data id="26">
<property
name="resultSetColumn">QUANTITYORDERED</property>
</data>
</cell>
<cell id="27">
<data id="28">
<property
name="resultSetColumn">PRICEEACH</property>
</data>
</cell>
<cell id="29">
<data id="30">
<property
name="resultSetColumn">ORDERLINENUMBER</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="31">
<cell id="32"/>
<cell id="33"/>
<cell id="34"/>
<cell id="35"/>
<cell id="36"/>
</row>
</footer>
</table>
<label id="69">
<list-property name="visibility">
<structure>
<property name="format">all</property>
<expression name="valueExpr">true</expression>
</structure>
</list-property>
<method
name="onCreate"><![CDATA[reportContext.setPersistentGlobalVariable( "myCat",
myCat);
reportContext.setPersistentGlobalVariable("mySer", mySer);]]></method>
<text-property name="text">dummy label check
onCreate</text-property>
</label>
<extended-item extensionName="Chart" name="NewChart" id="68">
<xml-property
name="xmlRepresentation"><![CDATA[<model:ChartWithAxes
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute"
xmlns:data="http://www.birt.eclipse.org/ChartModelData"
xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout"
xmlns:model="http://www.birt.eclipse.org/ChartModel"
xmlns:type="http://www.birt.eclipse.org/ChartModelType">
<Type>Bar Chart</Type>
<SubType>Side-by-side</SubType>
<Block>
<Children xsi:type="layout:TitleBlock">
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>0.0</Width>
<Height>0.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Visible>true</Visible>
<Label>
<Caption>
<Value>Bar Chart Title</Value>
<Font>
<Size>16.0</Size>
<Bold>true</Bold>
<Alignment>
<horizontalAlignment>Center</horizontalAlignment>
<verticalAlignment>Center</verticalAlignment>
</Alignment>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>true</Visible>
</Label>
</Children>
<Children xsi:type="layout:Plot">
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>0.0</Width>
<Height>0.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Visible>true</Visible>
<HorizontalSpacing>5</HorizontalSpacing>
<VerticalSpacing>5</VerticalSpacing>
<ClientArea>
<Outline>
<Style>Solid</Style>
<Thickness>0</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>0.0</Left>
<Bottom>0.0</Bottom>
<Right>0.0</Right>
</Insets>
</ClientArea>
</Children>
<Children xsi:type="layout:Legend">
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>0.0</Width>
<Height>0.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Visible>false</Visible>
<ClientArea>
<Outline>
<Style>Solid</Style>
<Thickness>0</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>2.0</Top>
<Left>2.0</Left>
<Bottom>2.0</Bottom>
<Right>2.0</Right>
</Insets>
</ClientArea>
<Text>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Text>
<Orientation>Vertical</Orientation>
<Direction>Top_Bottom</Direction>
<Separator>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>true</Visible>
</Separator>
<Position>Right</Position>
<ItemType>Categories</ItemType>
<Title>
<Caption>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</Title>
<TitlePosition>Above</TitlePosition>
</Children>
<Bounds>
<Left>0.0</Left>
<Top>0.0</Top>
<Width>525.0</Width>
<Height>396.0</Height>
</Bounds>
<Insets>
<Top>3.0</Top>
<Left>3.0</Left>
<Bottom>3.0</Bottom>
<Right>3.0</Right>
</Insets>
<Row>-1</Row>
<Column>-1</Column>
<Rowspan>-1</Rowspan>
<Columnspan>-1</Columnspan>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Visible>true</Visible>
</Block>
<Dimension>Two_Dimensional</Dimension>
<Script>function beforeGeneration( chart, icsc )&#xD;
&#xD;
{&#xD;
&#xD;
importPackage(Packages.java.util);&#xD;
importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);&#xD;
importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl);&#xD;
importPackage(Packages.org.eclipse.birt.chart.model.type.imp l);&#xD;
&#xD;
var xAxis = chart.getAxes().get(0);&#xD;
var yAxis = xAxis.getAssociatedAxes().get(0);&#xD;
var xSerieDef = xAxis.getSeriesDefinitions().get(0);&#xD;
var ySerieDef = yAxis.getSeriesDefinitions().get(0);&#xD;
&#xD;
var myCat =
icsc.getExternalContext().getScriptable().getPersistentGloba lVariable(&quot;myCat&quot;);&#xD;
var mySer =
icsc.getExternalContext().getScriptable().getPersistentGloba lVariable(&quot;mySer&quot;);&#xD;
&#xD;
var categoryValues = TextDataSetImpl.create( myCat );&#xD;
var orthoValues = NumberDataSetImpl.create( mySer );&#xD;
&#xD;
// create custom series &#xD;
var seCategory = SeriesImpl.create( );&#xD;
seCategory.setDataSet( categoryValues );&#xD;
&#xD;
&#xD;
var bs = BarSeriesImpl.create( );&#xD;
bs.setSeriesIdentifier( &quot;Dynamic\r\nBar Series&quot; );
//$NON-NLS-1$&#xD;
bs.setDataSet( orthoValues );&#xD;
&#xD;
&#xD;
// clear existing series&#xD;
xSerieDef.getSeries().clear();&#xD;
ySerieDef.getSeries().clear();&#xD;
&#xD;
&#xD;
// bind new sereis to chart&#xD;
xSerieDef.getSeries().add(seCategory);&#xD;
ySerieDef.getSeries().add(bs);&#xD;
&#xD;
}</Script>
<Units>Points</Units>
<SeriesThickness>10.0</SeriesThickness>
<SampleData>
<BaseSampleData>
<DataSetRepresentation>'A','B','C','D','E'</DataSetRepresentation >
</BaseSampleData>
<OrthogonalSampleData>
<DataSetRepresentation>5,4,12</DataSetRepresentation>
<SeriesDefinitionIndex>0</SeriesDefinitionIndex>
</OrthogonalSampleData>
</SampleData>
<Interactivity/>
<EmptyMessage>
<Caption>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</EmptyMessage>
<Axes>
<Type>Text</Type>
<Title>
<Caption>
<Value>X-Axis Title</Value>
<Font>
<Size>14.0</Size>
<Bold>true</Bold>
<Alignment>
<horizontalAlignment>Center</horizontalAlignment>
<verticalAlignment>Center</verticalAlignment>
</Alignment>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</Title>
<TitlePosition>Below</TitlePosition>
<AssociatedAxes>
<Type>Linear</Type>
<Title>
<Caption>
<Value>Y-Axis Title</Value>
<Font>
<Size>14.0</Size>
<Bold>true</Bold>
<Alignment>
<horizontalAlignment>Center</horizontalAlignment>
<verticalAlignment>Center</verticalAlignment>
</Alignment>
<Rotation>90.0</Rotation>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</Title>
<TitlePosition>Left</TitlePosition>
<SeriesDefinitions>
<Query>
<Definition></Definition>
</Query>
<SeriesPalette>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>80</Red>
<Green>166</Green>
<Blue>218</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>242</Red>
<Green>88</Green>
<Blue>106</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>232</Red>
<Green>172</Green>
<Blue>57</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>64</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>170</Red>
<Green>85</Green>
<Blue>85</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>192</Red>
<Green>192</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>192</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>7</Red>
<Green>146</Green>
<Blue>94</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>192</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>64</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>80</Red>
<Green>240</Green>
<Blue>120</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>0</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>0</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>64</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>128</Red>
<Green>128</Green>
<Blue>128</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>64</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Entries>
<Entries xsi:type="attribute:ColorDefinition">
<Transparency>255</Transparency>
<Red>255</Red>
<Green>128</Green>
<Blue>0</Blue>
</Entries>
</SeriesPalette>
<Series xsi:type="type:BarSeries">
<Visible>true</Visible>
<Label>
<Caption>
<Value></Value>
<Font>
<Alignment/>
</Font>
</Caption>
<Background xsi:type="attribute:ColorDefinition">
<Transparency>0</Transparency>
<Red>255</Red>
<Green>255</Green>
<Blue>255</Blue>
</Background>
<Outline>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Color>
<Transparency>255</Transparency>
<Red>0</Red>
<Green>0</Green>
<Blue>0</Blue>
</Color>
<Visible>false</Visible>
</Outline>
<Insets>
<Top>0.0</Top>
<Left>2.0</Left>
<Bottom>0.0</Bottom>
<Right>3.0</Right>
</Insets>
<Visible>false</Visible>
</Label>
<DataDefinition>
<Definition>row[&quot;QUANTITYORDERED&quot;]</Definition >
</DataDefinition>
<SeriesIdentifier>Series 1</SeriesIdentifier>
<DataPoint>
<Components>
<Type>Orthogonal_Value</Type>
</Components>
<Separator>, </Separator>
</DataPoint>
<LabelPosition>Outside</LabelPosition>
<Stacked>false</Stacked>
<Riser>Rectangle</Riser>
</Series>
<Grouping>
<Enabled>false</Enabled>
<GroupingInterval>1.0</GroupingInterval>
<GroupType>Text</GroupType>
<AggregateExpression>Sum</AggregateExpression>
</Grouping>
</SeriesDefinitions>
<Orientation>Vertical</Orientation>
<LineAttributes>
<Style>Solid</Style>
<Thickness>1</Thickness>
<Visible>true</Visible>
</LineAttributes>
<Label>
<Caption>
<Value></Value>
<Font>
<Alignment/>
</Font
Re: Bar Chart data set one row of data [message #486237 is a reply to message #486174] Wed, 16 September 2009 20:40 Go to previous message
Eclipse UserFriend
Originally posted by: spaddock.zdirect.com

Thanks for the sample design. I'm still using version 2.3 so I wasn't
able to bring it into my IDE, but I get the gist of what you're saying.

I ended up using the multiple UNION solution which although clunky worked
perfectly.

i.e.

select 'Total Web Hits', total_web_hits from campaign where campaign_id =
123
UNION
select 'Total Telephone Calls', total_telephone_calls from campaign where
campaign_id = 123


Kindest regards,
Shayne


Jason Weathersby wrote:

> Shayne,

> I understand now:> I do not know if this is simpler but you could drop
> a hidden table above the chart that uses an oncreate script to load up a
> javascript array that is then persisted to the rptdocument. Next in the
> beforeGeneration of the chart script get the values and clear the
> current data definition for the chart and add your javascript array.
> Attached is a sample. Note in the sample the js array is loaded per
> row, but you should be able to modify it to do it all on one row. Also
> note that you need to just put dummy info in the chart builder for its
> definition of values.

> Jason


> <?xml version="1.0" encoding="UTF-8"?>
> <report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20"
> id="1">
> <property name="createdBy">Eclipse BIRT Designer Version
> 2.5.0.v20090603 Build &lt;2.5.0.v20090617-0630></property>
> <property name="units">in</property>
> <method name="beforeFactory"><![CDATA[
> importPackage(Packages.java.util);
> mySer = new ArrayList();
> myCat = new ArrayList();

> ]]></method>
> <property name="iconFile">/templates/blank_report.gif</property>
> <property name="layoutPreference">auto layout</property>
> <property name="bidiLayoutOrientation">ltr</property>
> <data-sources>
> <oda-data-source
> extensionID="org.eclipse.birt.report.data.oda.jdbc" name="Data Source"
> id="6">
> <property
>
name="odaDriverClass">org.eclipse.birt.report.data.oda.sampledb.Driver </property>
> <property name="odaURL">jdbc:classicmodels:sampledb</property>
> <property name="odaUser">ClassicModels</property>
> </oda-data-source>
> </data-sources>
> <data-sets>
> <oda-data-set
> extensionID="org.eclipse.birt.report.data.oda.jdbc.JdbcSelectDataSet "
> name="Data Set" id="7">
> <structure name="cachedMetaData">
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> </structure>
> <property name="dataSource">Data Source</property>
> <list-property name="resultSet">
> <structure>
> <property name="position">1</property>
> <property name="name">ORDERNUMBER</property>
> <property name="nativeName">ORDERNUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">2</property>
> <property name="name">PRODUCTCODE</property>
> <property name="nativeName">PRODUCTCODE</property>
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="position">3</property>
> <property name="name">QUANTITYORDERED</property>
> <property name="nativeName">QUANTITYORDERED</property>
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="position">4</property>
> <property name="name">PRICEEACH</property>
> <property name="nativeName">PRICEEACH</property>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="position">5</property>
> <property name="name">ORDERLINENUMBER</property>
> <property name="nativeName">ORDERLINENUMBER</property>
> <property name="dataType">integer</property>
> </structure>
> </list-property>
> <xml-property name="queryText"><![CDATA[select *
> from orderdetails]]></xml-property>
> </oda-data-set>
> </data-sets>
> <styles>
> <style name="crosstab" id="4">
> <property name="borderBottomColor">#CCCCCC</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">1pt</property>
> <property name="borderLeftColor">#CCCCCC</property>
> <property name="borderLeftStyle">solid</property>
> <property name="borderLeftWidth">1pt</property>
> <property name="borderRightColor">#CCCCCC</property>
> <property name="borderRightStyle">solid</property>
> <property name="borderRightWidth">1pt</property>
> <property name="borderTopColor">#CCCCCC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">1pt</property>
> </style>
> <style name="crosstab-cell" id="5">
> <property name="borderBottomColor">#CCCCCC</property>
> <property name="borderBottomStyle">solid</property>
> <property name="borderBottomWidth">1pt</property>
> <property name="borderLeftColor">#CCCCCC</property>
> <property name="borderLeftStyle">solid</property>
> <property name="borderLeftWidth">1pt</property>
> <property name="borderRightColor">#CCCCCC</property>
> <property name="borderRightStyle">solid</property>
> <property name="borderRightWidth">1pt</property>
> <property name="borderTopColor">#CCCCCC</property>
> <property name="borderTopStyle">solid</property>
> <property name="borderTopWidth">1pt</property>
> </style>
> <style name="table-header" id="57">
> <property name="backgroundColor">#6078BF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="table-footer" id="58">
> <property name="backgroundColor">#6078BF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="table-detail" id="59">
> <property name="backgroundColor">#E6ECFF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">x-small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#000080</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="table-group-header-1" id="60">
> <property name="backgroundColor">#809FFF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="table-group-footer-1" id="61">
> <property name="backgroundColor">#809FFF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="special-header" id="62">
> <property name="backgroundColor">#6078BF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">medium</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="crosstab-detail" id="63">
> <property name="backgroundColor">#E6ECFF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">x-small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#000080</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> <style name="crosstab-header" id="64">
> <property name="backgroundColor">#6078BF</property>
> <property name="fontFamily">"Arial"</property>
> <property name="fontSize">small</property>
> <property name="fontWeight">bold</property>
> <property name="color">#FFFFFF</property>
> <property name="paddingTop">0px</property>
> <property name="paddingLeft">0px</property>
> <property name="paddingBottom">0px</property>
> <property name="paddingRight">0px</property>
> </style>
> </styles>
> <page-setup>
> <simple-master-page name="Simple MasterPage" id="2">
> <property name="topMargin">1in</property>
> <property name="leftMargin">1.25in</property>
> <property name="bottomMargin">1in</property>
> <property name="rightMargin">1.25in</property>
> <page-footer>
> <text id="3">
> <property name="contentType">html</property>
> <text-property
> name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
> </text>
> </page-footer>
> </simple-master-page>
> </page-setup>
> <body>
> <table id="8">
> <property name="width">100%</property>
> <property name="dataSet">Data Set</property>
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr">true</expression>
> </structure>
> </list-property>
> <list-property name="boundDataColumns">
> <structure>
> <property name="name">ORDERNUMBER</property>
> <property name="displayName">ORDERNUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERNUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRODUCTCODE</property>
> <property name="displayName">PRODUCTCODE</property>
> <expression
> name="expression">dataSetRow["PRODUCTCODE"]</expression >
> <property name="dataType">string</property>
> </structure>
> <structure>
> <property name="name">QUANTITYORDERED</property>
> <property name="displayName">QUANTITYORDERED</property>
> <expression
> name="expression">dataSetRow["QUANTITYORDERED"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">PRICEEACH</property>
> <property name="displayName">PRICEEACH</property>
> <expression
> name="expression">dataSetRow["PRICEEACH"]</expression>
> <property name="dataType">float</property>
> </structure>
> <structure>
> <property name="name">ORDERLINENUMBER</property>
> <property name="displayName">ORDERLINENUMBER</property>
> <expression
> name="expression">dataSetRow["ORDERLINENUMBER"]</expression >
> <property name="dataType">integer</property>
> </structure>
> <structure>
> <property name="name">Aggregation</property>
> <property name="dataType">float</property>
> <simple-property-list name="aggregateOn">
> <value>NewTableGroup1</value>
> </simple-property-list>
> <property name="aggregateFunction">SUM</property>
> <list-property name="arguments">
> <structure>
> <property name="name">Expression</property>
> <expression
> name="value">row["QUANTITYORDERED"]</expression>
> </structure>
> </list-property>
> </structure>
> </list-property>
> <column id="37"/>
> <column id="38"/>
> <column id="39"/>
> <column id="40"/>
> <column id="41"/>
> <header>
> <row id="9">
> <cell id="10">
> <label id="11">
> <text-property
> name="text">ORDERNUMBER</text-property>
> </label>
> </cell>
> <cell id="12">
> <label id="13">
> <text-property
> name="text">PRODUCTCODE</text-property>
> </label>
> </cell>
> <cell id="14">
> <label id="15">
> <text-property
> name="text">QUANTITYORDERED</text-property>
> </label>
> </cell>
> <cell id="16">
> <label id="17">
> <text-property
> name="text">PRICEEACH</text-property>
> </label>
> </cell>
> <cell id="18">
> <label id="19">
> <text-property
> name="text">ORDERLINENUMBER</text-property>
> </label>
> </cell>
> </row>
> </header>
> <group id="42">
> <property name="groupName">NewTableGroup1</property>
> <property name="interval">none</property>
> <property name="sortDirection">asc</property>
> <expression name="keyExpr">row["ORDERNUMBER"]</expression>
> <structure name="toc">
> <expression
> name="expressionValue">row["ORDERNUMBER"]</expression>
> </structure>
> <property name="repeatHeader">true</property>
> <property name="hideDetail">false</property>
> <property name="pageBreakAfter">auto</property>
> <property name="pageBreakBefore">auto</property>
> <property name="pageBreakInside">auto</property>
> <header>
> <row id="43">
> <method name="onCreate"><![CDATA[var catval =
> this.getRowData().getColumnValue("ORDERNUMBER");
> var serval = this.getRowData().getColumnValue("Aggregation");
> importPackage(Packages.java.util);
> importPackage(Packages.java.lang);

> mySer.add( Double.parseDouble(serval) );
> myCat.add( catval );]]></method>
> <cell id="44">
> <data id="55">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> <cell id="45">
> <data id="56">
> <structure name="numberFormat">
> <property
> name="category">Fixed</property>
> <property
> name="pattern">###0</property>
> </structure>
> <property
> name="resultSetColumn">Aggregation</property>
> </data>
> </cell>
> <cell id="46"/>
> <cell id="47"/>
> <cell id="48"/>
> </row>
> </header>
> <footer>
> <row id="49">
> <cell id="50"/>
> <cell id="51"/>
> <cell id="52"/>
> <cell id="53"/>
> <cell id="54"/>
> </row>
> </footer>
> </group>
> <detail>
> <row id="20">
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr">true</expression>
> </structure>
> </list-property>
> <cell id="21">
> <data id="22">
> <property
> name="resultSetColumn">ORDERNUMBER</property>
> </data>
> </cell>
> <cell id="23">
> <data id="24">
> <property
> name="resultSetColumn">PRODUCTCODE</property>
> </data>
> </cell>
> <cell id="25">
> <data id="26">
> <property
> name="resultSetColumn">QUANTITYORDERED</property>
> </data>
> </cell>
> <cell id="27">
> <data id="28">
> <property
> name="resultSetColumn">PRICEEACH</property>
> </data>
> </cell>
> <cell id="29">
> <data id="30">
> <property
> name="resultSetColumn">ORDERLINENUMBER</property>
> </data>
> </cell>
> </row>
> </detail>
> <footer>
> <row id="31">
> <cell id="32"/>
> <cell id="33"/>
> <cell id="34"/>
> <cell id="35"/>
> <cell id="36"/>
> </row>
> </footer>
> </table>
> <label id="69">
> <list-property name="visibility">
> <structure>
> <property name="format">all</property>
> <expression name="valueExpr">true</expression>
> </structure>
> </list-property>
> <method
> name="onCreate"><![CDATA[reportContext.setPersistentGlobalVariable( "myCat",
> myCat);
> reportContext.setPersistentGlobalVariable("mySer", mySer);]]></method>
> <text-property name="text">dummy label check
> onCreate</text-property>
> </label>
> <extended-item extensionName="Chart" name="NewChart" id="68">
> <xml-property
> name="xmlRepresentation"><![CDATA[<model:ChartWithAxes
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:attribute="http://www.birt.eclipse.org/ChartModelAttribute"
> xmlns:data="http://www.birt.eclipse.org/ChartModelData"
> xmlns:layout="http://www.birt.eclipse.org/ChartModelLayout"
> xmlns:model="http://www.birt.eclipse.org/ChartModel"
> xmlns:type="http://www.birt.eclipse.org/ChartModelType">
> <Type>Bar Chart</Type>
> <SubType>Side-by-side</SubType>
> <Block>
> <Children xsi:type="layout:TitleBlock">
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>0.0</Width>
> <Height>0.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Visible>true</Visible>
> <Label>
> <Caption>
> <Value>Bar Chart Title</Value>
> <Font>
> <Size>16.0</Size>
> <Bold>true</Bold>
> <Alignment>
> <horizontalAlignment>Center</horizontalAlignment>
> <verticalAlignment>Center</verticalAlignment>
> </Alignment>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>true</Visible>
> </Label>
> </Children>
> <Children xsi:type="layout:Plot">
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>0.0</Width>
> <Height>0.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Visible>true</Visible>
> <HorizontalSpacing>5</HorizontalSpacing>
> <VerticalSpacing>5</VerticalSpacing>
> <ClientArea>
> <Outline>
> <Style>Solid</Style>
> <Thickness>0</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>0.0</Left>
> <Bottom>0.0</Bottom>
> <Right>0.0</Right>
> </Insets>
> </ClientArea>
> </Children>
> <Children xsi:type="layout:Legend">
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>0.0</Width>
> <Height>0.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Visible>false</Visible>
> <ClientArea>
> <Outline>
> <Style>Solid</Style>
> <Thickness>0</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>2.0</Top>
> <Left>2.0</Left>
> <Bottom>2.0</Bottom>
> <Right>2.0</Right>
> </Insets>
> </ClientArea>
> <Text>
> <Value></Value>
> <Font>
> <Alignment/>
> </Font>
> </Text>
> <Orientation>Vertical</Orientation>
> <Direction>Top_Bottom</Direction>
> <Separator>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>true</Visible>
> </Separator>
> <Position>Right</Position>
> <ItemType>Categories</ItemType>
> <Title>
> <Caption>
> <Value></Value>
> <Font>
> <Alignment/>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>false</Visible>
> </Title>
> <TitlePosition>Above</TitlePosition>
> </Children>
> <Bounds>
> <Left>0.0</Left>
> <Top>0.0</Top>
> <Width>525.0</Width>
> <Height>396.0</Height>
> </Bounds>
> <Insets>
> <Top>3.0</Top>
> <Left>3.0</Left>
> <Bottom>3.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Row>-1</Row>
> <Column>-1</Column>
> <Rowspan>-1</Rowspan>
> <Columnspan>-1</Columnspan>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> <Visible>false</Visible>
> </Outline>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Visible>true</Visible>
> </Block>
> <Dimension>Two_Dimensional</Dimension>
> <Script>function beforeGeneration( chart, icsc )&#xD;
> &#xD;
> {&#xD;
> &#xD;
> importPackage(Packages.java.util);&#xD;
> importPackage(Packages.org.eclipse.birt.chart.model.data.imp l);&#xD;
> importPackage(Packages.org.eclipse.birt.chart.model.componen t.impl);&#xD;
> importPackage(Packages.org.eclipse.birt.chart.model.type.imp l);&#xD;
> &#xD;
> var xAxis = chart.getAxes().get(0);&#xD;
> var yAxis = xAxis.getAssociatedAxes().get(0);&#xD;
> var xSerieDef = xAxis.getSeriesDefinitions().get(0);&#xD;
> var ySerieDef = yAxis.getSeriesDefinitions().get(0);&#xD;
> &#xD;
> var myCat =
>
icsc.getExternalContext().getScriptable().getPersistentGloba lVariable(&quot;myCat&quot;);&#xD;
> var mySer =
>
icsc.getExternalContext().getScriptable().getPersistentGloba lVariable(&quot;mySer&quot;);&#xD;
> &#xD;
> var categoryValues = TextDataSetImpl.create( myCat );&#xD;
> var orthoValues = NumberDataSetImpl.create( mySer );&#xD;
> &#xD;
> // create custom series &#xD;
> var seCategory = SeriesImpl.create( );&#xD;
> seCategory.setDataSet( categoryValues );&#xD;
> &#xD;
> &#xD;
> var bs = BarSeriesImpl.create( );&#xD;
> bs.setSeriesIdentifier( &quot;DynamicrnBar Series&quot; );
> //$NON-NLS-1$&#xD;
> bs.setDataSet( orthoValues );&#xD;
> &#xD;
> &#xD;
> // clear existing series&#xD;
> xSerieDef.getSeries().clear();&#xD;
> ySerieDef.getSeries().clear();&#xD;
> &#xD;
> &#xD;
> // bind new sereis to chart&#xD;
> xSerieDef.getSeries().add(seCategory);&#xD;
> ySerieDef.getSeries().add(bs);&#xD;
> &#xD;
> }</Script>
> <Units>Points</Units>
> <SeriesThickness>10.0</SeriesThickness>
> <SampleData>
> <BaseSampleData>
> <DataSetRepresentation>'A','B','C','D','E'</DataSetRepresentation >
> </BaseSampleData>
> <OrthogonalSampleData>
> <DataSetRepresentation>5,4,12</DataSetRepresentation>
> <SeriesDefinitionIndex>0</SeriesDefinitionIndex>
> </OrthogonalSampleData>
> </SampleData>
> <Interactivity/>
> <EmptyMessage>
> <Caption>
> <Value></Value>
> <Font>
> <Alignment/>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>false</Visible>
> </EmptyMessage>
> <Axes>
> <Type>Text</Type>
> <Title>
> <Caption>
> <Value>X-Axis Title</Value>
> <Font>
> <Size>14.0</Size>
> <Bold>true</Bold>
> <Alignment>
> <horizontalAlignment>Center</horizontalAlignment>
> <verticalAlignment>Center</verticalAlignment>
> </Alignment>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>false</Visible>
> </Title>
> <TitlePosition>Below</TitlePosition>
> <AssociatedAxes>
> <Type>Linear</Type>
> <Title>
> <Caption>
> <Value>Y-Axis Title</Value>
> <Font>
> <Size>14.0</Size>
> <Bold>true</Bold>
> <Alignment>
> <horizontalAlignment>Center</horizontalAlignment>
> <verticalAlignment>Center</verticalAlignment>
> </Alignment>
> <Rotation>90.0</Rotation>
> </Font>
> </Caption>
> <Background xsi:type="attribute:ColorDefinition">
> <Transparency>0</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Background>
> <Outline>
> <Style>Solid</Style>
> <Thickness>1</Thickness>
> <Color>
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>0</Green>
> <Blue>0</Blue>
> </Color>
> </Outline>
> <Insets>
> <Top>0.0</Top>
> <Left>2.0</Left>
> <Bottom>0.0</Bottom>
> <Right>3.0</Right>
> </Insets>
> <Visible>false</Visible>
> </Title>
> <TitlePosition>Left</TitlePosition>
> <SeriesDefinitions>
> <Query>
> <Definition></Definition>
> </Query>
> <SeriesPalette>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>80</Red>
> <Green>166</Green>
> <Blue>218</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>242</Red>
> <Green>88</Green>
> <Blue>106</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>232</Red>
> <Green>172</Green>
> <Blue>57</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>64</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>170</Red>
> <Green>85</Green>
> <Blue>85</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>0</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>192</Red>
> <Green>192</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>255</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>192</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>7</Red>
> <Green>146</Green>
> <Blue>94</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>128</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>255</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>128</Green>
> <Blue>192</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>0</Green>
> <Blue>255</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>64</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>255</Red>
> <Green>128</Green>
> <Blue>64</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>80</Red>
> <Green>240</Green>
> <Blue>120</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>0</Red>
> <Green>64</Green>
> <Blue>128</Blue>
> </Entries>
> <Entries xsi:type="attribute:ColorDefinition">
> <Transparency>255</Transparency>
> <Red>128</Red>
> <Green>0</Green>
> <Blue>64</Blue>
> </En
Previous Topic:Disable "Preloading" of reports (pages)
Next Topic:nullpointer on generating graphics?
Goto Forum:
  


Current Time: Fri Apr 26 09:44:39 GMT 2024

Powered by FUDForum. Page generated in 0.03361 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top