Re: 3D pie chart in a JSP

"Nathaniel G. Auvil" <[email protected]> Wed, 16 Jun 2004 05:58:21 -0700 (PDT)
Newsgroups gmane.comp.krysalis.jcharts.user
Message-ID <[email protected]>
JSP's are not a good way to generate charts.   You should use a Servlet.  Sounds like your problem
is that there is white space somewhere in your jsp.  Any 'white spaces', will be translated into
something like: 'out.write( " " );' by the jsp compiler.  These can be a major pain in the ass to
track down.

JSP's, according to the Servlet Specification are not meant to output binary data; they should
only be used to output text.



--- [email protected] wrote:
> I get a blank image , similar to one when you have the wrong image
> path......
> I have checked the code a few times but cant seem to figure out why....
> Also I am using a BEA weblogic 8 portal server, don't think that should
> make any difference though.....
> 
> 
> 
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Nathaniel G. Auvil
> Sent: 15 June 2004 21:38
> To: [email protected]
> Cc: [email protected]
> Subject: Re: [jCharts-developers] 3D pie chart in a JSP
> 
> 
> 
> this is not the proper forum for this. Please discuss this in the Users
> Forum.
> 
> what is happening? An Exception?
> 
> 
> 
> --- [email protected] wrote:
> > Hi,
> > I was trying to create a 3d Pie chart via a JSP but it doesn't seem to
> 
> > work... Any ideas , do you know what I am doing wrong ????
> > 
> > See code below.....
> > 
> > 
> > Thanks
> > Karan
> > 
> > 
> > 
> > 
> > <%@ page 
> > import="java.awt.*,org.krysalis.jcharts.*,org.krysalis.jcharts.chartDa
> > ta
> > ..*,
> >
> org.krysalis.jcharts.properties.*,org.krysalis.jcharts.types.ChartType,o
> > rg.krysalis.jcharts.axisChart.*,
> >
> org.krysalis.jcharts.test.TestDataGenerator,org.krysalis.jcharts.encoder
> > s.JPEGEncoder13,
> >
> org.krysalis.jcharts.properties.util.ChartFont,org.krysalis.jcharts.enco
> > ders.ServletEncoderHelper"%>
> > <%@ page import="org.krysalis.jcharts.nonAxisChart.PieChart2D"%>
> > <%@ page import="org.krysalis.jcharts.nonAxisChart.PieChart3D"%>
> > <%
> > 	try
> > 	{
> >         int width = 30;
> >         int height = 50;
> > 		
> > 		PieChart2DProperties properties = new
> PieChart2DProperties();
> > 		LegendProperties legendProperties = new
> > LegendProperties();
> > 		legendProperties.setNumColumns( 2 );
> > 		legendProperties.setPlacement( LegendProperties.RIGHT );
> > 		ChartProperties chartProperties = new ChartProperties();
> >     
> >         double[] data= { 81d, 55d, 39d, 20.6d };
> >         String[] labels= { "BMW M5", "BMW M3", "Viper GTS-R", 
> > "Corvette Z06" };
> >         Paint[] paints= { Color.lightGray, Color.green, Color.blue, 
> > Color.red };
> > 
> >         PieChart3DProperties pieChart3DProperties= new 
> > PieChart3DProperties();
> >         PieChartDataSet pieChartDataSet= new PieChartDataSet( "Cars 
> > That Own",
> >                                                     data,
> >                                                     labels,
> >                                                     paints,
> >                                                     
> > pieChart3DProperties );
> > 
> >         PieChart3D pieChart3D= new PieChart3D( pieChartDataSet,
> >                                        new LegendProperties(),
> >                                        new ChartProperties(),
> >                                        400, 350 );
> > 
> >         
> >         //PieChart3D pieChart3D= new PieChart3D( pieChartDataSet,new 
> > LegendProperties(),new ChartProperties(),400, 350 );
> >         ServletEncoderHelper.encodeJPEG13( pieChart3D, 1.0f, response
> );
> > 	}
> > 	catch(Exception e)
> > 	{
> > 		System.out.println(e);
> > 	}
> > %>
> > 
> > 
> > 
> > -------------------------------------------------------
> > This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference 
> > Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer 
> > Conference, June 28 - July 1 at the Moscone Center in San Francisco, 
> > CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code 
> > NWMGYKND _______________________________________________
> > jCharts-developers mailing list 
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/jcharts-developers
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn
> from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> jCharts-developers mailing list [email protected]
> https://lists.sourceforge.net/lists/listinfo/jcharts-developers
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
> Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
> _______________________________________________
> jCharts-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jcharts-users
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND