views:

53

answers:

1

Hi, I want to add date in HH:MM:SS format to the x-axis of XY-Line chart. I am using follwing code to do it. xValueExpression ![CDATA[new SimpleDateFormat("HH:mm:ss").format($F{time})]] /xValueExpression

But it is giving error as can not convert from string to number. Because XY-Line chart takes number on X and Y axis.

So how to achieve this? Or there is any other way to achieve this?

A: 

I have found that it was easier to create charts from your java code (using JFreechart in my case), write the chart in an image and pass it to Jasper. In my case, I always use custom datasources and the charts are inputstream parameters. When you build the charts yourself you have full access to the JFreechart API.

Guillaume