title: JFreeChart | How to add percentage to top of each bar and format domain axis (X axis) ticklabels?
body: <p>I'm using <a href="http://www.jfree.org/jfreechart/" rel="nofollow noreferrer">JFreeChart</a> and following is a screenshot of the developed chart by me and the related code.</p>
  
  <p><a href="https://i.stack.imgur.com/FVxHJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FVxHJ.png" alt="JFreeChart"></a></p>
  
  <pre><code>    private void getBarChart(List&lt;Data&gt; data) {
  JFreeChart barChart = ChartFactory.createBarChart("", "", "", createDataset(data), PlotOrientation.VERTICAL, false, true, false);
          CategoryPlot plot = barChart.getCategoryPlot();
          plot.getRenderer().setSeriesPaint(0, new Color(7, 43, 97));
  
          barChart.getCategoryPlot().getRangeAxis().setLowerBound(0);
          barChart.getCategoryPlot().getRangeAxis().setUpperBound(1);
          NumberAxis xAxis2 = (NumberAxis) barChart.getCategoryPlot().getRangeAxis();
          xAxis2.setNumberFormatOverride(NumberFormat.getPercentInstance());
  
          plot.getRenderer().setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator());
          plot.getRenderer().setSeriesItemLabelsVisible(1, true);
          plot.getRenderer().setBaseItemLabelsVisible(true);
          plot.getRenderer().setBaseSeriesVisible(true);
          barChart.getCategoryPlot().setRenderer(plot.getRenderer());
  
  
          BarRenderer.setDefaultBarPainter(new StandardBarPainter());
          ((BarRenderer) plot.getRenderer()).setBarPainter(new StandardBarPainter());
  
          BufferedImage image = new BufferedImage(650, 250, BufferedImage.TYPE_INT_ARGB);
          Graphics2D g2 = image.createGraphics();
          g2.setRenderingHint(JFreeChart.KEY_SUPPRESS_SHADOW_GENERATION, true);
          Rectangle r = new Rectangle(0, 0, 650, 250);
          barChart.draw(g2, r);
          BufferedImage chartImage = barChart.createBufferedImage(600, 400, null);
  }
  </code></pre>
  
  <p>The expected chart should be something like following.
  <a href="https://i.stack.imgur.com/13Ms8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/13Ms8.png" alt="enter image description here"></a></p>
  
  <p><strong>Question 1.)</strong> <strong>How to format the x axis lables as per like the expected graph ?</strong>(CategoryLables or TickLabels in barChart.getCategoryPlot().getDomainAxis())</p>
  
  <p><strong>Question 2.)</strong> The values displayed in top of each bar (SeriesItemLabels) needs to be formatted with a percentage mark(%) similar to the y axis. (Also I think, like I have done in xAxis2.setNumberFormatOverride, the values will automatically get multipled by 100%. Right now it displays the decimal value only). How to achieve this ?</p>
  
  <p>Please help me out. Thanks.</p>