I have configured JFree chart for my charting purpose and could plot the bar chart using <c:chart> tag and CategoryDataset. Now i would like to customize the chart from my backing bean and display in jsf page. But i'm getting " org.jfree.chart.JFreeChart@133c2d2 " in the page while displaying. Following the code for generating the chart
The pieDataSet is the DefaultCategoryDataset to display the bar graph. I could display the chart using this. Now i want more customization on the graph.
For Jfree chart support, I have included all needed jars (chartcreator, jfreechart & jcommon) in the app.
Regards, Rose
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35440
9
posted
0
OK, so you are using a 3rd party charting component called jsf-comp. The fact that you were able to pass a DataSet parameter in the datasource attribute makes me think that you can't substitute a JFreeChart instead, which is a completely different beast. Have you seen anything that indicates this should be possible?
Roshnara Rose
Greenhorn
Joined: Nov 08, 2005
Posts: 15
posted
0
I'm trying to build the UI from the bean. For that i can't use the <c:chart> tag as it offers only limited customization. In the code i'm getting the <h anelGrid id="barGraph") and trying to add the chart as a child to it.
I'd be very surprised if the JSF tags knew what to do with a JFreeChart component. That's what that library is for, after all.
My preferred way of including JFreeChart images in JSPs is the cewolf library, which is linked in my signature. It has a number of so-called "post processors" that can be used to customize charts; if none of those do what you need, then it's not hard to write your own.
Roshnara Rose
Greenhorn
Joined: Nov 08, 2005
Posts: 15
posted
0
Hi,
I could generate the byte[] for the jfreechart image. Right now i'm looking for an option to render this byte[] as an image in jsf page.
I have the same problem where the chart is not being displayed in a JSF page. I see org.jfree.chart.JFreeChart@133c2d2 " in the page source while displaying.
Were you able to fix this problem? Please share any ideas that I can use
Thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35440
9
posted
0
Hello "tester testser "-
Welcome to JavaRanch.
On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.
As to your question, how are you trying to display the chart? A chart image (or a JFreeChart object) is not something you can output from a JSP/JSP page. You need to embed an <img> link that points to an URL where an image generated from that chart can be gotten. A library like cewolf (or apparently "jsf-comp") can do this for you.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.