title: Combined Chart (line- and bar chart) using iOS-Charts
body: <p>I am trying to combine a line- and bar chart in swift (iOS-charts). Both the x- and the y-axis seem to be scaled properly, but the data is not showing on the chart. What am I missing?<a href="https://i.stack.imgur.com/yt7Gt.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yt7Gt.png" alt="enter image description here"></a></p>
  
  <pre><code>import UIKit
  import Charts
  
  class CombinedChartsTest: UIViewController {
  
  
  @IBOutlet weak var combinedChart: CombinedChartView!
  
  
  let months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
  let unitsSold = [2.0, 4.0, 6.0, 3.0, 12.0, 16.0, 4.0, 17.0, 2.0, 4.0, 5.0, 4.0]
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      setChart(months, yValuesLineChart:  unitsSold, yValuesBarChart: unitsSold)
  }
  
  func setChart(xValues: [String], yValuesLineChart: [Double], yValuesBarChart: [Double]) {
      combinedChart.noDataText = "Please provide data for the chart."
  
      var yVals1 : [ChartDataEntry] = [ChartDataEntry]()
      var yVals2 : [BarChartDataEntry] = [BarChartDataEntry]()
  
      for i in 0..&lt;xValues.count {
  
          yVals1.append(ChartDataEntry(value: yValuesLineChart[i], xIndex: i))
          yVals2.append(BarChartDataEntry(value: yValuesBarChart[i] - 1, xIndex: i))
  
      }
  
      let lineChartSet = LineChartDataSet(yVals: yVals1, label: "Line Data")
      let barChartSet: BarChartDataSet = BarChartDataSet(yVals: yVals2, label: "Bar Data")
  
      let data: CombinedChartData = CombinedChartData(xVals: xValues, dataSets: [lineChartSet,barChartSet])
  
      combinedChart.data = data
  
  }
  }
  </code></pre>