Charts

Hi

I am new to IReport..Can anybody tell me how to create a chart..how do i change the co-ordinates for example in a bar chart..for me..it come like 0.0,0.5,1.0 etc..i don't want it like that...

pie chart does'nt work for me..i tried the example given in demo\samples\charts.. but nothing comes in the output..can anybody plz help me...



Thanks
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago

34 Answers:

I am new to the forum..

If there is already a post regarding this..iam sorry..
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago
I'm a little unclear on what the issue with the bar chart is - is it not creating the chart correctly, or is it working but the tick marks on the axis are not what you want?

On the pie chart demo - does anything show up? Is the demo database running? Any errors reported? Some info on what version of iReport, JaserReports, the JVM, etc would help too.

-Barry
bklawans's picture
3890
Joined: Jul 6 2006 - 1:21pm
Last seen: 6 years 1 day ago

I am using Japer Reports 1.2.5 , Ireport 1.2.5 and jdk 1.5..

I have attached the results of the demo chart i get and of the one i created..mine has both pie and bar charts..


The pie chart does'nt show up..I want to change the ticks in bar chart..What reset type and increment type should i use..i have attached my jrxml file too..

If u want any more info..i will give..

Thanks

Post edited by: divsen, at: 2006/08/26 17:08

Attachments: 
AttachmentSize
Binary Data graph.jrxml5.75 KB
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago


Post edited by: divsen, at: 2006/08/26 17:03

Attachments: 
AttachmentSize
PDF icon chart.pdf6.11 KB
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago

This is the demo file

Iam not able to save it as pdf..if i save it a .jprint..i cannot post it here..i saved as html..but it is not clear..coz i can post only 1 file and the images the html needs are not there

Post edited by: divsen, at: 2006/08/26 17:07

Attachments: 
AttachmentSize
HTML icon demo.html26 KB
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago
It looks like the problem is with the empty <incrementWhenExpresion></incrementWhenExpression> that is in both chart's datasets. If I remove them you report runs and both charts display. I'll take a look and see if its a bug in JasperReport. Also, I'm not quite sure what you want pie chart to show, but as it written it will have one slice named "Ages". You should change the keyExpression to be $F{Name}.

-Barry
bklawans's picture
3890
Joined: Jul 6 2006 - 1:21pm
Last seen: 6 years 1 day ago
I want to display the Ages in the pie chart..Number of people with a particular age as one slice..I may have given the values wrongly..I am new to this.. Did this answer your question..

Thanks
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago
I see. You need to create a group that changes when the ages change, and add an "order by" clause to the query so that the data comes back sorted by age. Then use the $F{age} as the key of the pie chart and $V{groupname_COUNT} as the value.

If you don't want the data in the table to be sorted by age, create a second query (dataset) for the pie chart to use. If you go that route you might as well use "group by" to select the age and the counts directly from the RDBMS and not bother creating a group.

-Barry
bklawans's picture
3890
Joined: Jul 6 2006 - 1:21pm
Last seen: 6 years 1 day ago
I tried everything you told..but still my pie chart does'nt show up...What should i do if i want the same results with a bar chart??


Thanks
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago

Take a look at the attached version.

-Barry

Attachments: 
bklawans's picture
3890
Joined: Jul 6 2006 - 1:21pm
Last seen: 6 years 1 day ago

I have attached my result for the file u gave..

I think something is set wrongly in my system..which makes it appear like this..Because i cannot think of any other reason..

This is driving me crazy..


Can u post what result the same file produces for you.

Thank you very much..

Post edited by: divsen, at: 2006/08/28 21:40

Attachments: 
AttachmentSize
PDF icon ch.pdf8.55 KB
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago

Here is what I get. Do you see any error messages anywhere?

-barry

Attachments: 
AttachmentSize
PDF icon graph.pdf20.54 KB
bklawans's picture
3890
Joined: Jul 6 2006 - 1:21pm
Last seen: 6 years 1 day ago
It is not showing any errors..Is there any settings i must make..or nay jar files that must be added..i downlaoded the ireports windows installer and installed it on my system..

