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

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

Introduction

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

Prototype

public void setDomainZeroBaselineStroke(Stroke stroke) 

Source Link

Document

Sets the stroke for the zero baseline for the domain axis, and sends a PlotChangeEvent to all registered listeners.

Usage

From source file:org.esa.beam.visat.toolviews.stat.HistogramPanel.java

private void createUI() {
    dataset = new XIntervalSeriesCollection();
    chart = ChartFactory.createHistogram(CHART_TITLE, "Values", "Frequency in #pixels", dataset,
            PlotOrientation.VERTICAL, false, // Legend?
            true, // tooltips
            false // url
    );/*w  w  w. j a  va 2s  . c o m*/
    final XYPlot xyPlot = chart.getXYPlot();
    xyPlot.setDomainZeroBaselineStroke(new BasicStroke(0.2f));

    final XYBarRenderer renderer = (XYBarRenderer) xyPlot.getRenderer();
    renderer.setDrawBarOutline(false);
    renderer.setShadowVisible(false);
    renderer.setShadowYOffset(-4.0);
    renderer.setBaseToolTipGenerator(new XYPlotToolTipGenerator());
    renderer.setBarPainter(new StandardXYBarPainter());
    renderer.setSeriesPaint(0, new Color(0, 0, 200));

    createUI(createChartPanel(chart), createOptionsPanel(), bindingContext);

    isInitialized = true;

    final Binding minBinding = xAxisRangeControl.getBindingContext().getBinding("min");
    final double min = (Double) minBinding.getPropertyValue();
    final Binding maxBinding = xAxisRangeControl.getBindingContext().getBinding("max");
    final double max = (Double) maxBinding.getPropertyValue();
    if (!histogramComputing && min > max) {
        minBinding.setPropertyValue(max);
        maxBinding.setPropertyValue(min);
    }
    updateXAxis();
}