|
Re: Plot column values as bar chart [message #491495 is a reply to message #491342] |
Wed, 14 October 2009 19:15 |
|
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 |
Jean-Baptiste L 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 |
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03121 seconds