Jump to content
We've recently updated our Privacy Statement, available here ×

Extra Bar in Stacked Bar Chart


bob_8

Recommended Posts

Hi guys...

I am using the Stacked Bar Chart but an extra bar with the length and lable of 0 (zero), that is NOT in my data is added to every stacked bar graph - but it won't show if I do a regular bar chart.

Has anyone seen this? If so, how did you get rid of it or is this a bug?

I am using Jasper 5.5.0 CE.

Thanks!

Bob

 

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Thaks for the note Hozawa. Here are the steps:

In Jasper Studio

1. File->New, then select the blank letter template

4. Add the query (it is tested in the DBMS first to make sure this is not a SQL issue)

3. Enlage title, drap the chart item into the Title  area, double click on Select 3D Stacked Bar

4. Create two series - one for a "yes" value, the other for the "no" value in one of the columns in the data. I am using $F{a}.contentEquals ("yes") or "no", to separae the two series.

5. specify a field for Value, and another for Category.

6. Preview in Studio - no errors. Everything shows up as expected, except the extra column.

7. Running the report programmatically also produces the same 0 column.

8. There are no 0 values in the data.

Thanks for any and all help or suggestions,

Bob

 

 

 

Link to comment
Share on other sites

Hozawa, could you post the <categoryDataset> portion of your report please? I am pretty sure I've narrowed the problem to what happens in that section.

Mine is:

<categoryDataset>
<categorySeries>
<seriesExpression><![CDATA[$F{a}.contentEquals( "yes" )]]></seriesExpression>
<categoryExpression><![CDATA[$F{c}]]></categoryExpression>
<valueExpression><![CDATA[$F{b}]]></valueExpression>
</categorySeries>
<categorySeries>
<seriesExpression><![CDATA[$F{a}.contentEquals( "no" )]]></seriesExpression>
<categoryExpression><![CDATA[0]]></categoryExpression>
<valueExpression><![CDATA[0]]></valueExpression>
</categorySeries>
</categoryDataset>
 
Note the CDATA[0] in the second seriesExpression (Studio generated this). It may not be possible to bin the numbers as I am trying. I might have to create multiple datasets, one for each series probably.
 
Anyway... it would be good to see what yours looks like... 
 
Thanks!
 
Bob
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...