Java Code Examples for org.jfree.chart.axis.ValueAxis#setLabelPaint()

The following examples show how to use org.jfree.chart.axis.ValueAxis#setLabelPaint() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultipleAxisChart.java    From netcdf-java with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public void finish(java.awt.Dimension preferredSize) {
  ChartUtilities.applyCurrentTheme(chart);

  XYPlot plot = (XYPlot) chart.getPlot();
  for (int i = 0; i < axisNum; i++) {
    XYItemRenderer renderer = plot.getRenderer(i);
    if (renderer == null)
      continue;

    renderer.setSeriesPaint(0, colors[i]);

    ValueAxis axis = plot.getRangeAxis(i);
    axis.setLabelPaint(colors[i]);
    axis.setTickLabelPaint(colors[i]);
  }

  ChartPanel chartPanel = new ChartPanel(chart);
  chartPanel.setPreferredSize(preferredSize);
  chartPanel.setDomainZoomable(true);
  chartPanel.setRangeZoomable(true);
}
 
Example 2
Source File: StandardChartTheme.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
Example 3
Source File: StatisticChartStyling.java    From snap-desktop with GNU General Public License v3.0 6 votes vote down vote up
static ValueAxis updateScalingOfAxis(boolean logScaled, ValueAxis oldAxis, final boolean autoRangeIncludesZero) {
    ValueAxis newAxis = oldAxis;
    if (logScaled) {
        if (!(oldAxis instanceof CustomLogarithmicAxis)) {
            final CustomLogarithmicAxis logarithmicAxis = createLogarithmicAxis(oldAxis.getLabel());
            logarithmicAxis.setAutoRange(oldAxis.isAutoRange());
            newAxis = logarithmicAxis;
        }
    } else {
        if (oldAxis instanceof CustomLogarithmicAxis) {
            final NumberAxis numberAxis = createNumberAxis(oldAxis.getLabel(), autoRangeIncludesZero);
            numberAxis.setAutoRange(oldAxis.isAutoRange());
            newAxis = numberAxis;
        }
    }
    newAxis.setLabelFont(oldAxis.getLabelFont());
    newAxis.setLabelPaint(oldAxis.getLabelPaint());
    newAxis.setTickLabelFont(oldAxis.getTickLabelFont());
    newAxis.setTickLabelPaint(oldAxis.getTickLabelPaint());
    return newAxis;
}
 
Example 4
Source File: StandardChartTheme.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
Example 5
Source File: StandardChartTheme.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
Example 6
Source File: StandardChartTheme.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
Example 7
Source File: StandardChartTheme.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
Example 8
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}
 
Example 9
Source File: StandardChartTheme.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Applies the attributes for this theme to a {@link ValueAxis}.
 *
 * @param axis  the axis (<code>null</code> not permitted).
 */
protected void applyToValueAxis(ValueAxis axis) {
    axis.setLabelFont(this.largeFont);
    axis.setLabelPaint(this.axisLabelPaint);
    axis.setTickLabelFont(this.regularFont);
    axis.setTickLabelPaint(this.tickLabelPaint);
    if (axis instanceof SymbolAxis) {
        applyToSymbolAxis((SymbolAxis) axis);
    }
    if (axis instanceof PeriodAxis) {
        applyToPeriodAxis((PeriodAxis) axis);
    }
}