Can I set the name of PNG? I use writeChartAsPNG

Discussion about JFreeChart related to stockmarket charts.
Locked
wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Can I set the name of PNG? I use writeChartAsPNG

Post by wzwei28 » Wed May 18, 2005 12:10 pm

Hi, experts:

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+"]");
  }		
}
Question:Can I set the name of PNG before I generate PNG image?
Thanks for help, :D
wzwei28.

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Wed May 18, 2005 12:10 pm

:? :?

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Wed May 18, 2005 12:10 pm

:oops: :oops:

Guest

Post by Guest » Thu May 19, 2005 6:55 am

:cry: :cry:

wzwei28
Posts: 105
Joined: Wed Mar 16, 2005 9:17 am
Location: Malaysia, Earth
Contact:

Post by wzwei28 » Tue May 24, 2005 3:59 am

Thanks for help by Angel. I am so stupid, I forget the name is set by myself in the config.txt

Thanks for ur reply, if not, I still wonder why. Actually this is the line I read in once I generate chart to capture the path in config.txt.

NNSP_RSIChartPath=D:\\Program Files\\Apache Group\\Tomcat 4.1\\webapps\\PFAChart\\image\\NNSP_RSIChart.png

That's why because I put the PNG name same with the Java Class name. I thought is already predefined. Thanks for ur generous help, Angel.

regards,
wzwei28.

Locked