Examples of CategoryAxis


Examples of org.jfree.chart.axis.CategoryAxis

  private JFreeChart createChart(final Expression aExpression)
  {
    if (aExpression instanceof BarLineChartExpression)
    {
      final CategoryAxis catAxis = new CategoryAxis("Category");// NON-NLS
      final NumberAxis barsAxis = new NumberAxis("Value");// NON-NLS
      final NumberAxis linesAxis = new NumberAxis("Value2");// NON-NLS

      final CategoryPlot plot = new CategoryPlot(createDataset(), catAxis, barsAxis, new BarRenderer());
      plot.setRenderer(1, new LineAndShapeRenderer());
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

    }

    final Font labelFont = Font.decode(getLabelFont());


    final CategoryAxis categoryAxis = cpl.getDomainAxis();
    categoryAxis.setLabelFont(labelFont);
    categoryAxis.setTickLabelFont(labelFont);
    if (getCategoryTitleFont() != null)
    {
      categoryAxis.setLabelFont(getCategoryTitleFont());
    }
    if (getCategoryTickFont() != null)
    {
      categoryAxis.setTickLabelFont(getCategoryTickFont());
    }

    if (maxCategoryLabelWidthRatio != null)
    {
      categoryAxis.setMaximumCategoryLabelWidthRatio(maxCategoryLabelWidthRatio.floatValue());
    }
    cpl.setDomainGridlinesVisible(showGridlines);
    if (labelRotation != null)
    {
      categoryAxis.setCategoryLabelPositions
          (CategoryLabelPositions.createUpRotationLabelPositions(labelRotation.doubleValue()));
    }

    final String[] colors = getSeriesColor();
    for (int i = 0; i < colors.length; i++)
    {
      renderer.setSeriesPaint(i, parseColorFromString(colors[i]));
    }

    if (lowerMargin != null)
    {
      categoryAxis.setLowerMargin(lowerMargin.doubleValue());
    }
    if (upperMargin != null)
    {
      categoryAxis.setUpperMargin(upperMargin.doubleValue());
    }
    if (categoryMargin != null)
    {
      categoryAxis.setCategoryMargin(categoryMargin.doubleValue());
    }


    final ValueAxis rangeAxis = cpl.getRangeAxis();
    if (rangeAxis instanceof NumberAxis)
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

    if (orientation == null)
    {
      throw new IllegalArgumentException("Null 'orientation' argument.");
    }
    final CategoryAxis categoryAxis = new FormattedCategoryAxis(categoryAxisLabel,
        getCategoricalAxisMessageFormat(), getRuntime().getResourceBundleFactory().getLocale());
    categoryAxis.setCategoryMargin(0.0);
    final ValueAxis valueAxis = new NumberAxis(valueAxisLabel);

    final StackedAreaRenderer renderer = new StackedAreaRenderer();
    if (tooltips)
    {
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

        plot.setShadowGenerator(this.shadowGenerator);

        // process all domain axes
        int domainAxisCount = plot.getDomainAxisCount();
        for (int i = 0; i < domainAxisCount; i++) {
            CategoryAxis axis = plot.getDomainAxis(i);
            if (axis != null) {
                applyToCategoryAxis(axis);
            }
        }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

     * @return The axis (<code>null</code> possible).
     *
     * @see #setDomainAxis(int, CategoryAxis)
     */
    public CategoryAxis getDomainAxis(int index) {
        CategoryAxis result = null;
        if (index < this.domainAxes.size()) {
            result = (CategoryAxis) this.domainAxes.get(index);
        }
        if (result == null) {
            Plot parent = getParent();
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

     * @param index  the axis index.
     * @param axis  the axis (<code>null</code> permitted).
     * @param notify  notify listeners?
     */
    public void setDomainAxis(int index, CategoryAxis axis, boolean notify) {
        CategoryAxis existing = (CategoryAxis) this.domainAxes.get(index);
        if (existing != null) {
            existing.removeChangeListener(this);
        }
        if (axis != null) {
            axis.setPlot(this);
        }
        this.domainAxes.set(index, axis);
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

     * Clears the domain axes from the plot and sends a {@link PlotChangeEvent}
     * to all registered listeners.
     */
    public void clearDomainAxes() {
        for (int i = 0; i < this.domainAxes.size(); i++) {
            CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
            if (axis != null) {
                axis.removeChangeListener(this);
            }
        }
        this.domainAxes.clear();
        fireChangeEvent();
    }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

    /**
     * Configures the domain axes.
     */
    public void configureDomainAxes() {
        for (int i = 0; i < this.domainAxes.size(); i++) {
            CategoryAxis axis = (CategoryAxis) this.domainAxes.get(i);
            if (axis != null) {
                axis.configure();
            }
        }
    }
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

     */
    public CategoryAxis getDomainAxisForDataset(int index) {
        if (index < 0) {
            throw new IllegalArgumentException("Negative 'index'.");
        }
        CategoryAxis axis = null;
        List axisIndices = (List) this.datasetToDomainAxesMap.get(
                new Integer(index));
        if (axisIndices != null) {
            // the first axis in the list is used for data <--> Java2D
            Integer axisIndex = (Integer) axisIndices.get(0);
View Full Code Here

Examples of org.jfree.chart.axis.CategoryAxis

        AxisCollection axisCollection = new AxisCollection();

        // add domain axes to lists...
        for (int index = 0; index < this.domainAxes.size(); index++) {
            CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(index);
            if (xAxis != null) {
                axisCollection.add(xAxis, getDomainAxisEdge(index));
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.