Example usage for org.jfree.chart.axis ValueAxis setLowerBound

List of usage examples for org.jfree.chart.axis ValueAxis setLowerBound

Introduction

In this page you can find the example usage for org.jfree.chart.axis ValueAxis setLowerBound.

Prototype

public void setLowerBound(double min) 

Source Link

Document

Sets the lower bound for the axis range.

Usage

From source file:gui.DendrogramChart.java

void setScaling(boolean autorange, double min, double max) {
    JFreeChart chart = ((ChartPanel) getComponent(0)).getChart();
    ValueAxis axis = chart.getXYPlot().getDomainAxis();

    axis.setAutoRange(autorange);/*from w ww  . j av  a  2  s . c  o m*/
    if (!autorange) {
        axis.setLowerBound(min);
        axis.setUpperBound(max);
    }
}

From source file:com.xilinx.kintex7.DMABarChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "Throughput (Gbps)", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(bg);/*from  w  w  w  . j a v a  2  s.  c om*/
    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);

    CategoryPlot plot = chart.getCategoryPlot();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(30.0);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));
    axis.setLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0, 0, 0x80));
    renderer.setSeriesPaint(1, new Color(0, 0x80, 0xff));
    renderer.setSeriesPaint(2, new Color(0xa2, 0x45, 0x73));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    //renderer.setMaximumBarWidth(0.05);
    addDummy();
}

From source file:com.greenpepper.confluence.macros.historic.LinearExecutionChartBuilder.java

private void customizeChart(JFreeChart chart) throws IOException {
    chart.setBackgroundPaint(Color.white);
    chart.setBorderVisible(settings.isBorder());

    TextTitle chartTitle = chart.getTitle();
    customizeTitle(chartTitle, DEFAULT_TITLE_FONT);

    addSubTitle(chart, settings.getSubTitle(), DEFAULT_SUBTITLE_FONT);
    addSubTitle(chart, settings.getSubTitle2(), DEFAULT_SUBTITLE2_FONT);

    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setNoDataMessage(gpUtil.getText("greenpepper.historic.nodata"));

    CategoryItemRenderer renderer = plot.getRenderer();

    int index = 0;
    renderer.setSeriesPaint(index++, GREEN_COLOR);
    if (settings.isShowIgnored())
        renderer.setSeriesPaint(index++, Color.yellow);
    renderer.setSeriesPaint(index, Color.red);

    renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator());
    renderer.setItemURLGenerator(new CategoryURLGenerator() {

        public String generateURL(CategoryDataset data, int series, int category) {
            Comparable valueKey = data.getColumnKey(category);
            ChartLongValue value = (ChartLongValue) valueKey;
            return "javascript:" + settings.getExecutionUID() + "_showExecutionResult('" + value.getId()
                    + "');";
        }// w w  w . j  av  a2 s  .c o  m
    });

    CategoryAxis domainAxis = plot.getDomainAxis();
    customizeAxis(domainAxis);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90);

    ValueAxis rangeAxis = plot.getRangeAxis();
    customizeAxis(rangeAxis);
    rangeAxis.setLowerBound(0);

    if (rangeAxis instanceof NumberAxis) {
        ((NumberAxis) rangeAxis).setTickUnit(new NumberTickUnit(1));
    }

    plot.setForegroundAlpha(0.8f);
}

From source file:com.xilinx.kintex7.PowerChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "", dataset, PlotOrientation.HORIZONTAL, true,
            true, false);//from  www.j av  a2s. com

    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);
    chart.setBackgroundPaint(bg);

    CategoryPlot plot = chart.getCategoryPlot();
    plot.setDomainGridlinesVisible(false);
    plot.setRangeGridlinesVisible(false);

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(6.0);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0x17, 0x7b, 0x7c));
    renderer.setSeriesPaint(1, new Color(0xa2, 0x45, 0x73));
    renderer.setSeriesPaint(2, new Color(0xff, 0x80, 0x40));
    renderer.setSeriesPaint(3, new Color(0x6f, 0x2c, 0x85));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    addDummy();
}

