Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » bar chart with literal array for Category (x) series?
bar chart with literal array for Category (x) series? [message #868859] Wed, 02 May 2012 16:34 Go to next message
Sean McNulty is currently offline Sean McNultyFriend
Messages: 1
Registered: May 2012
Junior Member
I'm new to BIRT and wondering if I can create a bar graph using Category information that's not present in my Data? Can I set the expression to something like {"Vanilla", "Chocolate", "Strawberry"} instead of grabbing it from a data source?

Basically, my data source is a flat file from some survey software. The columns don't seem to work well for what I thought would be a pretty simple chart, and I have no way to alter the csv files. What I have is something like this:

Vanilla Chocolate Strawberry
yes no yes
yes no no
no yes no
yes yes yes


I need to make a bar chart showing the total count of each flavor. There is no column listing the flavors, though. I've tried every variation I can think of to add them as constants, like I showed above, but nothing has worked. I've tried adding them through a script when the chart is rendered, but for some reason I get a syntax error as soon as I try to define a new String[] array. The error points to the empty brackets as if it doesn't understand the array, am I forgetting to import a package?


thanks!

-sean
Re: bar chart with literal array for Category (x) series? [message #869673 is a reply to message #868859] Thu, 03 May 2012 16:29 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Sean,

You can do this with script. Have a look at the attached example.

Jason

On 5/2/2012 12:34 PM, Sean McNulty wrote:
> I'm new to BIRT and wondering if I can create a bar graph using Category
> information that's not present in my Data? Can I set the expression to
> something like {"Vanilla", "Chocolate", "Strawberry"} instead of
> grabbing it from a data source?
>
> Basically, my data source is a flat file from some survey software. The
> columns don't seem to work well for what I thought would be a pretty
> simple chart, and I have no way to alter the csv files. What I have is
> something like this:
>
> Vanilla Chocolate Strawberry
> yes no yes
> yes no no
> no yes no
> yes yes yes
>
>
> I need to make a bar chart showing the total count of each flavor. There
> is no column listing the flavors, though. I've tried every variation I
> can think of to add them as constants, like I showed above, but nothing
> has worked. I've tried adding them through a script when the chart is
> rendered, but for some reason I get a syntax error as soon as I try to
> define a new String[] array. The error points to the empty brackets as
> if it doesn't understand the array, am I forgetting to import a package?
>
>
> thanks!
>
> -sean
>
Previous Topic:LINKING
Next Topic:Parse data into second Data Set
Goto Forum:
  


Current Time: Sun Jan 26 08:29:21 GMT 2020

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

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

Back to the top