Adding links, js function to jfreesvg

A discussion forum for JFreeSVG (a fast, lightweight, SVG generator for the Java platform).
Locked
Eugene_T
Posts: 6
Joined: Thu Aug 06, 2015 10:09 am
antibot: No, of course not.

Adding links, js function to jfreesvg

Post by 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
antibot: No, of course not.

Re: Adding links, js function to jfreesvg

Post by 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

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Adding links, js function to jfreesvg

Post by 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: Support JFree via the Github sponsorship program

Eugene_T
Posts: 6
Joined: Thu Aug 06, 2015 10:09 am
antibot: No, of course not.

Re: Adding links, js function to jfreesvg

Post by Eugene_T » Tue Sep 08, 2015 1:00 pm

Hi, David
Thanks for reply. I'll keep on researching in this direction ...

Locked