From source file:com.xilinx.ultrascale.gui.BarChartsEth.java

License:asdf

public void upperBounds(int topVal) {
    CategoryPlot plot = chart.getCategoryPlot();
    //        BarRenderer renderer = (BarRenderer)plot.getRenderer();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);//w  w w .ja  v  a2 s.  c o m
    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(topVal);
    axis.setLowerBound(0.0);
    //        axis.setAutoRangeMinimumSize(1.0);
    //        axis.setAutoRange(true);
    ////        axis.setLowerMargin(0);
    //        axis.setLowerMargin(0);
    //        axis.setUpperMargin(0.40);
    //        axis.setAutoRangeMinimumSize(1.0);
    //        axis.setDefaultAutoRange(new Range(0, 1000));
}

From source file:com.xilinx.virtex7.DMABarChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "Throughput (Gbps)", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(bg);//from   w  w w .j  a  v  a  2  s.c  o m
    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);

    CategoryPlot plot = chart.getCategoryPlot();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(64.0);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));
    axis.setLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0, 0, 0x80));
    renderer.setSeriesPaint(1, new Color(0, 0x80, 0xff));
    renderer.setSeriesPaint(2, new Color(0xa2, 0x45, 0x73));
    renderer.setSeriesPaint(3, new Color(0x40, 0xa1, 0xff));
    renderer.setSeriesPaint(4, new Color(0xa1, 0x60, 0x98));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    //renderer.setMaximumBarWidth(0.05);
    addDummy();
}

From source file:info.novatec.testit.livingdoc.confluence.macros.historic.LinearExecutionChartBuilder.java

@SuppressWarnings("deprecation")
private void customizeChart(JFreeChart chart) {
    chart.setBackgroundPaint(Color.white);
    chart.setBorderVisible(settings.isBorder());

    TextTitle chartTitle = chart.getTitle();
    customizeTitle(chartTitle, DEFAULT_TITLE_FONT);

    addSubTitle(chart, settings.getSubTitle(), DEFAULT_SUBTITLE_FONT);
    addSubTitle(chart, settings.getSubTitle2(), DEFAULT_SUBTITLE2_FONT);

    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setNoDataMessage(ldUtil.getText("livingdoc.historic.nodata"));

    CategoryItemRenderer renderer = plot.getRenderer();

    int index = 0;
    renderer.setSeriesPaint(index++, GREEN_COLOR);
    if (settings.isShowIgnored()) {
        renderer.setSeriesPaint(index++, Color.yellow);
    }/*w w  w.  j a va  2 s .co m*/
    renderer.setSeriesPaint(index, Color.red);

    renderer.setToolTipGenerator(new StandardCategoryToolTipGenerator());
    renderer.setItemURLGenerator(new CategoryURLGenerator() {

        @Override
        public String generateURL(CategoryDataset data, int series, int category) {
            Comparable<?> valueKey = data.getColumnKey(category);
            ChartLongValue value = (ChartLongValue) valueKey;
            return "javascript:" + settings.getExecutionUID() + "_showExecutionResult('" + value.getId()
                    + "');";
        }
    });

    CategoryAxis domainAxis = plot.getDomainAxis();
    customizeAxis(domainAxis);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90);

    ValueAxis rangeAxis = plot.getRangeAxis();
    customizeAxis(rangeAxis);
    rangeAxis.setLowerBound(0);

    if (rangeAxis instanceof NumberAxis) {
        ((NumberAxis) rangeAxis).setTickUnit(new NumberTickUnit(1));
    }

    plot.setForegroundAlpha(0.8f);
}

From source file:sim.app.antsvoronoi.AntsVoronoiWithUI.java

