Creating Bar Charts using Java and Display in jsp

Hi..Is it possible to create a servlet that processes data from database and display the values as Bar Charts in jsp pages. If its possible, is there any examples on how to achieve that?

I don't get it. You already know what needs to be done to solve your problem, the only thing you are missing is the HOW. That's the easy part, if only you break down what you have to know:
1) how do I show an image on a website (this is a basic HTML question actually, not actually related to servlets/JSPs directly)
2) how do I fetch the path from a database (JDBC question) so that I can use this path to link to my image on disc
So what is preventing you from figuring out how to do these two simple tasks? Some clever google searches should give you all the information you need in no time.
by the way: are you sure that you need to store these paths in the database? Is this part of some file upload component?

Similar Messages

  • Want To create Zip file  using java,And Unzip without Java Program

    I want to create a zip text file using java, I know Using ZipOutputStream , we can create a zip file, , But i want to open that zip file without java program. suppose i use ZipOutputStream , then zip file is created But for unZip also difftrent program require. We cant open that zip file without writing diff java program.
    Actually i have one text file of big size want to create zip file using java , and unzip simply without java program.Its Possible??
    Here is one answer But I want to open that file normal way(
    For Exp. using winzip we can create a zip file and also open simply)
    http://forum.java.sun.com/thread.jspa?threadID=5182691&tstart=0

    Thanks for your Reply,
    I m creating a zip file using this program, Zip file Created successfully But when im trying to open .zip file i m getting error like "Canot open a zip file, it does not appear to be valid Archive"
    import java.io.*;
    import java.util.zip.*;
    public class ZipFileCreation
         public static void main (String argv[])
         try {
         FileOutputStream fos = new FileOutputStream ( "c:/a.zip" );
         ZipOutputStream zip = new ZipOutputStream ( fos );
         zip.setLevel( 9 );
         zip.setMethod( ZipOutputStream.DEFLATED );
    //     get the element file we are going to add, using slashes in name.
         String elementName = "c:/kalpesh/GetSigRoleInfo092702828.txt";
         File elementFile = new File ( elementName );
    //     create the entry
         ZipEntry entry = new ZipEntry( elementName );
         entry.setTime( elementFile.lastModified() );
    //     read contents of file we are going to put in the zip
         int fileLength = (int)elementFile.length();
         System.out.println("fileLength = " +fileLength);
         FileInputStream fis = new FileInputStream ( elementFile );
         byte[] wholeFile = new byte [fileLength];
         int bytesRead = fis.read( wholeFile , 0 /* offset */ , fileLength );
    //     checking bytesRead not shown.
         fis.close();
    //     no need to setCRC, or setSize as they are computed automatically.
         zip.putNextEntry( entry );
    //     write the contents into the zip element
         zip.write( wholeFile , 0, fileLength );
         zip.closeEntry(); System.out.println("Completed");
    //     close the entire zip
         catch(Exception e) {
    e.printStackTrace();
    }

  • HOW TO creat  BAR CHART using ABAP Programming

    DEAR ALL,
    I want some help as to how to creat GRAPHICAL display using ABAP programing (BAR CHART) any sample codes Example will be very helpful.
    Regards,
    VJ

    On earlier versions, you can do something like this.
    [code]
    REPORT ZRICH_0005 .
    DATA: BEGIN OF ITAB_DATA OCCURS 0,
               DATANAME(15),
               QUANTITY1 TYPE I,
               QUANTITY2 TYPE I,
               QUANTITY3 TYPE I,
          END OF ITAB_DATA.
    Data: BEGIN OF ITAB_OPTIONS OCCURS 0,
               OPTION(20),
          END OF ITAB_OPTIONS.
    ITAB_DATA-DATANAME = 'Maple'.
    ITAB_DATA-QUANTITY1 = 5500.
    ITAB_DATA-QUANTITY2 = 6200.
    ITAB_DATA-QUANTITY3 = 5900.
    APPEND ITAB_DATA.
    ITAB_DATA-DATANAME = 'Oak'.
    ITAB_DATA-QUANTITY1 = 3500.
    ITAB_DATA-QUANTITY2 = 5200.
    ITAB_DATA-QUANTITY3 = 4400.
    APPEND ITAB_DATA.
    ITAB_DATA-DATANAME = 'Cherry'.
    ITAB_DATA-QUANTITY1 = 1800.
    ITAB_DATA-QUANTITY2 = 2200.
    ITAB_DATA-QUANTITY3 = 1900.
    APPEND ITAB_DATA.
    CALL FUNCTION 'GRAPH_MATRIX_3D'
         EXPORTING
              COL1        = 'Jan'
              COL2        = 'Feb'
              COL3        = 'Mar'
              TITL        = 'Lumber Usage in $'
         TABLES
              DATA        = ITAB_DATA
              OPTS        = ITAB_OPTIONS
         EXCEPTIONS
              OTHERS      = 1.
    [/code]
    Regards,
    Rich Heilman

  • How to create the chart using java

    Hi Friends,
    I have one urgent requirement.I need to create the chart by using the table value.The value is stored in database like as follow..
    Attribute     IG
    Home     0.05
    Married     0.72
    Gender     0.05
    Employed     0.05
    Rate      0.05
    I need to get the highest value and create the parent node and lowest value is child node llike that i need create ...
    plz any body help me....

    You don't do that using Java.
    Consult the documentation of the application server in question how to configure it. If you're using for example Tomcat 6.0, then you should be consulting this document: [http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html].

  • Create Bar Chart - Combine Year, Qtr & Week

    Post Author: Rozita
    CA Forum: Charts and Graphs
    Hi,
    Does anyone know how to create bar charts using crystal report IX like below details?
    I have a data from Year 2000 until Year 2007. I want to display certain value for 3 year + Qtr value for current year + Week value for 5 week only.
    Table
    2005        678
    2006        655
    2007        874
    Qtr1         526
    Qtr2         475
    Qtr3         555
    Qtr4         658
    Wk22       145
    Wk23       254
    Wk24       356
    Wk25       458
    Wk26       584

    Post Author: Rozita
    CA Forum: Charts and Graphs
    Thanks for your reply but i want to display all to be in one chart. (Year + Qtr + Week).
    eg :- 
                   2005    2006    2007    Qtr1-2007    Qtr2-2007    Qtr3-2007     Qtr4-2007     Wk24      Wk25     Wk26
    value        845      545      256      241              451            365              458               124         157        254
    Sample record in database like this:
    Year           Week           Value
    2005           1                  578
    2005           2                  457
    2006           2                  652
    2006           3                  657
    2006           4                  547
    2007           1                  457
    2007           2                 654
    Thank you.

  • How can I create a chart using data (from formulas) in my header columns?

    Hello,
    I'm wanting to create a chart using formula totals in my header column. When I attempt to click on the chart icon after selecting my header column, the chart button doesn't appear. Any help would be greatly appreciated. Thanks!

    Move your formulas in a non header column.
    In the cell A2 of the table "aux", the formula is :
    =IF(ISBLANK(main :: A2),"",main :: A2)
    then I applied Fill Down.
    Yvan KOENIG (VALLAURIS, France) mardi 2 août 2011 15:07:54
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How to create a Folder using java.

    Hi All,
    I have a doubt. I want to create a folder using java.
    Inputs are the destination where the folder should be created and the name of the folder. Plz help me in this regard.
    thanks and regards,
    Vincent .R.

    check out javadoc for java.io
    File reldir=new File("NewDir");//relatively where your program runs
    reldir.mkdir();
    File absdir=new File("C:/NewDir");//absolute path
    reldir.mkdir();
    File newdir=new File(absdir,"SubDir");//defines another dir under absdir
    newdir.mkdir();
    Gil

  • How to create a chart with x and y input arrays

    I am trying to create a chart that receives chunks of data from a while loop.  I know how to create a chart in order to append new data points to those points already in the display, but a regular chart doesn't let me specify the x axis data points.  Is there a way to create a chart with x and y array inputs?
    Thanx,
    Tom

    It's called an XY Graph. If you need an XY graph to behave like a chart, look at the shipping example called XY Chart.

  • Create organizational charts using application express

    I would like to create organizational charts using the application express(HTMLDB). How do I go about it?
    I also tried the Aria sample application for HTMLDB 2.0, but when I try to run the scripts it asks for some bind variable parameters ' :NEW ' and ' :OLD ' which I could not identify. Can anybody help with understanding the standard inputs to this?

    A perfectly reasonable question, phrased in
    a perfectly reasonable way (in my opinion).
    On this, I believe, we'll have to agree to disagree. I point you to the following document,
    particularly the section "Questions Not To Ask":
    I'm not sure why you feel the need to point me at a
    document entitled "Questions Not To Ask",
    particularly when I wasn't the one asking the
    question....I pointed you to the section "Questions Not To Ask" in the document entitled "How To Ask Questions The Smart Way" not because I believe you need help asking questions, but because the advice given in that document directly contradicts your opinions:
    "Q: How can I use X to do Y?
    A: If what you want is to do Y, you should ask that question without pre-supposing the use of a method that may not be appropriate. Questions of this form often indicate a person who is not merely ignorant about X, but confused about what problem Y they are solving and too fixated on the details of their particular situation. It is generally best to ignore such people until they define their problem better."
    I admit, I failed to follow the advice of ignoring the person when I first replied, but the issue is whether it was an appropriate question, which I think this quote clearly indicates it is not.
    Robert

  • How to create tagged PDF using java iText

    Hi
    I want to create PDF for accessibility purpose using java and iText
    Please help.
    Thanks in advance

    i did this some yrs ago ..scratched and found some code for you. Have a look
    package com.oq.utility;
    import com.lowagie.text.Cell;
    import com.lowagie.text.Document;
    import com.lowagie.text.Element;
    import com.lowagie.text.Font;
    import com.lowagie.text.HeaderFooter;
    import com.lowagie.text.Image;
    import com.lowagie.text.PageSize;
    import com.lowagie.text.Phrase;
    import com.lowagie.text.Rectangle;
    import com.lowagie.text.Table;
    import com.lowagie.text.pdf.BaseFont;
    import com.lowagie.text.pdf.PdfWriter;
    import com.oq.model.Sale;
    import java.io.FileOutputStream;
    import java.util.ArrayList;
    import java.util.List;
    public class iTextExample
        public static void main (String[] args)
            iTextExample eg = new iTextExample();
            Sale sale = new Sale();
            sale.setOdrNumber("1");
            sale.setOdrDate("12-12-12");
            sale.setOdrCatCode("Örder");
            sale.setTotalInvValue("1234");
            sale.setRefNumber("in the line of fire");
            Sale sale1 = new Sale();
            sale1.setOdrNumber("1");
            sale1.setOdrDate("12-12-12");
            sale1.setOdrCatCode("Örder");
            sale1.setTotalInvValue("1234");
            sale1.setRefNumber("fire line");
            Sale sale2 = new Sale();
            sale2.setOdrNumber("1");
            sale2.setOdrDate("12-12-12");
            sale2.setOdrCatCode("Örder");
            sale2.setTotalInvValue("1234");
            sale2.setRefNumber("in the line of firel");
            List<Sale> list = new ArrayList<Sale>();
            list.add(sale);
            list.add(sale1);
            list.add(sale2);
            eg.printPDF(list);
        public void printPDF(List list) {
            Document document = new Document(PageSize.A4, 50, 50, 50, 50);
            try
                // creation of the different writers
                PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("iTextExample.pdf"));
                // various fonts
                BaseFont bf_helv = BaseFont.createFont(BaseFont.HELVETICA, "Cp1252", false);
                BaseFont bf_times = BaseFont.createFont(BaseFont.TIMES_ROMAN, "Cp1252", false);
                BaseFont bf_courier = BaseFont.createFont(BaseFont.COURIER, "Cp1252", false);
                BaseFont bf_symbol = BaseFont.createFont(BaseFont.TIMES_ROMAN, "Cp1252", false);
                // headers and footers must be added before the document is opened
                HeaderFooter footer = new HeaderFooter(
                            new Phrase("This is page: ", new Font(bf_courier)), true);
                footer.setBorder(Rectangle.NO_BORDER);
                footer.setAlignment(Element.ALIGN_CENTER);
                document.setFooter(footer);
                HeaderFooter header = new HeaderFooter(
                            new Phrase("This is a header without a page number", new Font(bf_symbol)), false);
                header.setAlignment(Element.ALIGN_CENTER);
                document.setHeader(header);
                document.open();
                Image img = Image.getInstance("arrow-ff.gif");
                img.setAlignment(Image.RIGHT | Image.TEXTWRAP);
                Table goodTable = new Table(2);     
                      Cell cell1 = new Cell(img);
                goodTable.addCell(cell1);
                document.add(goodTable);
                Cell c = new Cell("Header");
                c.setHeader(true);
                goodTable.addCell(c);
                Cell c1 = new Cell("Header1");
                c1.setHeader(true);
                goodTable.addCell(c1);
                Cell c2 = new Cell("Header2");
                c2.setHeader(true);
                goodTable.addCell(c2);
                goodTable.endHeaders();
                int j=0;
                          while (j< list.size())
                              Sale sale = (Sale)list.get(j);
                              c = new Cell(sale.getOdrDate());
                              goodTable.addCell(c);
                              goodTable.addCell(sale.getRefNumber());
                             j++;
                document.add(goodTable);
                // add text at an absolute position
                document.close();
            } catch (Exception ex) {
                System.err.println(ex.getMessage());
        }

  • How to create a TOOLBOX using Java  - a real CHALLENGE for U

    Hello,
    I want to create a Toolbox using Java which will contain different components of my interest.I should be able to select one component and paste it in a frame also be able set the property of individual component after placing in the frame,just like VB toolbox.
    Can anybody suggest with code samples??
    Regards,
    Suraj.

    You are essentially asking how to write an IDE (Integrated Development Environment). This is a big question. You might start by looking at existing IDE's (JBuilder, Forte...) and see how they do it. If you want source, there is probably an open source IDE you can lift most of your code from.

  • How to create sql database using java frame or appelet?

    hi ! i am working on database project i want to create a database using java frame or applet where it asks user to select the location for database to be created , after user have specified the path then the programs creates the database, again i want that database to be read and write by another frame or applet but as user select the path how do i make the connectivity. i just have basic knowledge on java. please give me idea how can i process further.
    thanks a lot

    While duffymo is correct in regard to most major database products, it's my understanding (warning! wild-ass guess coming) that the Hypersonic DB is more "application-centric" and the dynamic creation of databases is part of its design. It's pure Java database software, and therefore is not appropriate for all database projects, in particular those that require extremely high-performance.
    See http://hsqldb.org/
    I've not used it yet (but soon though), and I can't really advise anyone about it.
    However, I'm wondering if you phrased you question in a way that is confusing us. To most of us in casual conversation, a "database" is both (1) a large organized collection of data and (2) the software that is used to organize and access it. However, the phrase "create a database" usually means creating a (1) database (a collection of data) using an already created (2) database software, such as Oracle, MySQL, DB2, HSQDB, etc., etc. If you'r question is, how do a create some new database software using Java, the answer is that this is a very very big and hard thing to do for the general case and probably not something you want to be doing.

  • Creating aVirtual directory Using java

    Hai ,
    I am Using windows XP Operating system, I know how to create a directory using java,
    can you please suggest me a procedure to create a virtual(web share ) directory using java.
    waiting for your reply
    Thanks & Regards,
    Naga Raju

    Virtual Programmer is in the to share the directory
    over the Internet.No, that's a file/web server. :) I see, it's a Microsoft term.

  • How to create Gantt Chart by Java? which package n class include it?

    may i know how to craete Gantt Chart or any other chart using Java programming?? which package n class enable me to do so..?? i try 2 find on API but fail lo
    thanks

    http://www.egantt.com/

  • How to create a user using XML and specifying addional attributes that are objects

    I'm trying to create a user using XML and specifying some attributes that are objects and not sure how to do it. How would I set the DirectoryUserAcl to Public?
    Here's the xml file:
    <?xml version = '1.0' standalone = 'yes'?>
    <SimpleUser>
    <UserName>mike2</UserName>
    <Password>abc123</Password>
    <AdminEnabled>false</AdminEnabled>
    <HomeFolderRoot>/home</HomeFolderRoot>
    <HasContentQuota>false</HasContentQuota>
    <DirectoryUserAcl> ??? </DirectoryUserAcl>
    <DefaultAclBundleAcl> ??? </DefaultAclBundleAcl>
    <HomeFolderPolicyBundleAcl> ??? </HomeFolderPolicyBundleAcl>
    </SimpleUser>

    I figured out the answer:
    <?xml version = '1.0' standalone = 'yes'?>
    <SimpleUser>
    <UserName>mike2</UserName>
    <Password>abc123</Password>
    <AdminEnabled>false</AdminEnabled>
    <HomeFolderRoot>/home</HomeFolderRoot>
    <HasContentQuota>false</HasContentQuota>
    <DirectoryUserAcl classname="SystemAccessControlList" refType="name">Public</DirectoryUserAcl>
    </SimpleUser>
    null

