Graph drawing in JSP

How can i get my jsp to draw a graph automatically with results from a database. The main problem is tryiing to get the JSP to display a graph. The rest I could probably figure out. Can anyone help me please??????????????????????

or use JFreeChart. You can generate the chart image in a servlet and use an image HTML tag to show it. Search the forums, I have posted some example of that somewhere.

Similar Messages

  • Graph drawing using JSP

    is it possible to to draw a graph in a web page automatically with results from a database.(using JSP)

    Did it took 8 months to solve it?
    Anyway, glad you got it fixed.

  • I want to make a Graph Drawing Servlet

    I need to make line graphs, having days on the X axis and certain values on the Y axis. I need to show this on a JSP. I was thinking of making a servlet returning the image, but I'm not finding any Java solution for the graph drawing part. I would really like to avoid having to manually draw the graph. Does anyone know a simple way to do this?

    The Google Chart API is pretty simple and powerful.
    http://code.google.com/apis/chart/

  • Creating graphs in my jsp

    Can anyone give me an idea of how I could dynamically create graphs in my jsp?
    Any help will greatly be appreciated! Thanks!

    Maybe an easy way is to use:
    http://coldjava.hypermart.net/servlets/bar.htm
    If that is too funky then use:
    http://www.acme.com
    http://www.acme.com/java/software/Acme.JPM.Encoders.GifEncoder.html
    to create your own.

  • Graph Drawing Framework

    I'm looking for a framework to use to draw Graphs (nodes and connecting links). Does anyone out there know of anything already implemented like this... Something like ARGO UML???
    TIA

    Hi!
    Take a look at http://www.yworks.de ! They have a powerful graph drawing framework and API called yFiles.

  • Graph drawing in JS

    is it possible to to draw a graph in a web page automatically with results from a database.(using JSP)

    I suggest that you use servlet to draw the graphics.
    In your jsp, you can call the servlet like this.
    <img src="myServlet" width="100" height="100">

  • Creating a Line Graph in a JSP...

    ive got to create a simple line graph (ability to have a title, xaxis, yaxis labels, plus label the data on hte x and y axis). right now the yaxis date is stored in an array of doubles and the xaxis just increment by 1. im having problems finding such a thing on the internet that doesnt depend on other classes or beans besides teh ones built into the jdk. i can have no other 3rd party software, is there anything like this out there? any java functions? thanks.
    Adam.

    Hi
    Keep in touch with the following thread, which is going in parallel, which is same as yours.
    http://forums.java.sun.com/thread.jsp?forum=45&thread=286179
    Thanks
    Swaraj

  • How to produce a graph in the jsp page dynamically

    I want to generate a graph dynamically in my jsp page, depending on the data in my database. Please help how can i do this and the possible ways to do this.

    What you need to do is to represent the graph as an image on some part of the page, using an IMG tag.
    That means you need a second transaction to fetch the image data, and you need to tie the two together.
    The standard approach is to use a servlet to deliver the image, and the src URL generated on your HTML output has some kind of token to identify which graph is to be delivered. So the intial transaction creates a indetifier of some kind, which is likely used to identify image data accessed from session context. Then, when the browser interprets the HTML, it sends a request to the server for the image, which the servlet then generates based on the identifier.
    If you use JFreeChart much of this stuff is available from the library.

  • Filter out marked data from XY graph (Draw graph)

    Hi there,
    I've a question about "filtering" data from an XY Graph, please see the attachement.
    The graph shows some sample data (white plot) and a red "ballon" plot (you can press left mouse button
    and move over the graph to draw the red plot).
    My need is to get all samples inside the red ballon, but presently I got stuck with it!
    Any Ideas?!
    (The attached VI is saved by LabVIEW2009 version)
    Solved!
    Go to Solution.
    Attachments:
    Paint_XY_Graph.vi ‏24 KB

    To determine id a point is inside of the red baloon it must satisfy the condition where the X,Y is less than any X,Y point and greater than any other X,Y point.   To filter them out remove outliers from the array or set their values to nan to not plot them 
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • Line Graph Drawing

    Hi i have developed a class for the information manipulation of a Line graph
    I would Like some help in actually drawing the graph so i can pass values
    manipulated here to the drawing of the graph any help is greatly appreciated thank you
    package ICUv2;
    import java.awt.Point;
    import java.util.Random;
    public class ecgSensor extends Paitent {
        private int x;
        private int y;
        private int xpos;
        private int ypos;
        private int min;
        private int max;
        private Point rate;
         public ecgSensor(int x, int y, int min, int max, int xpos, int ypos ){
        setX(x);
        setY(y);
        setMin(min);
        setMax(max);
        setRate(getXpos() , getYpos());
        public ecgSensor(int x, int y, int min, int max ){
        this(x,y,min,max,0,0);
        setX(x);
        setY(y);
        setMin(min);
        setMax(max);
        public ecgSensor(){
        this(5, 5, 50, 100);
        @Override
        public String toString(){
        return String.format("%s :%s", getX(), getY());
        public static void main (String[] args){
        ecgSensor a = new ecgSensor() ;
        System.out.print(a.toString());
        //System.out.print(a.getX());
        //System.out.print("  ");
        //System.out.print(a.getY());
        public Point getRate(){
        return rate;
        public void setRate(int x, int y){
        this.rate = new Point (x, y);
        public int getX(){
        return x;
        public int getY(){
        return y;
        public void setX(int x){
        this.x = x;
        public void setY(int y){
        this.y = y;
        public  int getMin(){
        return min ;
        public  int getMax(){
        return max;
        public  void setMin(int min){
        this.min = min;
        public  void setMax(int max){
        this.max = max;
        public int getXpos(){
        return xpos;
        public int getYpos(){
        return ypos;
        public void setXpos(int xpos){
        this.xpos = xpos;
        public void setYpos(int ypos){
        this.ypos = ypos;
        public int incYpos(){
        return this.ypos;
        public void setincYpos(int inc){
        setYpos(getYpos()-inc);
        public int decYpos(){
        return this.ypos;
        public void setdecYpos(int dec){
        setYpos(getYpos()+ dec);
        public class ecgReadings implements Runnable {
        Random ecgr = new Random();
        int Change = ecgr.nextInt(20);
        public void run(){
            this.toString();
            while (true) {
                  if (x%2==0){
                    setXpos(getXpos()+ 10);
                    setdecYpos(Change);
                    }else{
                    setXpos(getXpos()+ 10);
                    setincYpos(Change);
           try{
             Thread.sleep(1000);
             }catch(InterruptedException e){}
           }// end of while
        }// end of run method
    }// end of  ReviseBloodrate class
    }

    xiaolixx wrote:
    Hi i have developed a class for the information manipulation of a Line graph
    I would Like some help in actually drawing the graph so i can pass values
    manipulated here to the drawing of the graph ..Right. Did you have a question, or did you think your plaintiff cry for help would get someone to do it all for you?
    ..any help is greatly appreciated thank you
    package ICUv2;
    By convention, package names are alllowercase (It's funny you should rediscover your shift key, just for some package name where it is inappropriate!). Class names should be EachWordUpperCase, while attributes and methods should be firstWordLowerCaseAllTheRestUpper.
    By using the common conventions for code, you help to communicate the problem to others who are used to seeing that nomenclature.
    And as I said before.. "For better help sooner, post an SSCCE".

  • Drawing in JSP

    Hi,
    i would like to know if there is any way to draw pictures on the JSP homepage, for example drawing a map in the homepage line by line?
    thx

    You can either draw it on applet or create and image using jpeg or gif encoder and then load the image.

  • Draw in JSP

    I am new to JSP Technology and in Java genarally.Can anyone tell me if i can
    draw the standard shapes in a JSP application? (like Rectangle, line etc).

    You will not be able to draw directly from JSP, but there are a few ways of going about this:
    1) Javascript:
    http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm#browser
    2) Applets
    3) Using the Java Graphics to draw the shaps, create an image from the graphics, then insert the image into the page

  • Graph Drawing Algorithms II

    Hi guys,
    I'm researching graph layout algorithms. Most of the packages available don't suit because they require the user to specify a number of nodes and edges between them and then it draws them very prettily.
    Because I want an extension of a Circle class to be drawn and I need it to be drawn on a customised JPanel called Canvas most of these programs aren't suitable. I have the program laying them out itself but atm they look crude and horrible.
    What I'd like is a plug in java program that can assign coordinates and a basic structure to the graph that I entered.
    Thank you very much for reading this far,

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import javax.swing.*;
    public class CircleTest extends JPanel
        CircleModel[] circles;
        CircleModel selectedCircle;
        final int
            PAD  = 20,
            SIZE = 10;
        public CircleTest()
            Point[] cps = { new Point(25,25), new Point(80,60), new Point(35,80) };
            circles = new CircleModel[cps.length];
            circles[0] = new CircleModel(cps[0], 15, Color.green.darker(), Color.cyan);
            circles[1] = new CircleModel(cps[1], 20, Color.red,            Color.orange);
            circles[2] = new CircleModel(cps[2], 15, Color.blue,           Color.magenta);
        protected void paintComponent(Graphics g)
             super.paintComponent(g);
             Graphics2D g2 = (Graphics2D)g;
             g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                 RenderingHints.VALUE_ANTIALIAS_ON);
             double w = getWidth();
             double h = getHeight();
             double xInc = SIZE * (w - 2*PAD) / CircleModel.MAX_X;
             double yInc = SIZE * (h - 2*PAD) / CircleModel.MAX_Y;
             g2.setPaint(new Color(220,200,240));
             // vertical model grid lines
             double x = PAD;
             for(int j = 0; j <= SIZE; j++, x += xInc)
                 g2.draw(new Line2D.Double(x, PAD, x, h-PAD));
             // horizontal model grid lines
             double y = PAD;
             for(int j = 0; j <= SIZE; j++, y += yInc)
                 g2.draw(new Line2D.Double(PAD, y, w-PAD, y));
             double vw = w - 2*PAD;
             double vh = h - 2*PAD;
             for(int j = 0; j < circles.length; j++)
                 CircleModel circle = circles[j];
                 Color color = circle.color;
                 if(circle == selectedCircle)
                     color = circle.selectColor;
                 g2.setPaint(color);
                 Point2D p = circle.getLocation(vw, vh);
                 double[] s = circle.getSize(vw, vh);
                 g2.draw(new Ellipse2D.Double(PAD+p.getX(), PAD+p.getY(), s[0], s[1]));
                 g2.setPaint(Color.red);
                 p = circle.getCenter(vw, vh);
                 g2.fill(new Ellipse2D.Double(PAD+p.getX()-2, PAD+p.getY()-2, 4, 4));
        public void setSelection(CircleModel selected)
            selectedCircle = selected;
            repaint();
        public Rectangle2D getViewRect()
            Rectangle2D.Double r = new Rectangle2D.Double();
            r.x = PAD;
            r.y = PAD;
            r.width  = getWidth()  - 2*PAD;
            r.height = getHeight() - 2*PAD;
            return r;
        public static void main(String[] args)
            CircleTest test = new CircleTest();
            SweepTester sweeper = new SweepTester(test);
            test.addMouseMotionListener(sweeper);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(test);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class SweepTester extends MouseMotionAdapter
        CircleTest circleTest;
        CircleModel lastSelection;
        public SweepTester(CircleTest ct)
            circleTest = ct;
        public void mouseMoved(MouseEvent e)
            Point p = e.getPoint();
            boolean haveSelection = false;
            CircleModel[] circles = circleTest.circles;
            Rectangle2D r2 = circleTest.getViewRect();
            for(int j = 0; j < circles.length; j++)
                if(circles[j].contains(p, r2))
                    circleTest.setSelection(circles[j]);
                    lastSelection = circles[j];
                    haveSelection = true;
                    break;
            if(!haveSelection && lastSelection != null)
                lastSelection = null;
                circleTest.setSelection(null);
    class CircleModel
        Point2D center;
        double radius;
        Color color;
        Color selectColor;
        final static int
            MAX_X = 100,
            MAX_Y = 100;
        public CircleModel(Point p, int r, Color c, Color sc)
            center = p;
            radius = r;
            color = c;
            selectColor = sc;
        protected Point2D getLocation(double w, double h)
            Point2D.Double modelLoc = new Point2D.Double();
            modelLoc.x = center.getX() - radius;
            modelLoc.y = center.getY() - radius;
            Point2D viewLoc = modelToView(modelLoc, w, h);
            return viewLoc;
        protected Point2D getCenter(double w, double h)
            return modelToView(center, w, h);
        protected double[] getSize(double w, double h)
            Point2D cp = getCenter(w,h);
            Point2D loc = getLocation(w,h);
            double width  = 2 * (cp.getX() - loc.getX());
            double height = 2 * (cp.getY() - loc.getY());
            return new double[] { width, height };
        private Point2D modelToView(Point2D modelP, double viewWidth, double viewHeight)
            Point2D.Double viewP = new Point2D.Double();
            viewP.x = viewWidth  * modelP.getX() / MAX_X;
            viewP.y = viewHeight * modelP.getY() / MAX_Y;
            return viewP;
        public boolean contains(Point p, Rectangle2D r)
            Point2D loc = getLocation(r.getWidth(), r.getHeight());
            double[] size = getSize(r.getWidth(), r.getHeight());
            Ellipse2D e = new Ellipse2D.Double(r.getX() + loc.getX(),
                                               r.getY() + loc.getY(), size[0], size[1]);
            return e.contains(p);
    }

  • Anyone use a Graph Drawing Kit

    I'm looking for some extension libraries that could help me draw graphs of data. I'm using java version se 1.4.2 and netBeans in conjunction with apaches HSSF extension to write excel files. I know that they have some cool graph and picture functionality included, however, I would like to render graphs in my GUI as well.
    Any ideas?
    thanks

    Yeah I guess charts would be helpful too .. so I
    guess I'll check out jfree.org ... also is JGraph a
    normal swing class?Both JFreeChart and JGraph are open source third party libraries and are not part of the JRE/JDK distribution.

  • Creating graphs on Servlet/Jsp

    I would be grateful if some one can tell me about custom APIs which can be helpful in rendering any type of images/graphs on servlet or jsp. Currently I can use awt package but I would like to know some other options.
    Thanx

    http://www.jrefinery.com/jfreechart/index.html

Maybe you are looking for

  • "Enable Swipe" don't work and Tablet Layout on a Smartphone

    Hi there, I have two big problems with my own site www.mhgrafikdesign.de: 1. I have different slideshows in my tablet version of my site. I created the slideshow before one of the updates with the feature "Enable swipe" came out. However, it worked w

  • Not able to ssh from one EC2 instance to another

    I was trying to work with Oracle AMIs on Amazon cloud (EC2 instances). 1) Created 2 EC2 instances of an Oracle database AMI ( based on Oracle Enterprise Linux (OEL) 5) 2) I have opened ports in my security group associated with these EC2 instances. i

  • Can we have a for loop/ the loop control construct in an etext template?

    Hi All, Can we have a loop control construct in etext templates? I have to print a remittance advice of only 11 invoices per page only. How can I do this? Your help in this regard is really appreciated. Rgds, Kiran Panditi

  • E51 GPRS for email problem

    Hi all, I recently own E51 and tried to configure mailbox with POP3 settings, everything works perfect with wifi. But with help of GPRS from service provider I'm unable to download email, it says Incoming mail server not found.! Same problem persists

  • Oracle 10g group by clause

    I have one SQL query using a GROUP BY clause and no ORDER BY clause is used. When executed in Oracle 8i, the query results are returned ordered by first column mentioned in the GROUP BY clause. When the same query is executed in Oracle 10g, the query