org.jfree.chart.panel.CrosshairOverlay Java Examples

The following examples show how to use org.jfree.chart.panel.CrosshairOverlay. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LineChart.java    From PDV with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Create chart
 * @return Chart JPanel
 */
private void createChart() {

    CrosshairOverlay crosshairOverlay = new CrosshairOverlay();
    this.xCrosshair = new Crosshair(Double.NaN, Color.GRAY, new BasicStroke(0f));
    this.xCrosshair.setLabelVisible(true);
    this.yCrosshair = new Crosshair(Double.NaN, Color.GRAY, new BasicStroke(0f));
    this.yCrosshair.setLabelVisible(true);
    crosshairOverlay.addDomainCrosshair(xCrosshair);
    crosshairOverlay.addRangeCrosshair(yCrosshair);

    this.addOverlay(crosshairOverlay);

    this.setMouseWheelEnabled(true);
}