one more question..when it try to use a report with a chart in a web page..it says some org package class is not found..which is the jar i must include for that..i have included the jasperreports-1.2.5.jar file in my lib folder..

Thanks
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago
hai bklawans,

i have a similiary problem like divsen. When i create a 3D PieChart and compile that from ireport, i have a page that show a 3d PieChart.

But when i try to compile on the fly from a Servlet. my 3d PieChart does not show.

Can you help ?


TIA,

andy susanto
andysusanto's picture
Joined: Aug 21 2006 - 4:57pm
Last seen: 8 years 6 months ago
Take a look at the webapp sample that is included with JasperReports. in the html.jsp page you can see there are some options to the JRHtmlExporter that need to be set to support images properly.

-Barry
bklawans's picture
3890
Joined: Jul 6 2006 - 1:21pm
Last seen: 6 years 1 day ago
hai,

i already follow the html.jsp, but i still cannot see my chart, could you give a war example, so i can see a diff
between my code and html.jsp

because what i see in the html.jsp is look like with my servlet code.


TIA,

andy susanto
andysusanto's picture
Joined: Aug 21 2006 - 4:57pm
Last seen: 8 years 6 months ago
The webapp example does run in a war - try typing "ant war".

Take a look at the HTML of the web page without the chart and take a look at what the img tag is using as the source of the image - that should give you a pretty good clue. You may alse need to run your appserver with JDPA enabled and use a debugger to figure out what is going on in your environment.

-Barry
bklawans's picture
3890
Joined: Jul 6 2006 - 1:21pm
Last seen: 6 years 1 day ago
hai again,


i examine the img tag, Jaspereport create img_0_0_4, but when i try to find that file, i cannot find it. so what wrong, i thing i still miss some code



TIA,

andy susanto
andysusanto's picture
Joined: Aug 21 2006 - 4:57pm
Last seen: 8 years 6 months ago
Hi
i am a newbie
thanks for sending the sample file Graph-4f8494a4d7ae9448740bc652ee7da0c8.xml
i have run the above file from ireport and i am able view the data in table but i am not able to view the pie chart,bar chart

Is there any settings to be done.
I am using ireport 1.2.5
thanks
Sunitha's picture
351
Joined: Aug 22 2006 - 9:07pm
Last seen: 16 years 7 months ago
Use new Boolean(true) as filter expression in the chart

This is a workaround for a bug introduced in iR 1.2.5

Giulio
giulio's picture
70456
Joined: Jan 2 2007 - 4:15pm
Last seen: 2 weeks 5 days ago
Thank you very much....was caught up with this problem for so long..
divsen's picture
822
Joined: Aug 22 2006 - 6:02am
Last seen: 16 years 7 months ago
hey
thank u so much
i have generated the charts
Sunitha's picture
351
Joined: Aug 22 2006 - 9:07pm
Last seen: 16 years 7 months ago
hi
i am trying to integrate my charts with jsp pages.
i am getting the following error.

java.lang.NoClassDefFoundError: org/jfree/ui/Drawable

Is there any jar files i should kept or any class path settings?

thank you
Sunitha's picture
351
Joined: Aug 22 2006 - 9:07pm
Last seen: 16 years 7 months ago
i have gone through the forums i have integrated the charts
thanks to all of u
Sunitha's picture
351
Joined: Aug 22 2006 - 9:07pm
Last seen: 16 years 7 months ago

I m facing same problem like 0.0,0.5,1.0,1.5,2.0.....

I dont wnt like this if u have any solution of this please
help me

I m attaching 1 file please see at once

Thanx in Advance

Post edited by: kapilnarula2112, at: 2006/10/05 08:10

Attachments: 
kapilnarula2112's picture
Joined: Oct 4 2006 - 5:49pm
Last seen: 16 years 5 months ago
Hi,
I am also having problem when working with Chart Tool in iReport.
I am working with IReport 1.2.5, I donot have any problem when generating simple reports.

I am not able to generate reports using Chart Tool.
I am using Oracle 10g, I have connected to Oracle 10g from IReport through