public JFrame createBarChartFrame() {
    barChart = new BarChartGenerator();
    barChart.setTitle("Number of Food Closest to Each Ant Hill");
    barChart.setYAxisLabel("Food Counts");
    barChart.setXAxisLabel("Ant Hill");

    CategoryPlot plot = barChart.getChart().getCategoryPlot();
    ValueAxis axis = plot.getRangeAxis();
    axis.setLowerBound(0);
    AntsForageVoronoi af = (AntsForageVoronoi) state;
    axis.setUpperBound(af.numFood * .75);

    BarRenderer renderer = new BarRenderer();
    renderer = (BarRenderer) plot.getRenderer();
    ItemLabelPosition position = new ItemLabelPosition(ItemLabelAnchor.INSIDE6, TextAnchor.BOTTOM_CENTER);//, TextAnchor.BOTTOM_CENTER, 0.0);
    renderer.setPositiveItemLabelPosition(position);
    renderer.setNegativeItemLabelPosition(position);
    plot.setRenderer(renderer);//from w  w w  .  j a  v a 2s.  c  o  m

    barChartFrame = barChart.createFrame();
    barChartFrame.setVisible(true);
    barChartFrame.setTitle("Bar Chart");
    return barChartFrame;
}

From source file:com.xilinx.ultrascale.gui.BarCharts.java

License:asdf

public void upperBounds(int topVal) {
    CategoryPlot plot = chart.getCategoryPlot();
    //        BarRenderer renderer = (BarRenderer)plot.getRenderer();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);//from   w  w w.  j a  v a  2 s. co  m
    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(topVal);
    axis.setLowerBound(0.0);
    if (topVal == 32) {
        TickUnits tu = new TickUnits();
        tu.add(new NumberTickUnit(4));
        axis.setStandardTickUnits(tu);
    }

    //        axis.setAutoRangeMinimumSize(1.0);
    //        axis.setAutoRange(true);
    ////        axis.setLowerMargin(0);
    //        axis.setLowerMargin(0);
    //        axis.setUpperMargin(0.40);
    //        axis.setAutoRangeMinimumSize(1.0);
    //        axis.setDefaultAutoRange(new Range(0, 1000));
}

From source file:com.greenpepper.confluence.macros.historic.AggregationExecutionChartBuilder.java

private void customizeChart(JFreeChart chart) throws IOException {
    chart.setBackgroundPaint(Color.white);
    chart.setBorderVisible(settings.isBorder());

    TextTitle chartTitle = chart.getTitle();
    customizeTitle(chartTitle, DEFAULT_TITLE_FONT);

    addSubTitle(chart, settings.getSubTitle(), DEFAULT_SUBTITLE_FONT);
    addSubTitle(chart, settings.getSubTitle2(), DEFAULT_SUBTITLE2_FONT);

    CategoryPlot plot = (CategoryPlot) chart.getPlot();
    plot.setNoDataMessage(gpUtil.getText("greenpepper.historic.nodata"));

    StackedBarRenderer renderer = new StackedBarRenderer(true);
    plot.setRenderer(renderer);//from w w  w . j  a v  a  2s  .  com

    int index = 0;
    renderer.setSeriesPaint(index++, GREEN_COLOR);
    if (settings.isShowIgnored())
        renderer.setSeriesPaint(index++, Color.yellow);
    renderer.setSeriesPaint(index, Color.red);

    renderer.setToolTipGenerator(new DefaultTooltipGenerator());
    renderer.setItemURLGenerator(new CategoryURLGenerator() {

        public String generateURL(CategoryDataset data, int series, int category) {
            Comparable valueKey = data.getColumnKey(category);
            ChartLongValue value = (ChartLongValue) valueKey;
            return "javascript:" + settings.getExecutionUID() + "_showHistoricChart('" + value.getId() + "');";
        }
    });

    CategoryAxis domainAxis = plot.getDomainAxis();
    customizeAxis(domainAxis);
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
    domainAxis.setCategoryMargin(0.01);

    ValueAxis rangeAxis = plot.getRangeAxis();
    customizeAxis(rangeAxis);
    rangeAxis.setLowerBound(0);
    rangeAxis.setUpperBound(1.0);

    if (rangeAxis instanceof NumberAxis) {
        NumberAxis numberAxis = (NumberAxis) rangeAxis;
        numberAxis.setTickUnit(new NumberTickUnit(.10));
        numberAxis.setNumberFormatOverride(PERCENT_FORMATTER);
    }

    plot.setForegroundAlpha(0.8f);
}