title: MPAndroidChart time chart x-axis does not show all values
body: <p>I am developing an app in which I have used <a href="https://github.com/PhilJay/MPAndroidChart" rel="nofollow noreferrer">MPAndroidChart</a>. It shows certain values against a particular month. The data is like this: </p>
  
  <pre><code>1430418600000, 130.279999\n1433097000000, 125.43\n1435689000000, 121.300003\n1438540200000, 112.760002\n1441045800000, 110.300003\n1443637800000, 119.50\n1446402600000, 118.300003\n1448908200000, 105.260002\n1451845800000, 97.339996\n1454265000000, 96.690002\n1456770600000, 108.989998\n1459449000000, 93.739998\n1462127400000, 99.860001\n1464719400000, 95.599998\n1467311400000, 104.209999\n1469989800000, 106.099998\n1472668200000, 113.050003\n1475433000000, 113.540001\n1477938600000, 110.519997\n1480530600000, 115.82\n1483381800000, 121.349998\n1485887400000, 136.990005\n1488306600000, 143.660004\n1491157800000, 143.649994
  </code></pre>
  
  <p>Now the <code>Y-Axis</code> is showing the max and min points as provided but x axis is showing just 6 points.</p>
  
  <p>Chart initializing code:</p>
  
  <pre><code>Cursor cursor = getContentResolver().query(Contract.Quote.makeUriForStock(quote_symbol),
              Contract.Quote.QUOTE_COLUMNS.toArray(new String[]{}),
              null, null, Contract.Quote.COLUMN_SYMBOL);
  
  if(cursor!=null)
  {
      cursor.moveToNext();
  }
  chart = (LineChart) findViewById(R.id.chart);
  
  // no description text
  chart.getDescription().setEnabled(false);
  
  // enable touch gestures
  chart.setTouchEnabled(true);
  
  chart.setDragDecelerationFrictionCoef(0.9f);
  
  // enable scaling and dragging
  chart.setDragEnabled(true);
  chart.setScaleEnabled(false);
  chart.setDrawGridBackground(false);
  chart.setHighlightPerDragEnabled(true);
  
  // set an alternative background color
  chart.setBackgroundColor(Color.WHITE);
  chart.setViewPortOffsets(0f, 0f, 0f, 0f);
  chart.setScaleXEnabled(true);
  
  ;
  // set data
  chart.setData(prepareLineData(cursor));
  
  // do not forget to refresh the chart
  chart.invalidate();
  chart.animateX(750);
  </code></pre>
  
  <p>Preparing the chart data:</p>
  
  <pre><code>private LineData prepareLineData(Cursor cursor)
  {
      String historyData=cursor.getString(cursor.getColumnIndex(Contract.Quote.COLUMN_HISTORY));
      String maxValueString=cursor.getString(cursor.getColumnIndex(Contract.Quote.COLUMN_HISTORY_MAX_VALUE));
      String maxDateString=cursor.getString(cursor.getColumnIndex(Contract.Quote.COLUMN_HISTORY_MAX_DATE));
      String minValueString=cursor.getString(cursor.getColumnIndex(Contract.Quote.COLUMN_HISTORY_MIN_VALUE));
      String minDateString=cursor.getString(cursor.getColumnIndex(Contract.Quote.COLUMN_HISTORY_MIN_DATE));
  
      String[] historyDataArray=historyData.split("\n");
      ArrayList&lt;Entry&gt; e1 = new ArrayList&lt;&gt;();
  
      for (int i = 0; i &lt; historyDataArray.length; i++) {
          String[] historyDataValues=historyDataArray[i].split(",");
          e1.add(new Entry(Float.parseFloat(historyDataValues[0]), Float.parseFloat(historyDataValues[1])));
      }
  
      Typeface mTf = Typeface.createFromAsset(this.getAssets(), "OpenSans-Regular.ttf");
  
  
      XAxis xAxis = chart.getXAxis();
      xAxis.setPosition(XAxis.XAxisPosition.BOTTOM_INSIDE);
      xAxis.setTypeface(mTf);
      xAxis.setTextSize(10f);
      xAxis.setTextColor(Color.WHITE);
      xAxis.setDrawAxisLine(false);
      xAxis.setDrawGridLines(true);
      xAxis.setTextColor(Color.rgb(255, 192, 56));
      xAxis.setCenterAxisLabels(true);
      xAxis.setAxisMaximum(Float.parseFloat(maxDateString));
      xAxis.setAxisMinimum(Float.parseFloat(minDateString));
      xAxis.setAvoidFirstLastClipping(true);
      xAxis.setValueFormatter(new IAxisValueFormatter() {
          private SimpleDateFormat mFormat = new SimpleDateFormat("MMM,yy");
          @Override
          public String getFormattedValue(float value, AxisBase axis) {
              return mFormat.format(new Date((long) value));
          }
      });
      YAxis leftAxis = chart.getAxisLeft();
      leftAxis.setPosition(YAxis.YAxisLabelPosition.INSIDE_CHART);
      leftAxis.setTypeface(mTf);
      leftAxis.setTextColor(ColorTemplate.getHoloBlue());
      leftAxis.setDrawGridLines(false);
      leftAxis.setGranularityEnabled(true);
      leftAxis.setAxisMinimum(0f);
      leftAxis.setAxisMaximum(Float.parseFloat(maxValueString)); 
      leftAxis.setTextColor(Color.rgb(255, 192, 56));
      YAxis rightAxis = chart.getAxisRight();
      rightAxis.setEnabled(false);
      LineDataSet d1 = new LineDataSet(e1, "Price");
      d1.setLineWidth(2.5f);
      d1.setAxisDependency(YAxis.AxisDependency.LEFT);
      d1.setHighLightColor(Color.rgb(244, 117, 117));
      d1.setDrawValues(false);
      ArrayList&lt;ILineDataSet&gt; sets = new ArrayList&lt;&gt;();
      sets.add(d1);
      return new LineData(sets);
  }
  </code></pre>