StackedBarChart3D

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Ranjith
Posts: 8
Joined: Thu Oct 13, 2005 7:34 am

StackedBarChart3D

Post by Ranjith » Fri Oct 21, 2005 5:13 am

Hi All :) ,

I have to display a dynamic stackedbarchart with 3D Effect. I am suing StackedBarChart3D to create the chart and display will be through Cewolf.

I have data like this:

Month Assigned Completed UnAssigned Total
--------------------------------------------------------------------
Sep 200 50 30 280
Oct 0 0 0 0

The above data will come from a SQL Query. I have kept this result in a request session using

Code: Select all

request.setAttribute("monthlystatus", <queryresult>)
I am retrieving the result in a JSP page where i have used the code to display some thing like:

Code: Select all

<jsp:useBean id = "monthlystatus"......./>

<%
DatasetProducer categoryData = new DatasetProducer() { 
      public Object produceDataset(Map params) { 
              final String[] categories = { "Jan", "Feb", "March", "April" } // it should be dynamic data; 
              final String[] seriesNames =   { "Unassigned", "GateKeeper", "Assigned", "In Progress", "Completed" }; 

final Integer[][] startValues = new Integer[seriesNames.length][categories.length]; 

final Integer[][] endValues = new Integer[seriesNames.length][categories.length]; 

    for (int series = 0; series < seriesNames.length; series++) { 
              for (int i = 0; i < categories.length; i++) { 
                        int y = (int) (Math.random() * 100 + 1); 
                        startValues[series][i] = new Integer(y); 
                        endValues[series][i] = new Integer(y + (int) (Math.random() * 100)); 
     } 
 } 
DefaultIntervalCategoryDataset ds = 
new DefaultIntervalCategoryDataset(seriesNames, categories, startValues, endValues);  
return ds; 
} 
%>
My problem is , i am not able to refer the monthlystatus inside the DataSetProducer(since it is inner class, i have to do this way only).

Can anybody please help me how to refer the request object and where to mention the data exactly in order to get a good looking chart.
Thanks in advance.
Cheers,
Ranjith

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Fri Oct 21, 2005 11:49 am

Hi Ranjith,

Unfortunately I don't know much about JSP, so I can't really help. Perhaps someone else can...
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked