title: MPAndroidChart adding setData compiler error
body: <p>I am trying to create a line graph using MPAndroidChart.  I have looked at many examples online and they all seem to suggest that you add data to a chart like this:</p>
  
  <pre><code>    LineChart graph = (LineChart) view.findViewById(R.id.chart);
  
      // creating list of entry
      ArrayList&lt;Entry&gt; entries = new ArrayList&lt;&gt;();
      entries.add(new Entry(4f, 0));
      entries.add(new Entry(8f, 1));
      entries.add(new Entry(6f, 2));
      entries.add(new Entry(2f, 3));
      entries.add(new Entry(18f, 4));
      entries.add(new Entry(9f, 5));
  
      // creating labels
      ArrayList&lt;String&gt; labels = new ArrayList&lt;String&gt;();
      labels.add("January");
      labels.add("February");
      labels.add("March");
      labels.add("April");
      labels.add("May");
      labels.add("June");
  
      graph.setData(entries, labels);
  </code></pre>
  
  <p>But I get a compiler error on setData saying:</p>
  
  <blockquote>
    <p>setData (com.github.mikephil.charting.data.LineData) in Chart cannot
    be applied to
    (java.util.ArrayList,
    java.util.ArrayList)</p>
  </blockquote>
  
  <p>I can fix the compiler error by changing my code to:</p>
  
  <pre><code>LineDataSet dataSet = new LineDataSet(entries, "# of Calls");
  LineData lineData = new LineData(dataSet);
  
  graph.setData(lineData);
  </code></pre>
  
  <p>But then I get this run time error:</p>
  
  <blockquote>
    <p>FATAL EXCEPTION: main
                                                                      Process: com.ebucher.lisa, PID: 11365
                                                                      java.lang.NegativeArraySizeException: -2
                                                                          at com.github.mikephil.charting.utils.Transformer.generateTransformedValuesLine(Transformer.java:181)
                                                                          at com.github.mikephil.charting.renderer.LineChartRenderer.drawValues(LineChartRenderer.java:570)
                                                                          at com.github.mikephil.charting.charts.BarLineChartBase.onDraw(BarLineChartBase.java:272)
                                                                          at android.view.View.draw(View.java:17469)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16464)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.draw(View.java:17472)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16464)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16459)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1373)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16459)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16459)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16459)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16459)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16459)
                                                                          at android.view.View.draw(View.java:17238)
                                                                          at android.view.ViewGroup.drawChild(ViewGroup.java:3921)
                                                                          at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3711)
                                                                          at android.view.View.draw(View.java:17472)
                                                                          at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:3205)
                                                                          at android.view.View.updateDisplayListIfDirty(View.java:16464)
                                                                          at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:325)
                                                                          at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:331)
                                                                          at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:366)
                                                                          at android.view.ViewRootImpl.draw(ViewRootImpl.java:3134)
                                                                          at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2933)
                                                                          at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2522)
                                                                          at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1437)
                                                                          at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7397)
                                                                          at android.view.Choreographer$CallbackRecord.run(Choreographer.java:920)
                                                                          at android.view.Choreographer.doCallbacks(Choreographer.java:695)
                                                                          at android.view.Choreographer.doFrame(Choreographer.java:631)
                                                                          at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:906)
                                                                          at android.os.Handler.handleCallback(Handler.java:739)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                          at android.os.Looper.loop(Looper.java:158)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)</p>
  </blockquote>
  
  <p>I get the same errors when I try to create a bar graph instead of a line graph.</p>