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(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); }
valueAxis.setTickLabelFont(bigger); font = plot.getDomainAxis().getLabelFont(); size = font.getSize(); size += amount; valueAxis.setTickLabelFont(bigger); font = plot.getRangeAxis().getLabelFont(); size = font.getSize(); size += amount;
valueAxis.setTickLabelFont(bigger); font = plot.getDomainAxis().getLabelFont(); size = font.getSize(); size += amount; valueAxis.setTickLabelFont(bigger); font = plot.getRangeAxis().getLabelFont(); size = font.getSize(); size += amount;
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( 0 ).setLabelPaint( errorColorAvg ); axis2.setLabelPaint( ratioColorAvg ); axis2.setLabelFont( plot.getRangeAxis( 0 ).getLabelFont() ); axis2.setRange( 0.0, 100 ); plot.setRangeAxis( 1, axis2 );
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; }