title: How to add graph view in android using Kotlin?
body: <p>Following is a simple graph view code that i tried in Kotlin. But it doesn't work properly. App crashes while running .</p>
  
  <pre><code> `lateinit var series: LineGraphSeries&lt;DataPoint&gt;
   var x : Double = 0.0;  var y : Double = 0.0`
  </code></pre>
  
  <p>oncreate</p>
  
  <pre><code>var graphview : GraphView = findViewById(R.id.graphview) as GraphView
  
          series = LineGraphSeries&lt;DataPoint&gt;()
  
  
          x = -0.5
  
          for (i in 0..500)
          {
              x += 0.1
              y = Math.sinh(x)
              series.appendData(DataPoint(x,y), true, 500)
          }
  
  
          graphview.addSeries(series)
  </code></pre>
  
  <p>Error Log</p>
  
  <pre><code> FATAL EXCEPTION: main
                                                                                     Process: com.example.sarath.mykotinapplication, PID: 18986
                                                                                     java.lang.OutOfMemoryError: Failed to allocate a 1073741836 byte allocation with 13311040 free bytes and 172MB until OOM
                                                                                         at java.util.HashMap.inflateTable(HashMap.java:287)
                                                                                         at java.util.HashMap.put(HashMap.java:419)
                                                                                         at com.jjoe64.graphview.GridLabelRenderer.adjustVertical(GridLabelRenderer.java:791)
                                                                                         at com.jjoe64.graphview.GridLabelRenderer.adjustSteps(GridLabelRenderer.java:932)
                                                                                         at com.jjoe64.graphview.GridLabelRenderer.draw(GridLabelRenderer.java:1067)
                                                                                         at com.jjoe64.graphview.GraphView.drawGraphElements(GraphView.java:299)
                                                                                         at com.jjoe64.graphview.GridLabelRenderer.draw(GridLabelRenderer.java:1062)
                                                                                         at com.jjoe64.graphview.GraphView.drawGraphElements(GraphView.java:299)
                                                                                         at com.jjoe64.graphview.GraphView.onDraw(GraphView.java:323)
                                                                                         at android.view.View.draw(View.java:17077)
                                                                                         at android.view.View.updateDisplayListIfDirty(View.java:16059)
                                                                                         at android.view.View.draw(View.java:16843)
                                                                                         at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
                                                                                         at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
                                                                                         at android.view.View.updateDisplayListIfDirty(View.java:16054)
                                                                                         at android.view.View.draw(View.java:16843)
                                                                                         at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
                                                                                         at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
                                                                                         at android.view.View.updateDisplayListIfDirty(View.java:16054)
                                                                                         at android.view.View.draw(View.java:16843)
                                                                                         at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
                                                                                         at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
                                                                                         at android.view.View.updateDisplayListIfDirty(View.java:16054)
                                                                                         at android.view.View.draw(View.java:16843)
                                                                                         at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
                                                                                         at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
                                                                                         at android.view.View.updateDisplayListIfDirty(View.java:16054)
                                                                                         at android.view.View.draw(View.java:16843)
                                                                                         at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
                                                                                         at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
                                                                                         at android.view.View.updateDisplayListIfDirty(View.java:16054)
                                                                                         at android.view.View.draw(View.java:16843)
                                                                                         at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
                                                                                         at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
                                                                                         at android.view.View.draw(View.java:17080)
                                                                                         at com.android.internal.policy.DecorView.draw(DecorView.java:751)
                                                                                         at android.view.View.updateDisplayListIfDirty(View.java:16059)
                                                                                         at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:656)
                                                                                         at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:662)
                                                                                         at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:770)
                                                                                         at android.view.ViewRootImpl.draw(ViewRootImpl.java:2841)
                                                                                         at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2649)
                                                                                         at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2256)
                                                                                         at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1291)
                                                                                         at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6357)
                                                                                         at android.view.Choreographer$CallbackRecord.run(Choreographer.java:873)
                                                                                         at android.view.Choreographer.doCallbacks(Choreographer.java:685)
                                                                                         at android.view.Choreographer.doFrame(Choreographer.java:621)
                                                                                         at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:859)
                                                                                         at android.os.Handler.handleCallback(Handler.java:751)
                                                                                         at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                         at android.os.Looper.loop(Looper.java:154)
                                                                                         at android.app.ActivityThread.main(ActivityThread.java:6195)
                                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:874)
                                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764)
  </code></pre>
  
  <p>08-21 10:56:32.022 18986-18986/com.example.sarath.mykotinapplication E/MQSEventManagerDelegate: failed to get MQSService.</p>
  
  <p>Is there any code error? Its a part of study, Expecting suggestions about kotlin  from experts </p>