title: Set Date format on X axis in MPChart
body: <p>Here try to set Date on x axis.i am passing <strong><em>Unix timestamps</em></strong> to Entry point of <strong>LineChart</strong> but not get output not able to right result in output.</p>
  
  <p>Turns out, since the Entries use floats, I was losing precision on my timestamps... enough to mess up the intervals between labels on the x axis.
  <a href="https://i.stack.imgur.com/xsbwo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xsbwo.png" alt="enter image description here"></a> </p>
  
  <p>Code here</p>
  
  <pre><code> mChart.getDescription().setEnabled(false);
      mChart.setTouchEnabled(true);
      mChart.setDragDecelerationFrictionCoef(0.5f);
      mChart.setDragEnabled(true);
      mChart.setScaleEnabled(true);
      mChart.setDrawGridBackground(false);
      mChart.setHighlightPerDragEnabled(false);
      mChart.setBackgroundColor(Color.WHITE);
      mChart.setViewPortOffsets(0f, 0f, 0f, 0f);
      MonthPriceGraph = new ArrayList&lt;&gt;();
      final ArrayList&lt;String&gt; Xdate = new ArrayList&lt;&gt;();
  
      MonthPriceGraph = dataBaseManager.getPrice(Contants.getSymbol());
      if (MonthPriceGraph.size() != 0) {
          ArrayList&lt;Entry&gt; values = new ArrayList&lt;Entry&gt;();
          for (int i = 0; i &lt; MonthPriceGraph.size(); i++) {
  
              Xdate.add(MonthPriceGraph.get(i).getCoinCCTime());
              long t = Long.parseLong(MonthPriceGraph.get(i).getCoinCCTime());
              Log.e(TAG, "Time is: " + MonthPriceGraph.get(i).getCoinCCTime());
              float yValue = Float.parseFloat(MonthPriceGraph.get(i).getCoinCCPrice());
              values.add(new Entry(Float.parseFloat(MonthPriceGraph.get(i).getCoinCCTime()), yValue));
          }
  
          LineDataSet set1 = new LineDataSet(values, "ETH");
          set1.setAxisDependency(YAxis.AxisDependency.LEFT);
  
          set1.setColor(Color.BLUE);
          set1.setValueTextColor(Color.BLUE);
          set1.setLineWidth(2.5f);
          set1.setDrawCircles(true);
          set1.setDrawFilled(true);
          set1.setDrawValues(false);
          set1.setCircleColor(getActivity().getResources().getColor(R.color.blue));
          set1.setFillColor(getActivity().getResources().getColor(R.color.gry_color));
          set1.setHighLightColor(Color.rgb(0, 0, 255));
          set1.setDrawCircleHole(false);
          LineData data = new LineData(set1);
          data.setValueTextColor(Color.BLACK);
          data.setValueTextSize(5f);
          // set data
          mChart.setData(data);
          mChart.invalidate();
          Legend l = mChart.getLegend();
          l.setEnabled(false);
          XAxis xAxis = mChart.getXAxis();
          xAxis.setPosition(XAxis.XAxisPosition.BOTTOM_INSIDE);
          Typeface tf = Typeface.createFromAsset(getActivity().getAssets(), "fonts/worksenslight.ttf");
          xAxis.setTypeface(tf);
          xAxis.setTextSize(12f);
          xAxis.setAvoidFirstLastClipping(true);
          xAxis.setTextColor(Color.BLUE);
          xAxis.setDrawAxisLine(true);
          xAxis.setDrawGridLines(true);
          xAxis.setTextColor(Color.rgb(0, 0, 0));
          xAxis.setCenterAxisLabels(false);
          xAxis.setValueFormatter(new IAxisValueFormatter() {
  
              private SimpleDateFormat mFormat = new SimpleDateFormat("dd MMM,yyyy");
  
              @Override
              public String getFormattedValue(float value, AxisBase axis) {
  
                  Date s = new Date((long) (value * 1000L));
                  return mFormat.format(s);
              }
          });
          YAxis leftAxis = mChart.getAxisLeft();
          leftAxis.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART);
          leftAxis.setTypeface(tf);
          leftAxis.setTextSize(12f);
          leftAxis.setTextColor(ColorTemplate.getHoloBlue());
          leftAxis.setDrawGridLines(true);
          leftAxis.setGranularityEnabled(false);
          leftAxis.setAxisMinimum(8000);
          leftAxis.setAxisMaximum(12000);
  
          leftAxis.setYOffset(-9f);
          leftAxis.setTextColor(Color.rgb(0, 0, 0));
          YAxis rightAxis = mChart.getAxisRight();
          rightAxis.setEnabled(false);
          rightAxis.setEnabled(false);
  </code></pre>
  
  <p>how solve this problem.
  wrong output getting as share the Image. 
  First Date is : 
  8 Aug 2017
  12 Aug 2017 </p>
  
  <p>like this pattern want to show images</p>