Results 1 to 4 of 4
  1. #1
    demosai is offline Member
    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    Default JSP and JFREECHART, Creating and Deleting an IMAGE

    Hi Guys, This is my question: Why when I load this JAVASCRIPT after my JFREECHART script, it load the whole picture but doesn't loads the whole page, why?

    How can I solve this? By the way, I mark the specific script I am having problem with, I just want to create a graph image file, load it on the page and have it deleted.

    <%

    final DefaultCategoryDataset data = new DefaultCategoryDataset();
    for (int a = 0; a < progtosummaryexec.getRowCount(); a++){

    data.addValue(progtosummaryexec.getInt("java", a), "JAVA", Integer.toString(progtosummaryexec.getInt("out", a)));
    data.addValue(progtosummaryexec.getInt("c++", a), "C++", Integer.toString(progtosummaryexec.getInt("out", a)));
    data.addValue(progtosummaryexec.getInt("perl", a), "PERL", Integer.toString(progtosummaryexec.getInt("out", a)));

    }

    final JFreeChart StackedBarChart = ChartFactory.createStackedBarChart(
    "", "Out", "DATA", data, PlotOrientation.VERTICAL, true, true, false);


    final CategoryPlot plot = StackedBarChart.getCategoryPlot();
    //plot.setForegroundAlpha(0.5f);//

    BarRenderer barRenderer = (BarRenderer)plot.getRenderer();
    barRenderer.setSeriesPaint(0, new Color(0, 200, 0));
    barRenderer.setSeriesPaint(1, new Color(102, 102, 102));
    barRenderer.setSeriesPaint(2, new Color(200, 100, 0));



    StackedBarChart.setBackgroundPaint(new Color(255, 255, 255));





    try {
    final ChartRenderingInfo info = new ChartRenderingInfo
    (new StandardEntityCollection());


    final File file1 = new File("C:/Users/a0222144/Documents/NetBeansProjects/Delayed_Reprobe_Report/web/StackedBarChart.png");








    __________________________________________________ ________________________________
    ChartUtilities.saveChartAsPNG(file1, StackedBarChart, 750, 400, info);

    FileInputStream fis = new FileInputStream(file1);
    OutputStream os = response.getOutputStream();
    long fileLength = file1.length();
    byte[] byteStream = new byte[(int)fileLength];
    fis.read(byteStream, 0, (int)fileLength);
    response.setContentType("image/png");
    response.setContentLength((int)fileLength);

    fis.close();
    os.write(byteStream);
    os.flush();
    os.close();
    __________________________________________________ ________________________________
    %>

    <IMG SRC="StackedBarChart.png" alt="Right-click this message and Select Refresh/Reload..." WIDTH="750" HEIGHT="400">


    <%

    file1.delete();
    }

    catch (Exception e) {out.println(e); }

    %>

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: JSP and JFREECHART, Creating and Deleting an IMAGE

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    demosai is offline Member
    Join Date
    Dec 2012
    Posts
    3
    Rep Power
    0

    Default Re: JSP and JFREECHART, Creating and Deleting an IMAGE

    O_O What was that Sir? I am confused what are those links for? O_o

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default Re: JSP and JFREECHART, Creating and Deleting an IMAGE

    Quote Originally Posted by demosai View Post
    O_O What was that Sir? I am confused what are those links for? O_o
    What's your best guess?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. JFreeChart - DialPlot - background image
    By new2java2009 in forum New To Java
    Replies: 3
    Last Post: 10-01-2011, 09:00 AM
  2. creating an image from scratch
    By satanfx55 in forum AWT / Swing
    Replies: 2
    Last Post: 05-15-2011, 11:59 AM
  3. SWT color creating and image using.
    By caryr in forum SWT / JFace
    Replies: 2
    Last Post: 12-21-2009, 05:49 PM
  4. Creating a caret (using an image) in SWT
    By Java Tip in forum SWT Tips
    Replies: 0
    Last Post: 07-02-2008, 07:51 PM
  5. Deleting certain image pixels..
    By Brightside in forum New To Java
    Replies: 1
    Last Post: 05-22-2007, 09:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •