import java.sql.*; import java.lang.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class BarConfigServlet extends HttpServlet { // // This simple servlet is designed to demonstrate how a servlet can be used // to return configuration information to either the graphing applet or servlet. // // For further information visit, // http://www.jpowered.com/bar_graph/shbarchart/ // //----------------------------------------------------------------------------- public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); ServletOutputStream out = res.getOutputStream(); // Return the Data out.println(ConfigData()); } // End doGet //----------------------------------------------------------------------------- public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {doGet(request, response);} //----------------------------------------------------------------------------- public static String ConfigData() { String rsltStr = " \n"+ "3D: true \n"+ "grid: true \n"+ "axis: true \n"+ "xlabels: true \n"+ "outline: true \n"+ "legend: true \n"+ "autoscale: false \n"+ "gradientfill: true \n"+ " \n"+ "width: 450 \n"+ "height: 420 \n"+ "nCols: 6 \n"+ "nRows: 10 \n"+ "ndecplaces: 0 \n"+ "nSeries: 3 \n"+ "chartScale: 3000 \n"+ "chartStartX: 0 \n"+ "labelOrientation: 0 \n"+ "labelsX: 25 \n"+ "labelsX_offset: 15 \n"+ "bar_spacing: 6 \n"+ "barwidth: 30 \n"+ "depth3D: 15 \n"+ "linkcursor: hand \n"+ "BackgroundColor: #FFFFFF \n"+ "barOutlineColor: black \n"+ " \n"+ "gridxpos: 75 \n"+ "gridypos: 350 \n"+ "hSpace: 30 \n"+ "gridStyle: 2 \n"+ "gridColor: 50,50,50 \n"+ "axisColor: 0,0,255 \n"+ "floorColor: 0,255,0 \n"+ "gridbgcolor: #80FFFF \n"+ "gridbgimage: gridbg2.gif \n"+ " \n"+ "xlabel_font: Arial,N,12 \n"+ "ylabel_font: Arial,I,10 \n"+ "popupfont: Arial,B,12 \n"+ "labelColor: 255,0,0 \n"+ "popupbgcolor: light grey \n"+ "popup_pre: $ \n"+ "popup_post: \n"+ "xlabel_pre: $ \n"+ "xlabel_post: \n"+ " \n"+ "label1: January \n"+ "label2: February \n"+ "label3: March \n"+ "label4: April \n"+ "label5: May \n"+ "label6: June \n"+ " \n"+ "legendfont: Arial,N,10 \n"+ "legendposition: 325,200 \n"+ "legendtitle: Legend Title \n"+ "LegendBackground: 240,240,240 \n"+ "LegendBorder: grey \n"+ "LegendtextColor: #000000 \n"+ " \n"+ " \n"+ "title: Sales by Quarter|150,15|TimesRoman,BI,18|dark grey \n"+ "xtitle: Year 2001|150,420|TimesRoman,B,16|blue \n"+ "ytitle: Value $|10,200|TimesRoman,B,16|blue \n"+ " \n"+ " \n"+ "series1: 199,199,199|Series 1|http://www.jpowered.com|new \n"+ "series2: 200,100,100|Series 2 \n"+ "series3: 100,100,200|Series 3 \n"+ " \n"+ " \n"+ "target1: dark green|4|-7000|Profit|Arial,N,10 \n"+ "target2: dark blue|1|7000|Profit2|Arial,B,12 \n"+ " \n"+ " \n"+ "text1: Note :|325,60|TimesRoman,N,12|0,0,255 \n"+ "text2: New product range|325,80|TimesRoman,N,12|0,0,0 \n"+ "text3: launched during|325,100|TimesRoman,N,12|0,0,0 \n"+ "text4: March.|325,120|TimesRoman,N,12|0,0,0 \n"+ " \n"+ " \n"+ "image1: ./images/logo.gif,10,10 \n"+ "image2: ./images/productimage1.gif,10,30 \n"+ "image3: ./images/productimage2.gif,10,30 \n"+ "image4: ./images/productimage3.gif,10,30 \n"; return(rsltStr); } //----------------------------------------------------------------------------- } // End class