mkeym Posted June 15, 2010 Share Posted June 15, 2010 Hey all,i get some problems when i try to create a xylinechart in jasperreports.Is it better if i create timeseries charts or xylinecharts.I want to explain my behaviour:I connect to a database from i build reports. at last i need to create charts for this dynamic reports.All reports depend on time, so i try to use x-axis as time axis and y-axis should be the value axis.The problem is that my time in database is as string so i cannot create these charts.can anybody help me how to realise these reports?Thanks Code:<field name="DESCRIPTION" class="java.lang.String" /><field name="HALFHOUR" class="java.lang.String" /><field name="VALUEA" class="java.lang.Double" />----<xyLineChart> <chart evaluationTime="Report"> <reportElement x="0" y="0" width="555" height="350" /> </chart> <xyDataset> <dataset incrementType="None" /> <xySeries> <seriesExpression><![CDATA[$F{DESCRIPTION}]]></seriesExpression> <xValueExpression><![CDATA[$F{HALFHOUR}]]></xValueExpression> <yValueExpression><![CDATA[$F{VALUEA}]]></yValueExpression> </xySeries> </xyDataset> <linePlot> <plot /> </linePlot> </xyLineChart> Link to comment Share on other sites More sharing options...
thangalin Posted June 21, 2010 Share Posted June 21, 2010 http://java.sun.com/javase/6/docs/api/java/text/DateFormat.html Use a variable. Assign the variable to something like: (new java.text.SimpleDateFormat( "HH:mm:ss" )).parse( $F{HALFHOUR} ) You should then be able to use the variable in the time series. If not, you might have to convert it to a java.util.Date or equivalent. Link to comment Share on other sites More sharing options...
mkeym Posted June 26, 2010 Author Share Posted June 26, 2010 Thank you for help,but when i try this i get this message: Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.jfree.chart.ChartFactory.setChartTheme(Lorg/jfree/chart/ChartTheme;) Link to comment Share on other sites More sharing options...
mkeym Posted June 26, 2010 Author Share Posted June 26, 2010 Code: Post Edited by mkeym at 06/26/2010 12:50 Link to comment Share on other sites More sharing options...
mkeym Posted June 26, 2010 Author Share Posted June 26, 2010 ... Post Edited by mkeym at 06/26/2010 16:03 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now