CategoryPlot plot = (CategoryPlot) chart.getPlot(); CategoryAxis domain = plot.getDomainAxis(); domain.setTickLabelPaint("Test", Color.green.darker());
public static void setupDomainAxis(CategoryAxis domainAxis) { if (domainAxis != null) { domainAxis.setAxisLineStroke(new BasicStroke(0.5f)); domainAxis.setAxisLinePaint(Color.BLACK); domainAxis.setTickLabelPaint(ChartDefaults.axisLabelColor); } }
public static void setupDomainAxis(CategoryAxis domainAxis) { if (domainAxis != null) { domainAxis.setAxisLineStroke(new BasicStroke(0.5f)); domainAxis.setAxisLinePaint(Color.BLACK); domainAxis.setTickLabelPaint(ChartDefaults.axisLabelColor); } }
private void configureDomainAxis(CategoryPlot plot, Font font) { CategoryAxis categoryAxis = new CategoryAxis(); categoryAxis.setTickMarksVisible(true); categoryAxis.setTickLabelFont(font); categoryAxis.setTickLabelPaint(OUTLINE_COLOR); plot.setDomainAxis(categoryAxis); plot.setDomainGridlinesVisible(false); }
/** * Applies the attributes for this theme to a {@link CategoryAxis}. * * @param axis the axis ({@code null} not permitted). */ protected void applyToCategoryAxis(CategoryAxis axis) { axis.setLabelFont(this.largeFont); axis.setLabelPaint(this.axisLabelPaint); axis.setTickLabelFont(this.regularFont); axis.setTickLabelPaint(this.tickLabelPaint); if (axis instanceof SubCategoryAxis) { SubCategoryAxis sca = (SubCategoryAxis) axis; sca.setSubLabelFont(this.regularFont); sca.setSubLabelPaint(this.tickLabelPaint); } }
/** * Applies the attributes for this theme to a {@link CategoryAxis}. * * @param axis the axis (<code>null</code> not permitted). */ protected void applyToCategoryAxis(CategoryAxis axis) { axis.setLabelFont(this.largeFont); axis.setLabelPaint(this.axisLabelPaint); axis.setTickLabelFont(this.regularFont); axis.setTickLabelPaint(this.tickLabelPaint); if (axis instanceof SubCategoryAxis) { SubCategoryAxis sca = (SubCategoryAxis) axis; sca.setSubLabelFont(this.regularFont); sca.setSubLabelPaint(this.tickLabelPaint); } }
static private void setBackgroundDefault(final JFreeChart chart) { BasicStroke gridStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 1.0f, new float[]{2.0f, 1.0f}, 0.0f); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setRangeGridlineStroke(gridStroke); plot.setDomainGridlineStroke(gridStroke); plot.setBackgroundPaint(new Color(235, 235, 235)); plot.setRangeGridlinePaint(Color.white); plot.setDomainGridlinePaint(Color.white); plot.setOutlineVisible(false); plot.getDomainAxis().setAxisLineVisible(false); plot.getRangeAxis().setAxisLineVisible(false); plot.getDomainAxis().setLabelPaint(Color.gray); plot.getRangeAxis().setLabelPaint(Color.gray); plot.getDomainAxis().setTickLabelPaint(Color.gray); plot.getRangeAxis().setTickLabelPaint(Color.gray); chart.getTitle().setPaint(Color.gray); }
plot.getDomainAxis().setLabelPaint(foregroung); plot.getRangeAxis().setLabelPaint(foregroung); plot.getDomainAxis().setTickLabelPaint(foregroung); plot.getDomainAxis().setTickMarkPaint(foregroung); plot.getRangeAxis().setTickLabelPaint(foregroung);