title: How to set LineChartView's x axis values
body: <p>I'm using the <a href="https://github.com/danielgindi/Charts" rel="nofollow noreferrer">Swift Charts API</a> to plot data taken with the iOS accelerometer. I simply need to plot the acceleration values on the y axis, and the time values on the x axis. </p>
  
  <p>I managed to draw a line chart by providing the x and y values:</p>
  
  <pre><code>    lineChartView.delegate = self
      lineChartView.descriptionText = "Acceleration/Time"
      lineChartView.descriptionTextColor = UIColor.blackColor()
      lineChartView.gridBackgroundColor = UIColor.greenColor()
  
      let allData = ActivityData.getByActivitiesId(activity.id)
  
      var xVals = [String]()
      var yVals = [ChartDataEntry]()
  
      let formatter = NSNumberFormatter()
      formatter.numberStyle = .DecimalStyle
      formatter.maximumFractionDigits = 2
      formatter.maximumIntegerDigits = 3
  
      var i = 0;
      for data in allData
      {
          let entry = ChartDataEntry(value: data.xUserAcc, xIndex: i)
          yVals.append(entry)
          xVals.append(formatter.stringFromNumber(NSNumber(double:data.time))!)
          print(data.time)
          i += 1
      }
  
      let set1 = LineChartDataSet(yVals: yVals, label: "xAcc")
      set1.axisDependency = .Left
      set1.setColor(UIColor.redColor())
      set1.setCircleColor(UIColor.redColor()) // our circle will be dark red
      set1.lineWidth = 2.0
      set1.circleRadius = 6.0 // the radius of the node circle
      set1.fillAlpha = 65 / 255.0
      set1.fillColor = UIColor.redColor()
      set1.highlightColor = UIColor.whiteColor()
      set1.drawCircleHoleEnabled = true
  
      let lineChartData = LineChartData(xVals: xVals, dataSets: [set1])
      lineChartData.setValueTextColor(UIColor.blackColor())
      lineChartView.data = lineChartData
  </code></pre>
  
  <p>But the problem is that x axis values are just used as labels to be shown on the x axis, but the intervals are not based on the actual x values that I provide. Let's explain this better with an image:  </p>
  
  <p><a href="https://i.stack.imgur.com/BkmL6.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BkmL6.jpg" alt="enter image description here"></a> </p>
  
  <p>Like you see the values on the x are 3.89, 3.93 and 3.94. And they're shown at equal distance on the x axis even if between 3.89 and 3.93 there's a 0.04 gap, which is 4 times the gap between the second and third value. When I take data with the accelerometer I can't get it at a constant rate, so I need to specify the x values to the LineChartView but so far I couldn't find a way. </p>