Example usage for org.jfree.chart.plot XYPlot removeDomainMarker

List of usage examples for org.jfree.chart.plot XYPlot removeDomainMarker

Introduction

In this page you can find the example usage for org.jfree.chart.plot XYPlot removeDomainMarker.

Prototype

public boolean removeDomainMarker(Marker marker, Layer layer) 

Source Link

Document

Removes a marker for the domain axis in the specified layer and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:CGgui.java

private void SaveChrt() {
    try {/*from  w w w.ja v  a2 s .c  o m*/
        //remove crosshairs
        XYPlot xyplot = (XYPlot) chart.getPlot();
        xyplot.setDomainCrosshairVisible(false);

        //remove marker
        if (intervalmarker != null) {
            xyplot.removeDomainMarker(intervalmarker, Layer.BACKGROUND);
            intervalmarker = null;
        }

        //save
        chartpanel.doSaveAs();
    } catch (IOException err) {
        if (DEBUG)
            PrintText("Error: " + err);
    }

    //garbage collect
    //System.gc();
}

From source file:CGgui.java

public void clearData() {
    //global variables reset
    MIN = Double.MAX_VALUE;/*from  w w w  .  j  ava  2  s.c om*/
    MAX = 0;
    BINS = 10000;
    key = "";
    regLine = null;

    //clear min settings
    minText.setText("");
    maxText.setText("");
    smoothText.setText("");
    fragmentMap.clear();

    //new data sets
    lengthHist = null;
    histogramdataset = new XYSeriesCollection();
    minimadataset = new CategoryTableXYDataset();
    clusterdataset = new CategoryTableXYDataset();

    //chart area reset
    XYPlot xyplot = (XYPlot) chart.getPlot();
    xyplot.setDataset(new XYSeriesCollection());
    chartpanel.restoreAutoBounds();

    XYPlot minxyplot = (XYPlot) minchart.getPlot();
    minxyplot.setDataset(0, minimadataset);
    minxyplot.setDataset(1, new DefaultXYDataset());
    minchart.clearSubtitles();
    minchartpanel.restoreAutoBounds();

    XYPlot clusterxyplot = (XYPlot) clusterchart.getPlot();
    clusterxyplot.setDataset(clusterdataset);
    clusterchartpanel.restoreAutoBounds();

    //remove marker
    if (intervalmarker != null) {
        xyplot = (XYPlot) chart.getPlot();
        xyplot.removeDomainMarker(intervalmarker, Layer.BACKGROUND);
        intervalmarker = null;
    }

    //remove crosshair
    xyplot.setDomainCrosshairVisible(false);

    //clear text
    minText.setText(null);
    maxText.setText(null);
    smoothText.setText(null);

    //f.pack();
    //System.gc();
}