About two updates ago, I was able to hover the mouse over a trending line and it would show the value in a tooltip. When I went to version 13, it stopped working... I just updated to 14 and still no luck. I have found a post relating to this, but maybe the API has changed. I have worked with my code, but still not able to find a solution.
Here is how I am creating the chart:
Code: Select all
protected void createChart()
{
JFreeChart chart = ChartFactory.createTimeSeriesChart(null, null, null, null, false, true, false);
chart.getXYPlot().setDataset(INT_DATASET_INDEX, dataSet);
chart.getXYPlot().setDataset(BOOL_DATASET_INDEX, booleanDataSet);
chart.getXYPlot().setRenderer(INT_DATASET_INDEX, new StandardXYItemRenderer());
chart.getXYPlot().setRenderer(BOOL_DATASET_INDEX, new XYStepRenderer());
chart.getXYPlot().setBackgroundPaint(AdcAppPrefs.GetDvuGraphBackgroundColor());
chart.getXYPlot().getDomainAxis().setTickLabelFont(new Font(Font.DIALOG, Font.BOLD, 10));
chart.getXYPlot().getRangeAxis().setTickLabelFont(new Font(Font.DIALOG, Font.BOLD, 10));
chart.getXYPlot().getDomainAxis().setTickMarksVisible(true);
chart.getXYPlot().getRangeAxis().setTickMarksVisible(true);
chart.getXYPlot().setDomainGridlinePaint(AdcAppPrefs.GetDvuGraphGridColor());
chart.getXYPlot().setRangeGridlinePaint(AdcAppPrefs.GetDvuGraphGridColor());
chart.getXYPlot().setDomainCrosshairVisible(true);
chart.getXYPlot().setRangeCrosshairVisible(true);
chartPane = new ChartPanel(chart);
chartPane.setMouseWheelEnabled(true);
chartPane.setPreferredSize(new Dimension(200, 100));
JPopupMenu menu = chartPane.getPopupMenu();
menu.remove(0); // Remove the Properties item...
menu.remove(0); // Remove the line separator...
menu.remove(8); // Remove the auto scale item...
menu.remove(7); // Remove the line separator...
menu.addSeparator();
menu.add(ShowDataViewPropsAction.getInstance());
XYPlot plot = (XYPlot) chart.getPlot();
plot.setRangePannable(true);
}
Andy