Maybe you are looking for

  • In mini bridge, is it possible to view the file name and the rating at the same time?

    Hello, In mini bridge, is it possible to view the file name and the rating at the same time? Thank you.

  • I'm looking for a Funciont Module that check posting date (VBRK-FKDAT)

    Hi, All I'm looking for a Function Module that let me know whether or not a Date (importing paramerter) is allowed for posting in period. (MARV data (including XRUEM (Allow Posting to Previous Period) )) If you know that, please let me know. Best Reg

  • Delivery Header Output Determination Issue

    Hi all,        I have a scenario like below.O/P condition type OPT has to be determined in Delivery header based on the Payer.        I read the IMG-S&D-SYS.MOD-New fields for O/P Determ with Condition technique. Based on that i added the Payer Field

  • Multiple index.hmtl files

    Can you tell me if I'm heading for trouble. I have created 2 sites which are linked through the Navigation menus. I've exported to a folder and now wish to upload them to a non .mac account. In the main folder named "AOS web" i have an index file the

  • PREMIERE ELEMENTS VIDEO CAPTURE ERROR

    I get this error when I am trying to capture video from my dv camera. Premiere Elements has encountered an error. [..\..\Src\TImecode.cpp-1014] It seems to know I have a camera plugged in, but has a yellow yield sign with an exclamation point on the