• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Solved it... Re: Java question..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Solved it... Re: Java question..


  • Subject: Solved it... Re: Java question..
  • From: James Cicenia <email@hidden>
  • Date: Wed, 9 Jun 2004 18:54:46 -0500

OK -

Reading through the voluminous api of jfreechart I found a different method... getImageMap
which thankfully returns a String.


-James


On Jun 9, 2004, at 6:04 PM, James Cicenia wrote:

unfortunately,  ChartUtilities.writeImageMap needs a PrintWriter

-James


On Jun 9, 2004, at 5:50 PM, Jonathan 'Wolf' Rentzsch wrote:

James Cicenia, email@hidden, wrote:
I am using jfreeChart for my charts... great api... however, I am
trying to do
a clickable graphic.

Here is the sample code:

final File file1 = new File("piechart100.png");
ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info);


// write an HTML page incorporating the image with an image
map
final File file2 = new File("piechart100.html");
final OutputStream out = new BufferedOutputStream(new
FileOutputStream(file2));
final PrintWriter writer = new PrintWriter(out);
writer.println("<HTML>");
writer.println("<HEAD><TITLE>JFreeChart Image Map Demo
2</TITLE></HEAD>");
writer.println("<BODY>");
ChartUtilities.writeImageMap(writer, "chart", info);
writer.println("<IMG SRC=\"piechart100.png\" "
+ "WIDTH=\"600\" HEIGHT=\"400\" BORDER=\"0\"
USEMAP=\"#chart\">");
writer.println("</BODY>");
writer.println("</HTML>");



My question is how do I do the writeImageMap so that it will instead of
being written to
a file it will write to ??? NSData???

How about substituting the BufferedOutputStream with an
ByteArrayOutputStream? Then, after calling
ChartUtilities.writeImageMap(), call ByteArrayOutputStream.toByteArray().
Getting to an NSData is as easy as `new NSData(
ByteArrayOutputStream.toByteArray() )`.


| Jonathan 'Wolf' Rentzsch   http://rentzsch.com
| Red Shed Software           http://redshed.net
|     "better" necessarily means "different"
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Re: Java question.. (From: "Jonathan 'Wolf' Rentzsch" <email@hidden>)
 >Re: Java question.. (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: Java question..
  • Next by Date: Re: WOHyperlink Passing a value back...
  • Previous by thread: Re: Java question..
  • Next by thread: Re: Java question..
  • Index(es):
    • Date
    • Thread