How to create Chart within a web page NOT as seperate page?

Hi, I am using JCharts and am trying to figure out how (or if it is even possible) to create a chart and then place it in a web page. All the examples I've seen show you how to create a JPEG of the chart and then link to this image from your web page. Is it not possible to surround the JPEG chart with other HTML so that I can keep my web page logo and menu etc on the same page as the chart?
I can't find any examples which show how to surround your images with HTML as JCharts creates a JPG file and returns that in the Http Response e.g. "ServletEncoderHelper.encodeJPEG13(axisChart, 1.0f, response);".
My environment is Java 1.4.2, Struts and Tomcat 4.1.30.
Is there a way of drawing charts directly into a web page rather than displaying them on a seperate page as an image file?
many thanks in advance,
James.

Hi Hatton,
in html, there exists an img-tag. this tag contains a parameter called src. And if you want to embedd an image in your html-page, you will put the source of the image you want to display to the src-parameter. The same with servlets or java server pages. For the browser it doesn't matter where the html comes from. it doesn't matter if it has to be generated by an servlet-container like tomcat. So you write a servlet, which will create an image and make it accessible to your servlet container and then insert an tag like
<html>
<body>
<img src="http://yourdomain/servlet?param=value" width=aNumber height=aNumber>
</body>
</html>This can be done because servlets can be configured to response with images which can be created by java2d or something else...
I hope, this will help you...

