Cut empty space on xAxis (iOS)


Is it posible to cut empty space on xAxis?
And how can i do it?

This is example image


You’ll want to look into the SChartDiscontinuousTimeSeries axis. Here’s a link to the documentation. We’ve also go a second about how to use this series type in our user guide.




First of all - thank you for your reply.

I have known about SChartDiscontinuousTimeSeries - but it didn’t worked for me because of my mistake:

i have used @“dd-MM-yyyy” date format like in TimeSeries.xcodeproject - but my datasource was @“yyyy-MM-dd HH:mm:ss ZZZ”.

Now it’s working!

BUT! There is a very interesting moment. My datasource date range is from 01.01.2014 till 31.12.2014 - so i try:

SChartDiscontinuousDateTimeAxis *xAxis = [[SChartDiscontinuousDateTimeAxisalloc] init];
SChartRepeatedTimePeriod *weekends = [[SChartRepeatedTimePeriodalloc] initWithStart:[selfdateFromString:@"2010-01-01 00:00:00 +0000"] andLength:[SChartDateFrequencydateFrequencyWithDay:2] andFrequency:[SChartDateFrequencydateFrequencyWithWeek:1]];
 [xAxis addExcludedRepeatedTimePeriod:weekends];

_chart.xAxis = xAxis; and it DOESN'T WORK! BUT! When i change @"2010-01-01 00:00:00 +0000" to @"2000-01-01 00:00:00 +0000" it starts working like a charm. Why? I don't know. May be magic...) Thanks, Artsiom


Hmm, I don’t know off the top of my head. I’ll find some time to look into this and get back to you!  :laughing:



I’m not entirely sure what you mean by “doesn’t work”, but I’ll assume you mean it’s not skipping the correct dates?

To skip weekends the start date should be 00:00:00 on a Saturday with a length of 2 days and frequency of 1 week (as you’ve done). This should explain why 2010-01-01 does not work due to it being a Friday, whereas 2000-01-01 is a Saturday, therefore solving your issue :).

Hope that clears up everything! Please let us know if you’ve got any further questions.



Thank you! Now i understand where is my mistake :slight_smile: