Cut empty space on xAxis (iOS)


#1

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

This is example image

https://www.dropbox.com/s/ca7z09axssaii4u/Help%20Image%202.PNG?dl=0


#2

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.

Thanks,
Jan


#3

Hi. 

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

#4

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:

Jan


#5

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.

Jan


#6

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