user462990
user462990

Reputation: 5532

IOS-Charts cannot show any x-axis labels in a line chart

(Hopefully simple question) How do I get X-axis labels to show. I want four words to show in a line chart with multiple plots.

The plots and everything else works beautifully!

Upvotes: 2

Views: 1794

Answers (1)

izerik
izerik

Reputation: 147

You need to specify the x-axis labels title when you create the LineChartData object:

let chartData = LineChartData(xVals: labels, dataSet: dataSet)
chartView.data = chartData

The xVals parameter is the x-axis label title array.

You can check out how it's done in the example project: https://github.com/danielgindi/ios-charts, ChartsDemo folder

Upvotes: 0

Related Questions