You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by Kumar akkwe <am...@yahoo.com> on 2005/12/08 11:11:51 UTC

Need Help on Generating Charts

 Hi!
  
  I am new to Jakarta POI.  I am developing an application where i have generate 
  charts (pie diagrams, bar charts etc) based on statistical data through Java.
  
  Here i am using HSSF api.  Can any one help me out with sample example or refer me in order to solve this problem.
  
  Very Urgent..
  
  Thanks In Advance
  
  -Jeevan
  

			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

RE: Need Help on Generating Charts

Posted by Kumar akkwe <am...@yahoo.com>.
Hira!
  
  Thanx once again.
  
  It seems you given me idea.
  
  Can u provide me sample code how to modify the existing chart.
  
  If possible send me complete code any way you already done with this i am new to this POI so i was unable to get the example.
  
  Plz plz send me and help me out
  
  -Thanks in Advance
  Jeevan

"N. Hira" <nh...@cognocys.com> wrote:  The underlying problem is that POI does not handle MS-Excel charts very
well.

The work-around is to create a chart in a document, as I described, then
simply copy the file over and replace the sample data with real data --
POI/HSSF does that just fine.

In MS-Excel, Charts can always be updated to reflect changes to the
underlying data.  Thus, your charts will be dynamic as you require.  For
example, if I create a pie chart with 10 sample rows of data in my
"template", then when I replace those 10 rows with 100 real rows using Java,
the user can _painlessly_ update the chart to see the new data.

Regards,

-h


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/




			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

RE: Need Help on Generating Charts

Posted by "N. Hira" <nh...@cognocys.com>.
The underlying problem is that POI does not handle MS-Excel charts very
well.

The work-around is to create a chart in a document, as I described, then
simply copy the file over and replace the sample data with real data --
POI/HSSF does that just fine.

In MS-Excel, Charts can always be updated to reflect changes to the
underlying data.  Thus, your charts will be dynamic as you require.  For
example, if I create a pie chart with 10 sample rows of data in my
"template", then when I replace those 10 rows with 100 real rows using Java,
the user can _painlessly_ update the chart to see the new data.

Regards,

-h


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/


RE: Need Help on Generating Charts

Posted by Kumar akkwe <am...@yahoo.com>.
Thanks for your response.
  
  you are asking me to copy a chart from one Excel file into other Excel  but i want to generate the chart based on some stastical data it should  be dynamic
  
  can you help me out in this scenariou
  
  -Thanks
  Jeevan

"N. Hira" <nh...@cognocys.com> wrote:  Jeevan,

The typically recommended approach (and this is what we use as well) is:

1.  Use desktop software to create an MS-Excel document with the charts that
you need and have these charts depend on a "name" (HSSFName).

2.  In your Java code, rather than creating a new document from scratch,
start with this "template" document.  For example:
 HSSFWorkbook exportWB = new HSSFWorkbook(new
FileInputStream("disclSummary.xls"));

3.  Continuing in Java, you can update the data on that one worksheet, and
finally, save as a different document.


Take a look at HSSFWorkbook.createName(), HSSFName, and
HSSFWorkbook.getSheet().  The "Busy Developers' Guide..." is very helpful:
http://jakarta.apache.org/poi/hssf/quick-guide.html

Best regards,

-h

-----Original Message-----
From: Kumar akkwe [mailto:ammanimdk@yahoo.com]
Sent: Thursday, December 08, 2005 02:12
To: poi-dev@jakarta.apache.org
Subject: Need Help on Generating Charts


 Hi!

  I am new to Jakarta POI.  I am developing an application where i have
generate
  charts (pie diagrams, bar charts etc) based on statistical data through
Java.

  Here i am using HSSF api.  Can any one help me out with sample example or
refer me in order to solve this problem.

  Very Urgent..

  Thanks In Advance

  -Jeevan



---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/




			
---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 

RE: Need Help on Generating Charts

Posted by "N. Hira" <nh...@cognocys.com>.
Jeevan,

The typically recommended approach (and this is what we use as well) is:

1.  Use desktop software to create an MS-Excel document with the charts that
you need and have these charts depend on a "name" (HSSFName).

2.  In your Java code, rather than creating a new document from scratch,
start with this "template" document.  For example:
	HSSFWorkbook exportWB = new HSSFWorkbook(new
FileInputStream("disclSummary.xls"));

3.  Continuing in Java, you can update the data on that one worksheet, and
finally, save as a different document.


Take a look at HSSFWorkbook.createName(), HSSFName, and
HSSFWorkbook.getSheet().  The "Busy Developers' Guide..." is very helpful:
http://jakarta.apache.org/poi/hssf/quick-guide.html

Best regards,

-h

-----Original Message-----
From: Kumar akkwe [mailto:ammanimdk@yahoo.com]
Sent: Thursday, December 08, 2005 02:12
To: poi-dev@jakarta.apache.org
Subject: Need Help on Generating Charts


 Hi!

  I am new to Jakarta POI.  I am developing an application where i have
generate
  charts (pie diagrams, bar charts etc) based on statistical data through
Java.

  Here i am using HSSF api.  Can any one help me out with sample example or
refer me in order to solve this problem.

  Very Urgent..

  Thanks In Advance

  -Jeevan



---------------------------------
Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List:    http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/