Version 1.8 (11 April 2014)- added additional KEY_BEGIN_GROUP options, plus special integration support for Orson Charts;- added special handling for shape drawing when the Stroke is not an instance of BasicStroke;- explicitly set encoding to UTF-8 for SVGUtils.writeToSVG() and SVGUtils.writeToHTML().

JFreeSVG is dual licensed under the GNU AGPL and a commercial licence.

Yes, sure. The SVGHints.KEY_BEGIN_GROUP rendering hint (since version 1.7) is a general purpose hint to start a new group in the SVG output, and these groups can be given an ID (when the hint value is a String). In JFreeSVG 1.8, the hint value can optionally be a Map with an "id" entry and a "ref" entry, in which case the SVG group element will take the specified ID plus a custom "ref" attribute ("jfreesvg:ref"). You can use this grouping feature for anything you want. Orson Charts uses the "ref" attribute to store a reference back to the data item that the elements in the SVG group is representing, so then it is possible to capture mouse events in JavaScript and know which data items the mouse events relate to.

The best example I have of this (at the moment) is in the Orson Charts download, if you look in the 'svg' folder there is a pre-generated SVGDemo1.html file containing a chart that has been created using these rendering hints in JFreeSVG. There are also some supporting JavaScript files to generate tooltips and to show popup messages when you click on chart elements (just for demo purposes). The Java code that generates this chart is also included in the demo source folder. Here is the resulting HTML page:

What is the "special" Orson Charts integration? Orson Charts uses its own hint (Chart3DHints.KEY_BEGIN_ELEMENT, not SVGHints.KEY_BEGIN_GROUP) to avoid having a compile-time dependency on JFreeSVG. At start-up, JFreeSVG will check if Orson Charts is on the class path and add Chart3DHints.KEY_BEGIN_ELEMENT as a synonym for SVGHints.KEY_BEGIN_GROUP so it acts in exactly the same way. To have Orson Charts set these rendering hints during chart drawing, all you need to do is:

Most Graphics2D implementations will ignore the additional rendering hints, but the SVGGraphics2D implementation will pick them up and create the required SVG group elements and references. In the end, this special integration is designed to make the feature simple to use in Orson Charts without adding dependencies for people that don't need or want it.