Generating embedded hyperlinks

A discussion forum for JFreeSVG (a fast, lightweight, SVG generator for the Java platform).
Locked
tkannenb
Posts: 2
Joined: Tue Aug 11, 2020 11:21 pm
antibot: No, of course not.

Generating embedded hyperlinks

Post by tkannenb » Wed Aug 12, 2020 3:45 pm

I've got a pie chart (generated by JFreeChart) in which each slice is hyperlinked to a different URL. I'd like to render the chart in SVG format, using <a> tags in the SVG output to implement the hyperlinks for each slice. Is there a way to do that using JFreeSVG? As far as I can tell, JFreeSVG won't ever generate the <a> tags itself; it seems like maybe the best I can do is get it to add identifiers to the groups for the slices so that I can figure out where to inject the <a> tags after the fact, but I can't even seem to get that working. I've tried to do that by calling setElementHinting(true) on the chart before calling draw, and that adds jfreesvg:ref="JFREECHART_TOP_LEVEL" to the outermost group -- but nothing else.

Locked