I am using jfreechart-swt with SWT 4.5 and I can't get the tooltips in the chart to work as expected.
This affects both Linux x64 and Windows x64.
What I need is a XYLineChart with two XYSeries. The data changes when the user selects different items from a table. However the tooltip behavior is quite erratically, i.e. sometimes they do not show at all, only on portions of the plot or after reentering the chart with the mouse. I could not really find a regularity yet.
In the SelectionChangedListener of the TableViewer this code is executed:
Code: Select all
XYSeriesCollection dataset = new XYSeriesCollection();
// adding my two XYSeries here...
JfreeChart chart = ChartFactory.createXYLineChart("Graph", "Y-Axis Label", "X-Axis Label", dataset,
PlotOrientation.VERTICAL, true, true, false);
XYPlot plot = (XYPlot) chart.getPlot();
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
DecimalFormat pctFormat = new DecimalFormat("#%");
rangeAxis.setNumberFormatOverride(pctFormat);
rangeAxis.setRange(0.0, 1.0);
plot.getRenderer().setSeriesPaint(0, Color.BLUE);
if (thisDataSet.hasSecondDataSeries) {
plot.getRenderer().setSeriesPaint(1, Color.RED);
}
jFreeChartComp.setChart(chart);
chart.fireChartChanged();
Can anyone give me a hint on how to make this work?
Help is much appreciated!
Thanks and best regards,
Philip