I am creating a lineChart using ios-charts API in Swift language. On the xAxis there are dates in mm.dd-day format, for example 03.02-Wednesday. On the yAxis there are double values.I want to show on xAxis every monday and nothing else. The best solution what I found so far is
lineChart.xAxis.setLabelsToSkip(6)
This skip 6 label but it is working just if the chart datas start with a date which is Monday. Like here: what I want
But if my chart values start with Tuesday, I will see just Tuesday labels.: what is not good
I had many ideas what should I do, but I couldn't find solution for it. I am wondering if there is a function, what can set every label on xAxis one-by-one, so i can iter with a for loop on xAxis.values and set label visible if it's Monday and skip if it's not Monday. Something like this:
pseudo:
for i in lineChart.xAxis.values{
if isMonday(){
//set label visible
}else{
//set label invisible
}}
But I will really thanksful for every other solution for my problem. I have already tried to use this, but it didn't change label:
lineChartView.xAxis.valueFormatter?.stringForXValue(i, original: "Monday", viewPortHandler: cell.lineChartView.viewPortHandler)
I've tried to use setValueForKey, but I don't have keys, just indexes, and I thinking about to start setLabelsToSkip from an exact x value, but this function used for the whole chart.
Thank you very much for your help.