title: JFreeChart: set minimum X-tick interval in the chart
body: <p>I need to set minimum X-tick interval in the chart. I have a dataset that contains 1000 entries, i.e. <code>&lt;0,12&gt;,&lt;5,22&gt;,&lt;10,23&gt;,...,&lt;1000,20&gt;</code>. In dataset, the interval between X-values is equal to 5. In the chart I want to set X-tick interval equal to 100.</p>
  
  <p>I use this code, but it does not work:</p>
  
  <pre><code>    NumberAxis range = (NumberAxis)plot.getRangeAxis();  
      range.setTickUnit(new NumberTickUnit(100)); 
  </code></pre>
  
  <p>Here is my code snippet:</p>
  
  <pre><code>    private JFreeChart createChart(CategoryDataset dataset) 
      {
  
          final JFreeChart chart = ChartFactory.createAreaChart(
              this.title,
              "Time", 
              "Net demand", 
              dataset,
              PlotOrientation.VERTICAL,
              true,
              true,
              false
          );
  
          Title t = new TextTitle(this.subtitle);
          chart.addSubtitle(t);
  
          int transparency = 95;
          Color c = new Color(1, 158, 115, transparency);
          final CategoryPlot plot = chart.getCategoryPlot();
          CategoryItemRenderer renderer = new CustomRenderer(c);
          renderer.setSeriesOutlinePaint(0, Color.black);
          renderer.setSeriesOutlineStroke(0, new BasicStroke(0.5f));
          renderer.setSeriesPaint(0,c);
          plot.setRenderer(renderer);
  
          NumberAxis range = (NumberAxis)plot.getRangeAxis();  
          range.setTickUnit(new NumberTickUnit(60));  
  
          return chart;    
      }
  </code></pre>