Hello @all (but mainly @developers of JFreeChart),
We have investigated the issue denoted above, to determine it is a bug, but
only for CombinedPlots with more than one subplot in it.
The problem lies within the plot area stored globally for the chart in a
Rectangle2D structure. It covers the entire CombinedPlot, not the single
subplots.
Therefore, with more than one subplot, at least one of the axes reveal wrong
scale values upon converting mouse click coordinates to plot scale
coordinates.
Since the plot area attribute is part of the ChartPanel class level
(retrieved by .getChartRenderingInfo().getPlotInfo().getDataArea()), we
suggest transferring the plot area attribute to the Plot class level, and
recursively calculating total plot area in CombinedPlots as "sum" of the
subplots within. Thus, the topmost plot in the ChartPanel spans the plot
area of the ChartPanel.
So, all in all, it's not only a bug, but it seems to be a new feature as
well. At least, it is now clear where the problem reported stems from. How
should we go about it? Leave it as a documentation issue, so future
generations of JFreeChart users know the limits of mouse click coordinates
translated to plot scale coordinates, or implement it to resolve the issue
and complete the feature of generically translating mouse click coordinates
to plot scale coordinates, no matter what plot type it is?
If the latter, we need advice as to which classes to modify.
Thanks,
Samuel Eickelberg and Martin Schulze
|