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

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

Introduction

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

Prototype

public void setDomainCrosshairValue(double value, boolean notify) 

Source Link

Document

Sets the domain crosshair value and, if requested, sends a PlotChangeEvent to all registered listeners (provided that the domain crosshair is visible).

Usage

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

/**
 * Sets the Cross hair value.//from w ww  .  jav  a  2  s  .  c om
 */
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());
}