"oracle.jdbc.driver.OracleDriver"
I have given one query, which retrives two fields ( one is Varchar2 and another one is

Number of Oracle table) and I want to Plot these two fields throgh YX Bar of IReport.
When I draw this YX Bar and execute the report, getting ClassCast Exception.
IReport internally converting Number field of oracle into java.math.BigDecimal
How to plot YX Bar or any other Chart Tool in IReport?

Thanks in Advance!
Rags
Rags's picture
340
Joined: Oct 5 2006 - 2:54pm
Last seen: 16 years 5 months ago
Hi,
I am also having problem when working with Chart Tool in iReport.
I am working with IReport 1.2.5, I donot have any problem when generating simple reports.

I am not able to generate reports using Chart Tool.
I am using Oracle 10g, I have connected to Oracle 10g from IReport through

"oracle.jdbc.driver.OracleDriver"
I have given one query, which retrives two fields ( one is Varchar2 and another one is

Number of Oracle table) and I want to Plot these two fields throgh YX Bar of IReport.
When I draw this YX Bar and execute the report, getting ClassCast Exception.
IReport internally converting Number field of oracle into java.math.BigDecimal
How to plot YX Bar or any other Chart Tool in IReport?

Thanks in Advance!
Rags
Rags's picture
340
Joined: Oct 5 2006 - 2:54pm
Last seen: 16 years 5 months ago
Hi,
Requirement is very urgent..
If any body knows how to work with Chart Tool ( Bar Chart, YX Bar, Pie, Pie 3D etc)of IReport.. Please let me know the process..

Thanks in Advance..
Rags
Rags's picture
340
Joined: Oct 5 2006 - 2:54pm
Last seen: 16 years 5 months ago
You staff people have to do something about this spam. Anyway, I have a problem with charts. I made a histogram chart, and it works fine. The problem is that the label of the higher value is cut from the top of the margin of the chart. Then just half of the label (or less) is shown in the chart. Hope I explained it clearly. Can anybody help me? Thank you.
golreich's picture
208
Joined: Sep 23 2008 - 6:38am
Last seen: 14 years 6 months ago
Ok, maybe I did not explain it well. I would like to move the label shown at the top of every bar of the histogram, because if they are on the top I have the higher one cut by the margin of the chart. For this reason, I was wondering if there's a way to move these labels or make them better visible. I looked for in the graph option menu, but I just found the option show/hide labels. Any help is really appreciated.
golreich's picture
208
Joined: Sep 23 2008 - 6:38am
Last seen: 14 years 6 months ago

Hi All,

 

I have a problem with creating bar chart in ireport 3.0.0

I was able to create the pie chat and it works fine, I am trying to create bar chat and all I get is y -axis with 0.0, 1.0 ....

can someone please help me out.

 

Thanks

Bill

billa009's picture
Joined: Aug 12 2008 - 6:47am
Last seen: 14 years 7 months ago

Hi

only pie chart is working on ireport 3.0  I couldn't get any other chart working

can someone please help me out. Do I have to download any jars? or any special way to do the chart?

billa009's picture
Joined: Aug 12 2008 - 6:47am
Last seen: 14 years 7 months ago

Hi All,

 

I am also new to this ireport.i have gone through all the replies.i am also facing the same problem,charts were displaying but texts are not displaying. i am using ireport 3.0.0 .can any one suggest me for my problem.

where i can find filter expression in ireport 3.0.0

Thanks in advance

sunybuny's picture
107
Joined: Apr 8 2009 - 2:31am
Last seen: 13 years 11 months ago

sunybuny,

 

This thread is both really old and really long. I think you'll need to repost to a new thread with a more precise question to get a helpful response.

 

Having said that, I'll make one guess: If you want to filter what gets displayed in a chart then you need to set the "Increment When expression". Yes, that's a bad name. It was changed in iReport 3.5.0 to "Filter expression".

 

Regards,
Matt

mdahlman's picture
34280
Joined: Mar 13 2007 - 2:43am
Last seen: 8 years 4 months ago
Feedback