Displaying multiple charts of the same type on single page
Displaying multiple charts of the same type on single page
Is it possible to display several "bar" charts on one web page? For instance, I am retreiving data from the DB that is to be displayed on a graph. It is possible for me to have several data sets for one particular chart type (i.e., PIE, LINE) that I need to display on a single web page. Is this possible to do?
I am using STRUTS with this web app. My servlet retreives all the data that should be sent to graphing tool. I can currently display a PIE, TIMESERIES, LINE and BAR graphs all on one web page, but not multiples of the same type (i.e., can't display two PIE charts on the same graph).
My algorithm basically cycles through my result data and sets the data in session attributes. So, when I retrieve this data through my session attributes I access these attributes in the JSP to display the graphs. If I produced multiple graphs on the same type on a single web page, only the last dataset will be displayed, the others will be overwritten.
My algorithm basically cycles through my result data and sets the data in session attributes. So, when I retrieve this data through my session attributes I access these attributes in the JSP to display the graphs. If I produced multiple graphs on the same type on a single web page, only the last dataset will be displayed, the others will be overwritten.
I save them temporarily in the HTTPServlet request object and then I retreive them later via the <jsp:useBean> in my JSP. The problem is that each jsp:useBean has an instance of a chart type stored in it (i.e., PIE, BAR). So, based on this, I am not sure how to store multiple instances of the same chart type to be accessed later in my JSP.
I don't understand the way you are generating the charts, but (no offence) it seems just too complicated.ahopkins wrote:I save them temporarily in the HTTPServlet request object and then I retreive them later via the <jsp:useBean> in my JSP. The problem is that each jsp:useBean has an instance of a chart type stored in it (i.e., PIE, BAR). So, based on this, I am not sure how to store multiple instances of the same chart type to be accessed later in my JSP.
I only use ServletUtilities.saveChartAsPNG() to save the image temporarily and the DisplayChart to retrieve them.
Sometimes all the fancy frameworks like struts, spring, jsp, etc... create more burden than benefit.
It is a very simple framework to generate the charts. Below is a very simple to understand explanation.
1) User clicks on link on web page
2) Web app retrieves all data from Oracle DB
3) DataSets are stored in a Collection (i.e., Map) DataSets will consist of metadata about a various chart type
4) Loop through stored data and produce charts based on the data
**My problem is coming in when I have to display multiple charts of the same type on one single page. I.E., if the result set data from the database contains two sets of data for a PIE chart to be displayed on a single page. I am using the STRUTS framework, because this is being used for the other web apps, and it will make integration easier. BUT, since I am sending all of the datasets to the graphing tool at one time, sending multiple datasets of the same chart type would not allow for me to display all my charts. Because I am temporarily storing the dataset for the producer bean in the request object and accessing it later in the JSP for display, it limits my ability to display multiple datasets for a particular chart type (i.e., PIE, BAR).
Do you understand the problem a little better?
1) User clicks on link on web page
2) Web app retrieves all data from Oracle DB
3) DataSets are stored in a Collection (i.e., Map) DataSets will consist of metadata about a various chart type
4) Loop through stored data and produce charts based on the data
**My problem is coming in when I have to display multiple charts of the same type on one single page. I.E., if the result set data from the database contains two sets of data for a PIE chart to be displayed on a single page. I am using the STRUTS framework, because this is being used for the other web apps, and it will make integration easier. BUT, since I am sending all of the datasets to the graphing tool at one time, sending multiple datasets of the same chart type would not allow for me to display all my charts. Because I am temporarily storing the dataset for the producer bean in the request object and accessing it later in the JSP for display, it limits my ability to display multiple datasets for a particular chart type (i.e., PIE, BAR).
Do you understand the problem a little better?
Re: Displaying multiple charts of the same type on single page
I have same issue, am trying to display multiple charts on page, but am getting same chart multiple times.The session object am adding is not updating with new chart object.