Senario:I have use genPNG method, and successful generate PNG image.
But because I need to auto generate 1300++ chart with a same Java Class (time series chart), by passing different stock code into it.
Senario:The problem is I wonder whether I can set the PNG name before I generate it(use different namem like RSI1295,RSI9725,RSI5051,...)
By the way my class name is RSI.class , then every PNG also name RSI.png will overwrite again and again.
Here is the code:
Code: Select all
private void genPNG(JFreeChart chart){
File fFile = new File (m_CS.getRSIChartPath());
try{
FileOutputStream fout = new FileOutputStream(fFile);
ChartUtilities.writeChartAsPNG (fout, chart, m_iWidth, m_iHeight);
fout.close();
}catch(Exception exc){
System.out.println("Error Code G001:exc=["+exc+"]");
}
}
Thanks for help,
wzwei28.