Example usage for org.jfree.chart.axis NumberAxis3D setStandardTickUnits

List of usage examples for org.jfree.chart.axis NumberAxis3D setStandardTickUnits

Introduction

In this page you can find the example usage for org.jfree.chart.axis NumberAxis3D setStandardTickUnits.

Prototype

public void setStandardTickUnits(TickUnitSource source) 

Source Link

Document

Sets the source for obtaining standard tick units for the axis and sends an AxisChangeEvent to all registered listeners.

Usage

From source file:graficos.GraficoBarras.java

private static JFreeChart crearGrafico(CategoryDataset cjto_datos) {
    JFreeChart grafico = ChartFactory.createBarChart3D("Distribucin de Recursos", // Ttulo
            "Unidad de tiempo", // Ttulo eje x
            "Recurso", // Ttulo eje y
            cjto_datos, // Datos
            PlotOrientation.VERTICAL, // Orientacin
            true, // Incluir leyenda
            true, // Incluir tooltips
            false // Incluir URLs
    );//from   w ww .  j a va 2 s  .  c o  m
    grafico.setBackgroundPaint(new Color(240, 240, 240));
    grafico.getPlot().zoom(0.0);
    CategoryPlot ploter = (CategoryPlot) grafico.getPlot();
    NumberAxis3D rangeAxis = (NumberAxis3D) ploter.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis3D.createIntegerTickUnits());
    BarRenderer3D renderer = (BarRenderer3D) ploter.getRenderer();
    renderer.setDrawBarOutline(false);
    GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.blue, 0.0f, 0.0f, new Color(0, 0, 64));
    GradientPaint gp1 = new GradientPaint(0.0f, 0.0f, Color.green, 0.0f, 0.0f, new Color(0, 64, 0));
    renderer.setSeriesPaint(0, gp0);
    renderer.setSeriesPaint(1, gp1);
    renderer.setItemMargin(0.0);
    CategoryAxis domainAxis = ploter.getDomainAxis();
    domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(0.0));
    return grafico;
}

From source file:org.sonar.plugins.abacus.chart.BarChart3D.java

private void configureRangeAxis(CategoryPlot plot, String valueLabelSuffix, Font font) {
    NumberAxis3D numberAxis = new NumberAxis3D();
    numberAxis.setUpperMargin(0.3);/*from   w  ww. j  a  v  a  2s  .c  o m*/
    numberAxis.setTickLabelFont(font);
    numberAxis.setTickLabelPaint(OUTLINE_COLOR);
    String suffix = "";
    if (valueLabelSuffix != null && !"".equals(valueLabelSuffix)) {
        suffix = new StringBuilder().append("'").append(valueLabelSuffix).append("'").toString();
    }
    numberAxis.setNumberFormatOverride(new DecimalFormat("0" + suffix));
    numberAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    plot.setRangeAxis(numberAxis);
}