bar chart with literal array for Category (x) series? [message #868859] |
Wed, 02 May 2012 16:34 |
Sean McNulty 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 |
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03389 seconds