my code bar chart shown below: override func viewdidload() { super.viewdidload() ibviewgarph.delegate = self months = ["jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"] let unitssold = [1200.0, 1400.0, 600.0, 3500.0, 1200.0, 1600.0, 1400.0, 1800.0, 1200.0, 1400.0, 1500.0, 1400.0] setchart(months, values: unitssold) } func setchart(datapoints: [string], values: [double]) { ibviewgarph.leftaxis.axisminvalue = 500 ibviewgarph.leftaxis.axismaxvalue = 3500 var dataentries: [barchartdataentry] = [] in 0..<datapoints.count { let dataentry = barchartdataentry(value: values[i], xindex: i) dataentries.append(dataentry) } let chartdataset = barchartdataset(yvals: dataentries, label: "units sold") ...