I am trying to draw a line chart but I am not able to get a line. Everything else seem to be responding to my data i.e. axis scale, label color etc.
Am I doing something wrong or is this a bug?
var dataEntries: [ChartDataEntry] = []
for i in 1...5 {
let dataEntry = ChartDataEntry(x: Double(i), y: Double(i))
dataEntries += [dataEntry]
}
let chartDataset = LineChartDataSet(values: dataEntries, label: "Test")
var datasets = [IChartDataSet]()
datasets += [chartDataset]
let chartData = ChartData(dataSets: datasets)
chartView.data = chartData
modify
var datasets = LineChartDataSet
datasets += [chartDataset]
let chartData = LineChartData(dataSets: datasets)
chartView.data = chartData
That still does not solve the problem. No line in the graph, but doing debugging it seems that the data is in "chartData"
Sorry....me being a newbie messing up the different data types.
For other people who have same problem: (Line not showing, Line disappearing on zoom)
#Make sure your xAxis data is ordered.
Most helpful comment
For other people who have same problem: (Line not showing, Line disappearing on zoom)
#Make sure your xAxis data is ordered.