title: How to make JavaFX Chart NumberAxis only show Integer value，not double
body: <p>I'm trying to create a chart who's yAxis is designed to show number of employee number, so it must only show whole numbers.<br>
  But I found it's not that easy as I already tried to <strong>yAxis.setTickUnit(1)</strong> but it won't work when the values are small(etc. the max value is 3, it'll still show 0.5,1.5..., I only want tick value like 1,2,3,4..)<br>
  How Could I to achieve this?   </p>
  
  <p>According to @jewelsea 's answer, I tried this(In javafx 2.2 jdk7)</p>
  
  <pre><code>class IntegerStringConverter extends StringConverter&lt;Number&gt;{
  
      public IntegerStringConverter() {
      }
  
      @Override
      public String toString(Number object) {
          if(object.intValue()!=object.doubleValue())
              return "";
          return ""+(object.intValue());
      }
  
      @Override
      public Number fromString(String string) {
          Number val = Double.parseDouble(string);
          return val.intValue();
      }
  }  
  </code></pre>
  
  <p>It's result is kind of acceptable. Double value's are gone, but there ticks are still there.<br>
  <img src="https://i.stack.imgur.com/aAx8A.png" alt="double values gone but ticks are still there"></p>