Similar Messages

  • How to create progress bar in web page!!!

    Dear,
    I do not know how to create progress bar in web page?
    Please show me the way to solve it.
    Best regards,
    Huy

    God your lucky/lazy
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    import javax.swing.*;
    import java.util.*;
    import java.io.*;
    public class ProgressBar extends Applet
      private boolean isStandalone = false;
      private int width;
      private int height;
      private double percentComplete;
      private double fundsTarget;
      private double fundsRaised;
      private Properties values;
      private String propertiesFile;
      private JPanel jPanel1 = new JPanel();
      private JProgressBar PB_FUNDS_PROGRESS = new JProgressBar();
      private GridLayout gridLayout1 = new GridLayout();
      private BorderLayout borderLayout1 = new BorderLayout();
      private JPanel jPanel2 = new JPanel();
      private JLabel jLabel1 = new JLabel();
      private JLabel jLabel2 = new JLabel();
      private JLabel jLabel3 = new JLabel();
      private GridBagLayout gridBagLayout1 = new GridBagLayout();
      private JPanel jPanel3 = new JPanel();
      private JLabel jLabel4 = new JLabel();
      //Construct the applet
      public ProgressBar()
      //Initialize the applet
      public void init()
        try
          jbInit();
        catch(Exception e)
          e.printStackTrace();
      //Component initialization
      private void jbInit()
      throws Exception
        fundsTarget = new Double( 100 ).doubleValue();
        fundsRaised = new Double( 50 ).doubleValue();
        PB_FUNDS_PROGRESS.setBackground(Color.green);
        PB_FUNDS_PROGRESS.setForeground(Color.red);
        this.setLayout(gridLayout1);
        jPanel1.setLayout(borderLayout1);
        jPanel2.setLayout(gridBagLayout1);
        jPanel1.setBackground(Color.white);
        jPanel2.setBackground(Color.white);
        jPanel3.setBackground(Color.white);
        jLabel2.setBackground(Color.white);
        jLabel1.setBackground(Color.white);
        jLabel3.setBackground(Color.white);
        jLabel4.setText(" ");
        jLabel1.setText(" ");
        jLabel2.setText(" ");
        jLabel3.setText(" ");
        this.setBackground(Color.white);
        this.add(jPanel1, null);
        jPanel1.add(PB_FUNDS_PROGRESS,  BorderLayout.CENTER);
        jPanel1.add(jPanel2, BorderLayout.SOUTH);
        jPanel2.add(jLabel2, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 0), 0, 0));
        jPanel2.add(jLabel1, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 150, 5, 5), 0, 0));
        jPanel2.add(jLabel3, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
         GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(6, 5, 4, 150), 0, 0));
        jPanel1.add(jPanel3, BorderLayout.NORTH);
        jPanel3.add(jLabel4, null);
        propertiesFile = this.getCodeBase().getFile().replaceAll("%20", " ")+"funds.properties";
        System.out.println("Properties file at " + propertiesFile);
        values = new Properties();
        try
          values.load(new FileInputStream(propertiesFile));
          fundsTarget = new Double( values.getProperty("TARGET", "100").toString() ).doubleValue();
          fundsRaised = new Double( values.getProperty("RAISED", "50").toString() ).doubleValue();
          System.out.println("target: " + fundsTarget + " raised: " + fundsRaised);
        catch (IOException ioe)
          System.err.println(ioe.getMessage());
        percentComplete = (fundsRaised/fundsTarget)*100;
        System.out.println(percentComplete);
      //Start the applet
      public void start()
        PB_FUNDS_PROGRESS.setMaximum(new Double(fundsTarget).intValue());
        PB_FUNDS_PROGRESS.setMinimum(0);
        repaint();
      //Stop the applet
      public void stop()
      public void paint(Graphics g)
        Graphics2D g2 = (Graphics2D)g;
        PB_FUNDS_PROGRESS.setValue(new Double(fundsRaised).intValue());
        String percent = Double.toString(percentComplete).substring(0, 4);
        jLabel4.setText("Currently At " + percent + "%");
        jLabel1.setText("100%");
        jLabel2.setText("50%");
        jLabel3.setText("0%");
      //Destroy the applet
      public void destroy()
      public String getAppletInfo()
        return "Funds progress applet by A really nice person";
    }

  • How do I create both endnotes and footnotes in same doc in Pages? I have iWork 2008. I understand how to create one or the other, but not both.

    How do I create both endnotes and footnotes in same doc in Pages? I have iWork 2008. I understand how to create one or the other, but not both.

    You have to select one or the other.
    Try making two documents and see if you can merge the .pdfs, but their will be problems with page flow, making the pages shift. Can't see it working really.
    Pages is not the only solution out there or the best for most jobs (let alone the safest). Try Word for Mac, LibreOffice (free) or any App that has the features you need.
    Peter

  • How to create exchange grid in web entry form...

    Hi to all,
    I am new to HFM..my query is How to create exchange grid in web entry form...i try it a lot but it didn't get the solution...
    i did this exchange grid in web grid..any one can share the document or ppt or video clip related to this..which will be helpful for me...
    Thanks

    Hi...
    Its better to create the Exchange Rates in a Data Form than in an Data Grid, so that you can easily Import and Export the form and even can feed the values easily....
    Select the POV like in Scenario-Actual,Year-Your particular year,Period-In Period Dimension do not choose any option so that it can be selected in Columns and Rows,View--the same as Period Dimension,Entity-[None],Value-<Entity Currency>,Account-Do Not select ,ICP- [ICP None],Custom 1-[None], Custom 2-[None], Custom 3-[None], Custom 4-[None]...
    In Columns Select Scenario -Actual,Period-{[Fourth Generation]},Currency-#USD(Default Currency)
    In Rows Select-Account-A#AVGRATE,View-w#Periodic,Currency-C2#EUR
    A#AVGRATE.w#Periodic.C2#CFA and so on for rest of the currencies....
    and same in the below rows for the Closing Rates---- A#CLORATE.w#Periodic.C2#EUR
    A#CLORATE.w#Periodic.C2#CFA
    This might help you.....

  • How to create Sub Queries In Webi

    Hi,
    we are creating webi reports by using BICS connection..
    Now my requirement is how to create sub queries in webi.
    Any one give me suggestions how to achieve this
    Regards,
    G

    Hi Bhargav,
    Below is thread related to same topic-
    http://scn.sap.com/thread/3430274
    ~Anuj

  • How to create a file under web application root from java program

    how to create a file under web application root from java program like an action class?

    like an action class?Huh? What exactly is your requirement?
    Creating a file is usually done with java.io API. Read the java.io tutorials how to play with files.

  • Do you know how to create Front Panel like Web,

    Do you know how to create Front Panel like Web, I mean like we pointed the word and click it will do another process instead by clicking push button.
    If possible, i can click the link in the table... Any idea anyone
    Solved!
    Go to Solution.

    Hi ezam,
    can you define more clearly exactly what you would actually like to do, and ill have a further look into it. I think smercurio_fc has understood it as I have, and is right with the activeX.
    any way, give a shout back with exactly what you want to do and we see what we can do,
    Richard
    Richard S
    Applications Engineer
    Certified LabVIEW Associate Developer
    National Instruments UK&Ireland

  • How to create Chart

    Hi pals,
    Im trying to implement a jsp application which is capable of creating charts dynamically,
    The thing i need to know is how to create chart application in jsp.?

    Have a look to JFreeChart and subprojects such as cewolf

  • How to create Query as a web service in  Business Objcets

    Hi Friends,
    Can any one please guide me ' How to create Query as a web service in Business Objects'.
    Thanks in advance.
    Thanks & Regards,
    Ramnaresh.P.

    Hi,
    which version of BOBJ are you using?
    Regards
    Stratos

  • In iPhoto 11, I know how to create new libraries.  I do not know how to split my existing large library into the new ones.

    In iPhoto 11, I know how to create new libraries.  I do not know how to split my large existing library into the new libraries?

    You need to use the iPhoto Library Manager.
    (66928)

  • The back, forward, reload and stop buttons are greyed out, the address bar stays blank when I go to a website and firefox loads to a blank page, not my home page. There are 3 users on this computer and it only happens on one user.

    Firefox loads to a blank page, not my home page. When I click on the home button it takes me to the home page. The back, forward, refresh and stop buttons are greyed out and not usable. The webpage I am on does not show up in the address bar. If I type something into the address bar, that address stays there no matter what page I go to next.

    Just upgraded to v4. It did NOT fix the problem.

  • With version 5, on starting get a box "checking compatibility of add-ons" then to Firefox home page not my home page--What's happening?

    Just installed version 5. As above I get the box then it goes to Firefox home page not my home page. I've updated and/or disabled every add-on or extension and it made no difference. I am in a university behind a tough firewall. I'd love to go back to version 4 but that isn't available.

    Disabled add-ons will still be checked and can still be updated.
    I don't know why you are continuously getting the message, you should only get it when there is a version change.
    You can try solutions in https://support.mozilla.com/questions/817681 but you had better make a list of what extensions you had disabled first, because all of your extensions will be enabled when you delete/rename those files in your profile. You can use about:support to get a list of your extensions. (renaming is safer than deleting).

  • How to include Chart in Web Page not as seperate image file?

    Hi, I am using JCharts and am trying to figure out how (or if it is even possible) to create a chart and then place it in a web page. All the examples I've seen show you how to create a JPEG of the chart and then link to this image from your web page. Is it not possible to surround the JPEG chart with other HTML so that I can keep my web page logo and menu etc on the same page as the chart?
    I can't find any examples which show how to surround your images with HTML as JCharts creates a JPG file and returns that in the Http Response e.g. "ServletEncoderHelper.encodeJPEG13(axisChart, 1.0f, response);".
    My environment is Java 1.4.2, Struts and Tomcat 4.1.30.
    Is there a way of drawing charts directly into a web page rather than displaying them on a seperate page as an image file?
    many thanks in advance,
    James.

    If you understand html, you know that to display an image, you must provide a reference to the image's location within the html code (there's no way to embed the image itself, directly in the html).
    An image's reference is just an url of where the image can be loaded from. Provide an url which goes to your dynamic chart servlet and requests the appropriate chart (i.e., you may have to pass in certain parameters in the url).

  • How to create a link to web page (URL) to a billing document

    Hi,
    I have an urgent requirement of creating a link to web page (URL) to a billing document.
    I call the function module "GOS_EXECUTE_SERVICE" with :
    ip_service = 'URL_CREA'
    is_object-objkey = no billing document
    is_object-objtype = 'VBRK'
    is_object-logsys = 'BO'
    ip_rwmode = 'E'
    Then, I enter the title and the address.
    And, I have the message : "The attachment was successfully created".
    But when there's nothing in the attachment list of the billing document.
    (Tha table SOOD contains the record )
    If any one has some idea about his , how to achieve this functionality, can you please help me.
    Thanks
    Virginie
    geoge bush
    Posts: 6
    Questions: 0
    Points: 6
    Registered: 7/9/04
    Re: Attaching a file to a purchase Order from EP6 to R/3 4.6C
    Posted: Jul 13, 2004 2:46 AM      Reply      E-mail this post 
    Hi Somaraju,
    I am also looking for A CODE EXAMPLE TO ATTACH A DOCUMENT TO A AN sap OBJECT E.G. BUS222 AND ISUACCOUNT.
    IF YOU'VE AN Example code that you can email me . it would be great.
    thanks for the help.
    geoge.

    Hey,
    If you are using Portal (not Framework), the below tag will do the trick
    <wcdc:userProfile id="profileUserLink" immediate="false" text="#{security.userDisplayName}" shortDesc="#{security.userDisplayName}"  xmlns:wcdc="http://xmlns.oracle.com/webcenter/spaces/taglib"/>
    -K

  • How To Create An Excel like Web Page?

    Hi All,
    Apex 4.1
    I have created n interactive report which was converted from a spreadsheet. This is a very long report of 100 columns display. So the user got tired in scrolling it left to right and vice versa.
    How can I make it behave like excell spreadsheet in which the selected first 3 primary-key columns will be displayed fixed on the left most region and the succeeding columns will be displayed by batch of 10 columns.
    which will just fit on 1 page and no need to scroll too long to the right most part. Maybe there is a button "next>" or "<previous" to scroll from left to right and vice versa?
    Can you give me links to sample demo apps that demonstrate this kind of usage?
    Thanks a lot,

    KinsaKaUy? wrote:
    Yes, thats exactly what I wanted....but why not free :(If you want it free, then create a Classic Report instead and use this solution by Jari
    http://dbswh.webhop.net/dbswh/f?p=BLOG:READ:0::::ARTICLE:59900346164562
    http://dbswh.webhop.net/dbswh/f?p=BLOG:READ:0::::ARTICLE:303800346302715
    I got an Idea... Say I will divide the 100-column report into 10-column report and each has the 3 primary key columns on the right attached. so I will have 10 individual pages but sharing same Tab?
    How do I create a button "Next>" and "<Previous" so that the page will be displayed sequentially?You need to maintain the current page in session state and on "Next>" and "<Previous" action increment and decrement the value

Maybe you are looking for

  • Connection to Oracle 8i personal default DB

    Hi I am trying to connect to the default database on my laptop whcih is running Oracle 8i personal. I use connection = DriverManager.getConnection( "jdbc:oracle:oci8:@", user, password); for my connection, but get the following error: Failed to estab

  • AP 1100 ntp set up

    How can I set up NTP in an Access Point Cisco 1100?

  • Installing Air applications to users root directory

    I am compiling an AIR file for Flash CS 5 and the filed for install directory gives me a place where I can put a value for install location but this install location is inside the program files. I want my app to install directly to the C: drive on us

  • Livepatch still not working with MW 2.16?

    Have installed the 2.16 patch on top of 2.15. Still getting issues throught the MW with livepatch. From the logs: Beginning phase 1 of LivePatch at Fri Apr 23 14:59:20 BST 2010... Using existing LivePatch directory for log files: /home/oicprj08/whizz

  • Installation of new hardware results in slow performance.

    Macbook Pro Late 2008 4 GB Ram 2.53 ghz Upgraded to: 8 GB Corsair Ram 256 GB Crucial M4 SSD (I just installed Lion onto the new drive and started fresh) After installing these two components in my Macbook Pro I noticed some serious performance degrad