Example usage for org.jfree.chart.axis CategoryAxis setTickLabelPaint

List of usage examples for org.jfree.chart.axis CategoryAxis setTickLabelPaint

Introduction

In this page you can find the example usage for org.jfree.chart.axis CategoryAxis setTickLabelPaint.

Prototype

public void setTickLabelPaint(Paint paint) 

Source Link

Document

Sets the paint used to draw tick labels (if they are showing) and sends an AxisChangeEvent to all registered listeners.

Usage

From source file:com.xilinx.ultrascale.gui.DMABarChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "Throughput (Gbps)", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(bg);// ww  w .j a v  a 2  s. c  o  m
    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);

    CategoryPlot plot = chart.getCategoryPlot();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(64.0);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));
    axis.setLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0x2e, 0x90, 0x18));//(0x17, 0x7b, 0x7c));
    renderer.setSeriesPaint(1, new Color(0x12, 0x45, 0x73));//(0xa2, 0x45, 0x73)
    renderer.setSeriesPaint(3, new Color(0xff, 0x80, 0x40));
    renderer.setSeriesPaint(2, new Color(0x6f, 0x2c, 0x85));
    renderer.setSeriesPaint(4, new Color(0xa1, 0x60, 0x98));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    //renderer.setMaximumBarWidth(0.05);
    //        addDummy();
}

From source file:com.xilinx.ultrascale.gui.PowerChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "", dataset, PlotOrientation.HORIZONTAL, true,
            true, false);//from w w  w  .j a v  a2 s.  co m

    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);
    chart.setBackgroundPaint(bg);

    CategoryPlot plot = chart.getCategoryPlot();
    plot.setDomainGridlinesVisible(false);
    plot.setRangeGridlinesVisible(false);

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    ValueAxis axis = plot.getRangeAxis();
    //        axis.setUpperBound(6);
    axis.setAutoRange(true);
    axis.setLowerMargin(0);
    axis.setUpperMargin(.40);
    //        TickUnits tickUnits = new TickUnits();
    //        tickUnits.add(new NumberTickUnit(1));
    //        axis.setStandardTickUnits(tickUnits);
    //        axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0x2e, 0x90, 0x18));//(0x17, 0x7b, 0x7c));
    renderer.setSeriesPaint(1, new Color(0x12, 0x45, 0x73));//(0xa2, 0x45, 0x73)
    renderer.setSeriesPaint(2, new Color(0xff, 0x80, 0x40));
    renderer.setSeriesPaint(3, new Color(0x6f, 0x2c, 0x85));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    addDummy();
}

From source file:com.xilinx.kintex7.DMABarChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "Throughput (Gbps)", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(bg);/*w  w  w .ja  v  a  2 s.c  o  m*/
    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);

    CategoryPlot plot = chart.getCategoryPlot();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(30.0);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));
    axis.setLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0, 0, 0x80));
    renderer.setSeriesPaint(1, new Color(0, 0x80, 0xff));
    renderer.setSeriesPaint(2, new Color(0xa2, 0x45, 0x73));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    //renderer.setMaximumBarWidth(0.05);
    addDummy();
}

From source file:com.xilinx.kintex7.PowerChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "", dataset, PlotOrientation.HORIZONTAL, true,
            true, false);/*from  w  ww .  j a  va2  s  . co  m*/

    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);
    chart.setBackgroundPaint(bg);

    CategoryPlot plot = chart.getCategoryPlot();
    plot.setDomainGridlinesVisible(false);
    plot.setRangeGridlinesVisible(false);

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(6.0);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0x17, 0x7b, 0x7c));
    renderer.setSeriesPaint(1, new Color(0xa2, 0x45, 0x73));
    renderer.setSeriesPaint(2, new Color(0xff, 0x80, 0x40));
    renderer.setSeriesPaint(3, new Color(0x6f, 0x2c, 0x85));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    addDummy();
}

From source file:com.xilinx.virtex7.DMABarChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "Throughput (Gbps)", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setBackgroundPaint(bg);//from  w  w  w.  jav  a2  s. c o  m
    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);

    CategoryPlot plot = chart.getCategoryPlot();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(64.0);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));
    axis.setLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0, 0, 0x80));
    renderer.setSeriesPaint(1, new Color(0, 0x80, 0xff));
    renderer.setSeriesPaint(2, new Color(0xa2, 0x45, 0x73));
    renderer.setSeriesPaint(3, new Color(0x40, 0xa1, 0xff));
    renderer.setSeriesPaint(4, new Color(0xa1, 0x60, 0x98));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    //renderer.setMaximumBarWidth(0.05);
    addDummy();
}

From source file:com.xilinx.virtex7.PowerChart.java

private void makeChart() {
    dataset = new DefaultCategoryDataset();
    chart = ChartFactory.createBarChart("", "Time Interval", "", dataset, PlotOrientation.HORIZONTAL, true,
            true, false);/*from   ww  w  . ja v a 2  s.c  o m*/

    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.WHITE);
    chart.setTitle(ttitle);
    chart.setBackgroundPaint(bg);

    CategoryPlot plot = chart.getCategoryPlot();
    plot.setDomainGridlinesVisible(false);
    plot.setRangeGridlinesVisible(false);

    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);

    ValueAxis axis = plot.getRangeAxis();
    axis.setUpperBound(10.0);
    TickUnits tickUnits = new TickUnits();
    tickUnits.add(new NumberTickUnit(2));
    axis.setStandardTickUnits(tickUnits);
    axis.setLowerBound(0.0);
    axis.setTickLabelPaint(new Color(185, 185, 185));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(185, 185, 185));
    caxis.setLabelPaint(new Color(185, 185, 185));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0x17, 0x7b, 0x7c));
    renderer.setSeriesPaint(1, new Color(0xa2, 0x45, 0x73));
    renderer.setSeriesPaint(2, new Color(0xff, 0x80, 0x40));
    renderer.setSeriesPaint(3, new Color(0x6f, 0x2c, 0x85));
    renderer.setBaseToolTipGenerator(
            new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    addDummy();
}

