Need some help with the Easy Chart configureChart method. I am trying to change the mouse hover over tooltip on pens to display the tag documentation property from the tag itself.
The problem I’m having is figuring out how to expose and update the jfree chart for the mouse over tooltips on pens.
Has anyone accomplished this? I’ve searched through the forums and couldn’t find any straight forward solution.
Here is an example of creating a customMouseListener, which is what you will need. I think this example was for a Standard Chart component, but it will work for an easy chart as well. It's not exactly what you're looking for but its a pretty good start.
@eckman.tech - I experimented with this, and I was able to manipulate the format of an easy chart's tool tips using a button's actionPerformed event handler. It should be easy to modify the method for any usage case. Here is the code:
The key is the is the first field in the StandardXYToolTipGenerator. Using reflection, I was able to determine that the DEFAULT_TOOLTIP_FORMAT = "{0}: ({1}, {2})" where {0} is the field, {1} is the y axis, and {2} is the x axis.
The format string behaves like a MessageFormat, but for the xFormat, you will have to modify the format using the methods in java.txt.NumberFormat prior to applying the tool tip generator. Likewise the yFormat will have to be modified using the methods in java.text.DateFormat.