| Adding comments to the graph generated by BIRT. [message #853621] |
Mon, 23 April 2012 03:20  |
Debarshi Dasgupta Messages: 25 Registered: April 2012 |
Junior Member |
|
|
Hello All,
My requirement is to allow users to add comments on the chart generated by BIRT. Please suggest me some possible solutions to implement the same.
My platform details are as follows :
BIRT runtime version : 3_7_2
Server : Tomcat 6/WAS 6
Java : 1.5
I am trying to use BIRT with jsf4birt so that I can integrate BIRT with my existing applications (most of them are using jsf 1.2).
Thanks in advance !!
|
|
|
|
|
|
|
| Re: Adding comments to the graph generated by BIRT. [message #870724 is a reply to message #855161] |
Wed, 09 May 2012 09:12   |
Debarshi Dasgupta Messages: 25 Registered: April 2012 |
Junior Member |
|
|
Hi Jason,
Now I am trying to do the same using Labels. I want to display the label while rendering the chart and the label will come from a database.
Example is as follows
Customer Name Transactions Comments
A 10 Premium
B 20 Basic
C 30 Gold
Can you please suggest a way if I render a chart with the following parameter :
X Axis : Customer Name
Y Axis : Transactions
Label : Comments
My dataset query is like this :
select Customer_Name,Transactions,Comments from sample_table;
[Updated on: Wed, 09 May 2012 09:13] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: Adding comments to the graph generated by BIRT. [message #870880 is a reply to message #870873] |
Thu, 10 May 2012 03:14   |
Debarshi Dasgupta Messages: 25 Registered: April 2012 |
Junior Member |
|
|
Hi Jason I tried adding the following tag as you have used in the shared example.
I have four series in my chart
X Axis : Month
Y Axis
Series 1. A
Series 2. B
Series 3. C (Using this series as Lower Limit)
Series 4. D (Using this series as Upper Limit)
There is another column selected "comments" which I want to display as Series Label for points of intersection between A,Month.
Example
Customer Name Transactions Comments
A 10 Premium
B 20 Basic
C 30 Gold
Point A,10 will show a series label as "Premium"
Point B,20 will show a series label as "Basic"
<property name="comments">
But it is not working for me. Probably I am unable to use the script in the proper fashion.
<property name="comments">Copyright (c) 2007 <<Your Company Name here>>
Select Chart Type
Chart Type: Line
Subtype: Overlay
Select Data
Category Series: row["MONTH"]
Value Series-1: row["A"]
Value Series-2: row["B"]
Value Series-2: row["COMMENT"]
Format Chart
Series->Series Palette->Remove first two colors
Series->Value Series - 1:
Tick Show Labels
Tick Use Palette as Line Color: False
Series Line Color: Cream (249, 225, 191)
Marks->Marks: Triangle
Series->Value Series - 2:
Tick Show Labels
Tick Use Palette as Line Color: False
Series Line Color: Cream (249, 225, 191)
Marks->Marks: Triangle
Chart Area: Chart Title: Overlay Line Chart
Chart Area->Axis->X-Axis: Gridlines->Ticks Style: Below
Y-Axis: Gridlines->Ticks Style: Left
Plot: Area Within Axes->Background: RGB(255, 255, 225)
Legend: untick Visible</property>
[Updated on: Thu, 10 May 2012 03:34] Report message to a moderator
|
|
|
| Re: Adding comments to the graph generated by BIRT. [message #871075 is a reply to message #870880] |
Thu, 10 May 2012 13:28   |
Jason Weathersby Messages: 9167 Registered: July 2009 |
Senior Member |

|
|
In the example I posted the first script is on the table detail rows
oncreate event. It has this script:
var var1 = this.getRowData().getColumnValue("series2");
var var2 = this.getRowData().getColumnValue("category");
reportContext.setPersistentGlobalVariable(var2,var1);
All this does is store a persistent variable named by the category with
a value that I want to access later. In this case my category has to be
unique. The second script is on the chart .
function beforeDrawDataPointLabel( dph, label, icsc )
{
var mycat = dph.getBaseDisplayValue();
var current = label.getCaption().getValue();
var ser2val =
icsc.getExternalContext().getScriptable().getPersistentGlobalVariable(mycat);
label.getCaption().setValue(current + "--" + ser2val);
}
The getBaseDisplayValue gets my unique category name and then I use this
to look up the variable I stored earlier.
Jason
On 5/10/2012 3:14 AM, Debarshi Dasgupta wrote:
> Hi Jason I tried adding the following tag as you have used in the shared
> example
> <property name="comments">
>
> But it is not working for me. Probably I am unable to use the script in
> the proper fashion.
>
>
> <property name="comments">Copyright (c) 2007 <<Your Company Name here>>
>
> Select Chart Type
> Chart Type: Line
> Subtype: Overlay
>
> Select Data
> Category Series: row["MONTH"]
> Value Series-1: row["A"]
> Value Series-2: row["B"]
> Value Series-2: row["COMMENT"]
>
> Format Chart
> Series->Series Palette->Remove first two colors
> Series->Value Series - 1: Tick Show Labels
> Tick Use Palette as Line Color: False
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Series->Value Series - 2: Tick Show Labels
> Tick Use Palette as Line Color: False
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Chart Area: Chart Title: Overlay Line Chart
> Chart Area->Axis->X-Axis: Gridlines->Ticks Style: Below
> Y-Axis: Gridlines->Ticks Style: Left
> Plot: Area Within Axes->Background: RGB(255, 255, 225)
> Legend: untick Visible
> ==============================================================
>
> Stacked Line Chart
> Select Chart Type
> Chart Type: Line
> Subtype: Stacked
>
> Select Data
> Category Series: row["MONTH"]
> Value Series-1: row["A"]
> Value Series-2: row["B"]
> Value Series-2: row["COMMENT"]
>
> Format Chart
> Series->Series Palette->Remove first two colors
> Series->Value Series - 1: Tick Show Labels
> Tick Use Palette as Line Color: False
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Series->Value Series - 2: Tick Show Labels
> Tick Use Palette as Line Color: False
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Chart Area: Chart Title: Stacked Line Chart
> Chart Area->Axis->X-Axis: Gridlines->Ticks Style: Below
> Y-Axis: Gridlines->Ticks Style: Left
> Plot: Area Within Axes->Background: RGB(255, 255, 225)
> Legend: untick Visible
> ==============================================================
>
> Percent Stacked Line Chart
> Select Chart Type
> Chart Type: Line
> Subtype: Percent Stacked
>
> Select Data
> Category Series: row["MONTH"]
> Value Series-1: row["A"]
> Value Series-2: row["B"]
> Value Series-2: row["COMMENT"]
>
> Format Chart
> Series->Series Palette->Remove first two colors
> Series->Value Series - 1: Tick Show Labels
> Tick Use Palette as Line Color: False
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Series->Value Series - 2: Tick Show Labels
> Tick Use Palette as Line Color: False
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Chart Area: Chart Title: Percent Stacked Line Chart
> Chart Area->Axis->X-Axis: Gridlines->Ticks Style: Below
> Y-Axis: Gridlines->Ticks Style: Left
> Plot: Area Within Axes->Background: RGB(255, 255, 225)
> Legend->Ticks Visible: False
> ==============================================================
> 3D Line Chart
> Select Chart Type
> Chart Type: Line
> Dimension: 3D
>
> Select Data
> Category Series: row["MONTH"]
> Value Series-1: row["A"]
> Value Series-2: row["B"]
> Value Series-2: row["COMMENT"]
>
> Format Chart
> Series->Series Palette->Remove first color
> Series->Value Series - 1: Tick Show Labels
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Series->Value Series - 2: Tick Show Labels
> Series Line Color: Cream (249, 225, 191)
> Marks->Marks: Triangle
> Chart Area: Chart Title: 3D Line Chart
> Chart Area->Axis->Rotation X Y Z( -10, 25, 0 )</property>
>
Jason Weathersby
BIRT Exchange
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02363 seconds