From source file:org.sonar.plugins.core.charts.DistributionBarChart.java

private void configureDomainAxis(CategoryPlot plot, Font font) {
    CategoryAxis categoryAxis = new CategoryAxis();
    categoryAxis.setTickMarksVisible(true);
    categoryAxis.setTickLabelFont(font);
    categoryAxis.setTickLabelPaint(OUTLINE_COLOR);
    plot.setDomainAxis(categoryAxis);/*ww w  .j a va  2  s.  co  m*/
    plot.setDomainGridlinesVisible(false);
}

From source file:com.xilinx.ultrascale.gui.BarChartsEth.java

License:asdf

private void makeChart(String name) {
    dataset = new DefaultCategoryDataset();
    //        chart = ChartFactory.createLineChart("", "", name, dataset, PlotOrientation.VERTICAL, true, true, false);
    //        chart = ChartFactory.createBarChart("asd", "asd", "asdffa", dataset, PlotOrientation.HORIZONTAL, true, true, false);

    chart = ChartFactory.createBarChart("power", "Time Interval", "Throughput (Gbps)", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    chart.setBackgroundPaint(bg);//from w  ww  .  j av a 2s  . c  o  m

    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.BLACK);
    chart.setTitle(ttitle);

    CategoryPlot plot = chart.getCategoryPlot();
    //        BarRenderer renderer = (BarRenderer)plot.getRenderer();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    ValueAxis axis = plot.getRangeAxis();
    upperBounds(65);

    axis.setTickLabelPaint(new Color(0, 0, 0));//(185, 185, 185)
    axis.setLabelPaint(new Color(0, 0, 0));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(0, 0, 0));
    caxis.setLabelPaint(new Color(0, 0, 0));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0x2e, 0x90, 0x18));//(0x17, 0x7b, 0x7c));
    renderer.setSeriesPaint(1, new Color(0x12, 0x45, 0x73));//(0xa2, 0x45, 0x73)
    renderer.setSeriesPaint(3, new Color(0xff, 0x80, 0x40));
    renderer.setSeriesPaint(2, new Color(0x6f, 0x2c, 0x85));
    //        renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    //renderer.setMaximumBarWidth(0.05);
    addDummy();
}

From source file:com.xilinx.ultrascale.gui.BarCharts.java

License:asdf

private void makeChart(String name) {
    dataset = new DefaultCategoryDataset();
    //        chart = ChartFactory.createLineChart("", "", name, dataset, PlotOrientation.VERTICAL, true, true, false);
    //        chart = ChartFactory.createBarChart("asd", "asd", "asdffa", dataset, PlotOrientation.HORIZONTAL, true, true, false);

    chart = ChartFactory.createBarChart("power", "Time Interval", "Throughput (Gbps)", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    chart.setBackgroundPaint(bg);//from  www .j av a 2  s.co  m

    TextTitle ttitle = new TextTitle(title, new Font(title, Font.BOLD, 15));
    ttitle.setPaint(Color.BLACK);
    chart.setTitle(ttitle);

    CategoryPlot plot = chart.getCategoryPlot();
    //        BarRenderer renderer = (BarRenderer)plot.getRenderer();
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    ValueAxis axis = plot.getRangeAxis();
    upperBounds(65);

    axis.setTickLabelPaint(new Color(0, 0, 0));//(185, 185, 185)

    axis.setLabelPaint(new Color(0, 0, 0));

    CategoryAxis caxis = plot.getDomainAxis();
    caxis.setTickLabelPaint(new Color(0, 0, 0));
    caxis.setLabelPaint(new Color(0, 0, 0));

    renderer.setItemMargin(0);
    renderer.setSeriesPaint(0, new Color(0x2e, 0x90, 0x18));//(0x17, 0x7b, 0x7c));
    renderer.setSeriesPaint(1, new Color(0x12, 0x45, 0x73));//(0xa2, 0x45, 0x73)
    renderer.setSeriesPaint(3, new Color(0xff, 0x80, 0x40));
    renderer.setSeriesPaint(2, new Color(0x6f, 0x2c, 0x85));
    //        renderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator("{0}:{2}", new DecimalFormat("0.000")));
    //renderer.setMaximumBarWidth(0.05);
    addDummy();
}

From source file:netmason.support.graphics.GanttDisplay.java

public GanttDisplay(String title) {

    super(title);

    collection.add(s1);/*  w ww  .j a  v  a2s  .  c  om*/

    // create the chart...
    chart = ChartFactory.createGanttChart("Gantt Chart", // chart title
            "Agent", // domain axis label
            "Date", // range axis label
            collection, // data
            false, // include legend
            true, // tooltips
            false // urls
    );

    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    CategoryItemRenderer renderer = plot.getRenderer();
    plot.setDomainGridlinePosition(CategoryAnchor.START);
    CategoryAxis domainAxis = plot.getDomainAxis();
    domainAxis.setTickLabelPaint(Color.blue);
    domainAxis.setAxisLineVisible(false);

    domainAxis.setCategoryLabelPositionOffset(0);
    domainAxis.setMaximumCategoryLabelLines(2);
    domainAxis.setMaximumCategoryLabelWidthRatio(0.3f);

    renderer.setSeriesPaint(0, Color.blue);

    // add the chart to a panel...
    ChartPanel chartPanel = new ChartPanel(chart);
    setContentPane(chartPanel);

}