Results 1 to 4 of 4
- 01-03-2013, 06:18 AM #1
Member
- Join Date
- Dec 2012
- Posts
- 3
- Rep Power
- 0
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); }
%>
- 01-03-2013, 07:04 AM #2
Re: JSP and JFREECHART, Creating and Deleting an IMAGE
Why do they call it rush hour when nothing moves? - Robin Williams
- 01-03-2013, 07:09 AM #3
Member
- Join Date
- Dec 2012
- Posts
- 3
- Rep Power
- 0
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
- 01-03-2013, 11:20 AM #4
Similar Threads
-
JFreeChart - DialPlot - background image
By new2java2009 in forum New To JavaReplies: 3Last Post: 10-01-2011, 09:00 AM -
creating an image from scratch
By satanfx55 in forum AWT / SwingReplies: 2Last Post: 05-15-2011, 11:59 AM -
SWT color creating and image using.
By caryr in forum SWT / JFaceReplies: 2Last Post: 12-21-2009, 05:49 PM -
Creating a caret (using an image) in SWT
By Java Tip in forum SWTReplies: 0Last Post: 07-02-2008, 07:51 PM -
Deleting certain image pixels..
By Brightside in forum New To JavaReplies: 1Last Post: 05-22-2007, 09:21 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks