Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Plot column values as bar chart
icon5.gif  Plot column values as bar chart [message #491342] Wed, 14 October 2009 08:40 Go to next message
Jean-Baptiste L is currently offline Jean-Baptiste LFriend
Messages: 2
Registered: October 2009
Junior Member
Hi,

I use a dataset in which each row holds a fixed number of columns which I would like to plot as a bar chart (thus having one bar chart per detail row in a table). For instance, using the values 1,3,5,2,4 the bar chart would look like this:
     *
     *   *
   * *   *
   * * * *
 * * * * *
___________


I have been trying to drag a chart item into my table and select bar chart but when I click "Next", the "New Chart" wizard gives me a "Data engine operation failed due to an unexpected exception." message and I can not do anything meaningful (for me that is).

So what should I try next ? I was hoping to be able to define script variables for the X and Y series and plot them directly, but I dit not find a way to do this. Any pointers ?
Thanks.
Re: Plot column values as bar chart [message #491495 is a reply to message #491342] Wed, 14 October 2009 19:15 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

JB


This is possible with some script. Take a look at the at this example I
just posted on Birt Exchange.
http://www.birt-exchange.org/devshare/designing-birt-reports /1063-use-js-vars-to-create-a-chart-for-every-row-in-a-table /#description

Read the description for details.

Jason

JB Lièvremont wrote:
> Hi,
>
> I use a dataset in which each row holds a fixed number of columns which
> I would like to plot as a bar chart (thus having one bar chart per
> detail row in a table). For instance, using the values 1,3,5,2,4 the bar
> chart would look like this:
>
> *
> * *
> * * *
> * * * *
> * * * * *
> ___________
>
>
> I have been trying to drag a chart item into my table and select bar
> chart but when I click "Next", the "New Chart" wizard gives me a "Data
> engine operation failed due to an unexpected exception." message and I
> can not do anything meaningful (for me that is).
>
> So what should I try next ? I was hoping to be able to define script
> variables for the X and Y series and plot them directly, but I dit not
> find a way to do this. Any pointers ?
> Thanks.
Re: Plot column values as bar chart [message #491683 is a reply to message #491495] Thu, 15 October 2009 13:25 Go to previous messageGo to next message
Jean-Baptiste L is currently offline Jean-Baptiste LFriend
Messages: 2
Registered: October 2009
Junior Member
Jason,

Thank you for the example; I think I get how it works, however I keep getting this error:

Unable to process dataset content specified as null for dataset org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl@c4139b (values: null) ( 1 time(s) )
detail : org.eclipse.birt.report.engine.api.EngineException: Unable to process dataset content specified as null for dataset org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl@c4139b (values: null)
	at org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1163)
	at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.processExtendedContent(LocalizedContentVisitor.java:987)
	at org.eclipse.birt.report.engine.presentation.LocalizedContentVisitor.localizeForeign(LocalizedContentVisitor.java:553)
...


I use an SQL Select data set atop a MySQL JDBC data source and the values display just fine. I have tried to attach my report to this message but it seems that it won't accept it.

It looks like the "onCreate" script from my table detail line is never called - or at least, is not called before the "beforeGeneration" script of the chart, hence giving null values for the myCat and mySer variables.

Any clues ? Thanks again.

[EDIT]
My bad, the "onCreate" had a syntax error preventing the correct initialization of the global variables. Works like a charm, thank you very much !

[Updated on: Thu, 15 October 2009 13:40]

Report message to a moderator

Re: Plot column values as bar chart [message #491757 is a reply to message #491683] Thu, 15 October 2009 16:45 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

You can just select the xml view copy and paste into the message.
Make sure the chart is in a detail row. In my example you will notice I
have 2 detail rows. To get two you have to select a detail row and
right click on it and insert one below it.

Jason

Jean-Baptiste L wrote:
> Jason,
>
> Thank you for the example; I think I get how it works, however I keep
> getting this error:
>
> Unable to process dataset content specified as null for dataset
> org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl@c4139b (values:
> null) ( 1 time(s) )
> detail : org.eclipse.birt.report.engine.api.EngineException: Unable to
> process dataset content specified as null for dataset
> org.eclipse.birt.chart.model.data.impl.NumberDataSetImpl@c4139b (values:
> null)
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.add Exception(ExecutionContext.java:1163)
>
> at
> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.processExtendedContent(LocalizedContentVisitor.java: 987)
>
> at
> org.eclipse.birt.report.engine.presentation.LocalizedContent Visitor.localizeForeign(LocalizedContentVisitor.java:553)
>
> ..
>
> I use an SQL Select data set atop a MySQL JDBC data source and the
> values display just fine. I have tried to attach my report to this
> message but it seems that it won't accept it.
>
> It looks like the "onCreate" script from my table detail line is never
> called - or at least, is not called before the "beforeGeneration" script
> of the chart, hence giving null values for the myCat and mySer variables.
>
> Any clues ? Thanks again.
Previous Topic:Cleartext Database Password (odaPassword)
Next Topic:DataSet used by more that one table/grid
Goto Forum:
  


Current Time: Thu Apr 25 22:44:32 GMT 2024

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

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

Back to the top