title: Formatting Dates on x-axis in MPAndroidChart
body: <p>I'm using <a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow noreferrer">MPAndroidChart</a> and I know this topic is covered quite a bit in the <a href="https://github.com/PhilJay/MPAndroidChart/wiki/The-AxisValueFormatter-interface" rel="nofollow noreferrer">docs</a>, so apologies if I've missed something obvious, but I'm having a bit of trouble formatting timestamp values into dates on the x-axis of my Linechart. </p>
  
  <p>It appears that getFormattedValue() isn't being invoked for my x-axis value for whatever reason. If i debug AxisBase, it only seems to looking to format the y-axis values, which i do not have a custom formatter set on. </p>
  
  <p>Here is the code snippets, taken mostly from the Github docs:</p>
  
  <pre><code>          LineChart chart = (LineChart) findViewById(R.id.chart);
            XAxis xAxis = chart.getXAxis();
  
            // set min timestamp to Jul 2017 
            HourAxisValueFormatter(Long.parseLong("1499814559"));
  
            xAxis.setValueFormatter(new IAxisValueFormatter() {
               // THIS IS NEVER INVOKED!
              @Override
              public String getFormattedValue(float value, AxisBase axis) 
              {
                  return new Date(Long.parseLong(""+value)).toString();
              }
          });
  
          // rating is a map of timestamp to numeric value, both stored 
          // as strings
          for (Map.Entry&lt;String, String&gt; rating : ratings.entrySet()) {
              String timestamp = rating.getKey();
              String ratingValue = rating.getValue();
              entries.add(new Entry(Float.parseFloat(timestamp), 
              Float.parseFloat(ratingValue)));
          }
  
              // add entries to dataset
              LineDataSet dataSet = new LineDataSet(entries, "Ratings");
              LineData lineData = new LineData(dataSet);
              chart.setData(lineData);
              chart.invalidate(); // refresh'
  </code></pre>
  
  <p>I'm using version 3.0.2 of the library:</p>
  
  <p><code>compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'</code></p>
  
  <p>Thanks in advance, Gary</p>
  
  <p>EDIT per request for desired output/actual output: 
  Ideally i would have a series of dates along the x-axis , e.g. 10/7, 11/8, 12/8, etc. constructed from the Epoch values I've provided. I know the code above wont format it in that format as it stands, but just want to get it formatting to any date value initially (so ignore that for now), the crux of the issue is that my formatter isn't getting invoked at all.</p>
  
  <p>Below is a screenshot of the current output, it only prints a single value on the x=0 line (note even though there are multiple y values being provided, i wonder if they are all on the same x=0 line does it just draw the last point or something?):</p>
  
  <p><a href="https://i.stack.imgur.com/N36Yr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N36Yr.png" alt="enter image description here"></a> </p>
  
  <p>Debugging the timestamp values above, Float.parseFloat(timestamp) is equal to 1.50516885e^12. The actual timestamp value for example is 1505168846751, but after parsing to a Float is rounded, and given an exponent value. </p>
  
  <p>EDIT 2 : </p>
  
  <p>Screen grab of the values supplied as 'entries' to the LineDataSet:</p>
  
  <p><a href="https://i.stack.imgur.com/GIFZb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GIFZb.png" alt="enter image description here"></a></p>
  
  <p>EDIT 3: 
  The issue appears to be to do with the size/format of the timestamp values for the x-values I'm providing, changing these to small float values in the range 1.0 -> 20.0f, causes the formatter to be invoked as expected. I need to debug the code further to see why the exponential timestamp values are not being formatted. </p>