From: Nathaniel G. A. <nat...@ya...> - 2002-12-04 01:47:05
|
--- "Nathaniel G. Auvil" <nat...@ya...> wrote: > Date: Tue, 3 Dec 2002 17:46:20 -0800 (PST) > From: "Nathaniel G. Auvil" <nat...@ya...> > Subject: Re: Regarding jCharts Samples > To: Ravi <rvb...@re...> > > > do you set the mime type for the return image? If you enocde using the method which takes a > HttpServletResponse it does this automatically. > > Have you tried mozilla or another browser? Just curious if you saw the same behavior. > > Could you just make you Servlet mapping: "ChartServlet.jpg" in your web.xml file? > > > > > --- Ravi <rvb...@re...> wrote: > > Hello Nathaniel, > > > > Thankyou for your support with my previous queries regarding > > jCharts. > > > > I ve a minor query about printing the charts from a jsp page, i ve > > modified the sample provided, the code snippet is as follows: > > > > ....... > > <tr> > > <td bgcolor="Silver"><img border="0" src="../ChartServlet" > > useMap="#chartMap"></td> > > > > </tr> > > ....... > > > > on the jsp page with chart loaded and displayed, i ve a print > > button which uses javascript to call browser's print function > > (ctrl-P internet explorer), in the print i get everything other > > than the chart image, the html code snippet renederd to the > > browser is as : > > ... > > <tr> > > <td colspan="5" align="center"><img border="0" > > src="../ChartServlet" useMap="#chartMap"></td> > > </tr> > > ... > > > > now if you see the src property of img shows no extension to the > > image file. > > > > > > for testing purpose, i [Saved As] the rendered jsp to html on my > > local disk, there was jpg extension given to image name showed > > below: > > > > .... > > > > <tr> > > <td colspan="5" align="center"><img border="0" > > src="../ChartServlet.jpg" useMap="#chartMap"></td> > > </tr> > > > > ... > > > > I printed this, the chart is also printed. > > > > But the application, i m using jCharts, has an online printing > > functionality where no chart image is printed. > > > > I would be thankful, if you can help me out with this problem as > > the development using jCharts is over. > > > > > > Note: there is no problem with charts being displayed on the > > screen. > > > > > > Reply Awaited. > > > > Regards, > > > > Ravi Bhatia. > > Team Lead, CIPL > > > > > > > > ############# > > > > On Wed, 13 Nov 2002 Nathaniel G. Auvil wrote : > > > > > >I am not sure what you are asking. > > > > > >The ChartServlet used in the demo code was just for that demo > > >code and not intended to be part of > > >the core jcharts API. You certainly can copy it from the demo > > >and modify it to do whatever you > > >need. > > > > > >Each chart on a page needs a separate request to the Server. so > > >you would need two or more <img> > > >tags. > > > > > >Yes, the encode(...) methods return void. Would you prefer them > > >to return something? > > > > > > > > > > > > > > >--- Ravi <rvb...@re...> wrote: > > > > Hello Nathaniel, > > > > > > > > Thank you for the guidance. I ve a query about chart servlet, > > >i > > > > used the servlet for viewing more than 1 graph on one page > > >with > > > > different data inputs and different types of graphs > > >(charts). > > > > Secondly, the encoder/encoder13 class returns nothing > > >(void), > > > > could you pls. clear my doubt about the encoding technique you > > >ve > > > > used. I m stuck at this point for using jChart for more than > > >1 > > > > graph on jsp page and about the encoding technique. > > > > > > > > Reply awaited. > > > > > > > > Regards, > > > > Ravi. > > > > > > > > > > > > On Fri, 01 Nov 2002 Nathaniel G. Auvil wrote : > > > > > > > > > >hi ravi. > > > > > > > > > >all the user guide charts use randomly generated data for > > >the > > > > >plots. If you download the user > > > > >guide, it includes all the source used to generate the > > >charts. > > > > > > > > > > > > > > >here is the code it used to generate a LineChart: > > > > > > > > > > > > > > > > > > >/******************************************************************************************/ > > > > > private void basicChart() throws ChartDataException > > > > > { > > > > > String[] xAxisLabels= { "1998", "1999", "2000", "2001", > > > > >"2002", "2003", "2004" }; > > > > > String xAxisTitle= "Years"; > > > > > String yAxisTitle= "Problems"; > > > > > String title= "Micro$oft at Work"; > > > > > DataSeries dataSeries = new DataSeries( xAxisLabels, > > > > >xAxisTitle, yAxisTitle, title ); > > > > > > > > > > > > > > > double[][] data= TestDataGenerator.getRandomNumbers( 1, 7, > > >0, > > > > >6000 ); > > > > > String[] legendLabels= { "Bugs" }; > > > > > Paint[] paints= TestDataGenerator.getRandomPaints( 1 ); > > > > > > > > > > Stroke[] strokes= { > > >LineChartProperties.DEFAULT_LINE_STROKE > > > > >}; > > > > > Shape[] shapes= { PointChartProperties.SHAPE_CIRCLE }; > > > > > LineChartProperties lineChartProperties= new > > > > >LineChartProperties( strokes, shapes ); > > > > > > > > > > AxisChartDataSet axisChartDataSet= new AxisChartDataSet( > > >data, > > > > >legendLabels, paints, > > > > >ChartType.LINE, lineChartProperties ); > > > > > > > > > > dataSeries.addIAxisChartDataSet( axisChartDataSet ); > > > > > > > > > > ChartProperties chartProperties= new ChartProperties(); > > > > > AxisProperties axisProperties= new AxisProperties(); > > > > > LegendProperties legendProperties= new > > >LegendProperties(); > > > > > > > > > > AxisChart axisChart= new AxisChart( dataSeries, > > > > >chartProperties, axisProperties, > > > > >legendProperties, AxisCharts.width, AxisCharts.height ); > > > > > > > > > > super.exportImage( axisChart, "basicChart" ); > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >--- "Ravi Bhatia." <rvb...@re...> wrote: > > > > > > Hello, > > > > > > > > > > > > This is in reference to Jchart Examples mentioned in > > >your > > > > > > site. The snippet provided for Linechart is not > > >generating > > > > >the > > > > > > corresponding chart when we executed in JSP page. Would > > > > > > you pls help us in this regard. We would be grateful if > > >you > > > > > > could send us some code-snippets which will fetch the > > >data > > > > > > from outside entity dynamically and plot the graph > > > > > > accordingly. > > > > > > > > > > > > thanking you. > > > > > > awaiting your reply. > > > > > > > > > > > > Ravi Bhatia. > > > > > > Technical Team Lead. > > > > > > CIPL, Mumbai. > > > > > > > > > > > > > > >===== > > > > >An easy read on your Digital Rights Disappearing > > > > > > > >[http://newsforge.com/newsforge/02/10/21/1449250.shtml?tid=19] > > > > > > > > > >__________________________________________________ > > > > >Do you Yahoo!? > > > > >HotJobs - Search new jobs daily now > > > > >http://hotjobs.yahoo.com/ > > > > > > > > > > > > Whistler. > > > > > > > > >===== > > >An easy read on your Digital Rights Disappearing > > >[http://newsforge.com/newsforge/02/10/21/1449250.shtml?tid=19] > > > > > >__________________________________________________ > > >Do you Yahoo!? > > >U2 on LAUNCH - Exclusive greatest hits videos > > >http://launch.yahoo.com/u2 > > > > > > > > Whistler. > > > ===== > An easy read on your Digital Rights Disappearing > [http://newsforge.com/newsforge/02/10/21/1449250.shtml?tid=19] > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > ===== An easy read on your Digital Rights Disappearing [http://newsforge.com/newsforge/02/10/21/1449250.shtml?tid=19] __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com |