Example usage for org.jfree.chart.plot CombinedDomainXYPlot setDomainCrosshairLockedOnData

List of usage examples for org.jfree.chart.plot CombinedDomainXYPlot setDomainCrosshairLockedOnData

Introduction

In this page you can find the example usage for org.jfree.chart.plot CombinedDomainXYPlot setDomainCrosshairLockedOnData.

Prototype

public void setDomainCrosshairLockedOnData(boolean flag) 

Source Link

Document

Sets the flag indicating whether or not the domain crosshair should "lock-on" to actual data values.

Usage

From source file:com.att.aro.diagnostics.GraphPanel.java

/**
 * Sets the Cross hair value.//from   w  w w. ja v a  2  s . c o  m
 */
private void setCrossHair(double crossHairValue) {
    // set the cross hair values of plot and sub-plots
    Plot mainplot = advancedGraph.getPlot();
    if (mainplot instanceof CombinedDomainXYPlot) {
        CombinedDomainXYPlot combinedPlot = (CombinedDomainXYPlot) mainplot;
        List<?> plots = combinedPlot.getSubplots();
        for (Object p : plots) {
            if (p instanceof XYPlot) {
                XYPlot subPlot = (XYPlot) p;
                subPlot.setDomainCrosshairLockedOnData(false);
                subPlot.setDomainCrosshairValue(crossHairValue);
                subPlot.setDomainCrosshairVisible(true);
            }
        }
        combinedPlot.setDomainCrosshairLockedOnData(false);
        combinedPlot.setDomainCrosshairValue(crossHairValue, true);
        combinedPlot.setDomainCrosshairVisible(true);
    }

    handlePanel.setHandlePosition(getHandleCoordinate());
}