Adding links, js function to jfreesvg

A discussion forum for JFreeSVG (a fast, lightweight, SVG generator for the Java platform).

Adding links, js function to jfreesvg

Postby Eugene_T » Tue Aug 25, 2015 9:16 am

I'm using jfreechart and jfreesvg for conversion
Are there any examples of how to make followed functionality work:
- tooltips;
- custom js function - ability to add a name to the bar in java code and then get it rendered in the html as javascript function (of course the implementation I'll provide separately);
Thanks, Eugene
Eugene_T
 
Posts: 6
Joined: Thu Aug 06, 2015 10:09 am

Re: Adding links, js function to jfreesvg

Postby Eugene_T » Thu Aug 27, 2015 3:43 pm

If possible can you please provide examples how to add unique id to Graphic2D objects in java using SVGHints.KEY_ELEMENT_ID in order to render them into svg object ids
Eugene_T
 
Posts: 6
Joined: Thu Aug 06, 2015 10:09 am

Re: Adding links, js function to jfreesvg

Postby david.gilbert » Tue Sep 08, 2015 5:40 am

Hi Eugene,

There have been some changes made to JFreeChart to make use of the element hinting feature in JFreeSVG, but these have not been released yet so you would have to look directly in SVN, for example:

http://sourceforge.net/p/jfreechart/code/3293/

Each renderer class needs to be modified to add an element key as it renders each data item. Some renderers have been updated already, others remain to do. I'm not sure when JFreeChart 1.0.20 will be released, I would like it to have been done already but I have many competing priorities.

Once the SVG is written with item keys defined for each data element, you can then overlay some JavaScript tooltip mechanism. I provide one example in the following post about Orson Charts (which is a 3D chart library I wrote that is quite similar to JFreeChart) with JFreeSVG:

http://www.object-refinery.com/blog/blog-20140509.html

You should read that post to get an idea of the mechanism, it will be pretty much the same approach with JFreeChart. I hope that helps a little.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11626
Joined: Fri Mar 14, 2003 10:29 am

Re: Adding links, js function to jfreesvg

Postby Eugene_T » Tue Sep 08, 2015 1:00 pm

Hi, David
Thanks for reply. I'll keep on researching in this direction ...
Eugene_T
 
Posts: 6
Joined: Thu Aug 06, 2015 10:09 am


Return to JFreeSVG

Who is online

Users browsing this forum: No registered users and 1 guest