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

problem with charts


rajesh

Recommended Posts

Hi,
I want to draw a bar graph as per attached document.
Please go through attached document.
problem is that i want date on Y-axis but ireport throws an exception that it can not convert date to a number.

second problem is that how can i show these bars in only two colors as per my attached document.



third problem is that I want also display legends with some text(discription) as shown in attached documnet.

Please do some favour for me it's urgent.
thanx in advance.:( :( [file name=doubt.xls size=113664]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/doubt.xls[/file]

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Here are my suggestions, please keep in mind that I haven't tested since I have no sample db with data to test:

 

1. For dates in the Y axis there's a problem, y axis should be values and looks like no way around it. Not sure if that's even possible in Excel. Look for another approach like a time series chart.

 

2. The colors is achived with the category expresion in the chart data category series definition. One color is assigned for each different category there.

 

3. Use label expression in the category series definition (see 2 above)

Link to comment
Share on other sites

  • 2 weeks later...

The ability to specify series colors in charts is coming soon, hopefully 1.2.7. Then you can specify bar colors without writting any Java code.

 

The Label expression allows you to specify an optional description of the axis, for example "Total Freight", "Country", etc. It gets displayed next to the axis line in the chart.

 

Finally, our charting engine doesn't allow you plot dates, only values. On the other hand, dates really are numeric - try plotting $F{datefield}.getTime(). Currently the y axis won't show the value as a date, but the same release with color support will add the ability to format the axis tick mark labels, so then you will be able to convert the long back into a time.

 

-Barry

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...