private static <T extends ValueAxis> T defaultAxis(T axis) { axis.setLabelFont(new Font("SansSerif", Font.PLAIN | Font.ITALIC, 12)); return axis; }
private ValueAxis configureRangeIndex(int index, int dataType) { ValueAxis axis = createAxis(dataType); axis.setAutoRange(true); Font axisFont = axis.getLabelFont().deriveFont(Font.BOLD); axis.setLabelFont(axisFont); axis.setLabel(String.format("Y%d Samples", index + 1)); xyPlot.setRangeAxis(index, axis); xyPlot.setRangeAxisLocation(index, index == 0 ? AxisLocation.BOTTOM_OR_LEFT : AxisLocation.BOTTOM_OR_RIGHT); return axis; }
private void configureDomainAxis(XYPlot plot) { ValueAxis domainAxis = plot.getDomainAxis(); domainAxis.setTickLabelFont(LabelConstants.FONT_LABEL); domainAxis.setLabelFont(LabelConstants.FONT_LABEL); domainAxis.setTickLabelPaint(LabelConstants.COLOR); domainAxis.setLabelPaint(LabelConstants.COLOR); }
private void configureDomainAxis(XYPlot xyPlot) { ValueAxis domainAxis = xyPlot.getDomainAxis(); domainAxis.setTickLabelFont(FONT_LABEL); domainAxis.setLabelFont(FONT_LABEL); domainAxis.setTickLabelPaint(COLOR); domainAxis.setLabelPaint(COLOR); }
private void configureDomainAxis(int index, String nameX, int dataType) { ValueAxis axis = createAxis(dataType); axis.setAutoRange(true); axis.setAutoRangeMinimumSize(2); axis.setLabel(nameX); Font axisFont = axis.getLabelFont().deriveFont(Font.BOLD); axis.setLabelFont(axisFont); xyPlot.setDomainAxis(index, axis); }
size += amount; bigger = new Font(font.getName(), font.getStyle(), size); valueAxis.setLabelFont(bigger); size += amount; bigger = new Font(font.getName(), font.getStyle(), size); valueAxis.setLabelFont(bigger);
size += amount; bigger = new Font(font.getName(), font.getStyle(), size); valueAxis.setLabelFont(bigger); size += amount; bigger = new Font(font.getName(), font.getStyle(), size); valueAxis.setLabelFont(bigger);
plot.getRangeAxis().setLabelFont(FONT); plot.getRangeAxis().setTickLabelFont(SMALL_FONT); plot.getDomainAxis().setLabelFont(FONT); plot.getDomainAxis().setTickLabelFont(SMALL_FONT);
plot.getRangeAxis().setLabelFont(FONT); plot.getRangeAxis().setTickLabelFont(SMALL_FONT); plot.getDomainAxis().setLabelFont(FONT); plot.getDomainAxis().setTickLabelFont(SMALL_FONT);
/** * 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); } }
/** * Applies the attributes for this theme to a {@link ValueAxis}. * * @param axis the axis ({@code null} 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); } }
Font domainAxisLabelFont = domainAxis.getLabelFont(); float domainAxisLabelFontSize = domainAxisLabelFont.getSize(); domainAxis.setLabelFont(domainAxisLabelFont.deriveFont(domainAxisLabelFontSize * 0.6f)); Font rangeAxisLabelFont = rangeAxis.getLabelFont(); float rangeAxisLabelFontSize = rangeAxisLabelFont.getSize(); rangeAxis.setLabelFont(rangeAxisLabelFont.deriveFont(rangeAxisLabelFontSize * 0.6f));
plot.getRangeAxis().setLabelFont(FONT); plot.getRangeAxis().setTickLabelFont(SMALL_FONT); plot.getDomainAxis().setLabelFont(FONT); plot.getDomainAxis().setTickLabelFont(SMALL_FONT);
plot.getRangeAxis().setLabelFont(FONT); plot.getRangeAxis().setTickLabelFont(SMALL_FONT); plot.getDomainAxis().setLabelFont(FONT); plot.getDomainAxis().setTickLabelFont(SMALL_FONT);
graph.getXYPlot().getDomainAxis().setTickLabelFont(new Font("SansSerif", Font.PLAIN, 20)); graph.getXYPlot().getRangeAxis().setTickLabelFont(new Font("SansSerif", Font.PLAIN, 20)); graph.getXYPlot().getDomainAxis().setLabelFont(new Font("SansSerif", Font.BOLD, 22)); graph.getXYPlot().getRangeAxis().setLabelFont(new Font("SansSerif", Font.BOLD, 22));
plot.getRangeAxis().setLabelFont( FONT ); plot.getRangeAxis().setTickLabelFont( SMALL_FONT ); plot.getDomainAxis().setLabelFont( FONT ); plot.getDomainAxis().setTickLabelFont( SMALL_FONT );
plot.setRenderer( 1, edgeRenderer ); plot.setRenderer( 0, pointRenderer ); plot.getRangeAxis().setLabelFont( FONT ); plot.getRangeAxis().setTickLabelFont( SMALL_FONT ); plot.getDomainAxis().setLabelFont( FONT ); plot.getDomainAxis().setTickLabelFont( SMALL_FONT );
plot.setRenderer( 1, edgeRenderer ); plot.setRenderer( 0, pointRenderer ); plot.getRangeAxis().setLabelFont( FONT ); plot.getRangeAxis().setTickLabelFont( SMALL_FONT ); plot.getDomainAxis().setLabelFont( FONT ); plot.getDomainAxis().setTickLabelFont( SMALL_FONT );
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; }
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; }