Hi everyone.
Problem: I'm trying to get my xAxis to show on the month from the NSdate that I obtained.
Desired output: Under each bar, it will show "Jan", "Feb", "Mar" etc... according to the event time.
I read throught serveral thread and tried the methods but none is of any help. I understand that I should post a question when I hit the wall and I have just hit it :( been trying out this for a few days.
Here are the resources I tried.
This is my current code for the chart
The chart itself is also set to the follow:
utilitiesBarChart = [[ShinobiChartalloc] initWithFrame:CGRectInset(cell.bounds, margin, margin) withPrimaryXAxisType:SChartAxisTypeDateTimewithPrimaryYAxisType:SChartAxisTypeNumber]; And this is my code for xvalueThis is the error
My chart continue to show in epoch time :(
any help would be awesome :D
Thank you people
I have a similar barchart with a date/time x-axis. Here is how I created the x-axis to show dates like "Jun 3":
// x-axis
_xAxis = [[SChartDateTimeAxis alloc] init];
_xAxis.style.lineColor = [UIColor colorWithWhite:0.5f alpha:1.0f];
_xAxis.style.lineWidth = @1;
_xAxis.style.majorTickStyle.showLabels = YES;
_xAxis.style.majorTickStyle.labelFont = [UIFont systemFontOfSize:9];
_xAxis.style.majorTickStyle.labelColor = [UIColor colorWithWhite:0.5f alpha:1.0f];
_xAxis.style.majorTickStyle.showTicks = YES;
_xAxis.style.majorTickStyle.lineWidth = @(1);
_xAxis.style.majorTickStyle.lineColor = COLOR_BACKGROUND;
_xAxis.labelFormatString = @"MMM d";
You can optionally implement the delegate to do additional formatting (like making the string uppercase in my case):
-(void)sChart:(ShinobiChart *)chart alterTickMark:(SChartTickMark *)tickMark beforeAddingToAxis:(SChartAxis *)axis {
tickMark.tickLabel.text = [tickMark.tickLabel.text uppercaseString];
}