X-axis does not show the tick values


#1

I am using the below DataTimeAxis to plot the x-axis. However the x-axis does not show any of the default tick values . When  I plot the graph I am hoping to see at least the pre-defined points, however nothing comes up . The x -axis has not predefined points at all :frowning:

 SChartDateRange *range = [[SChartDateRangealloc] initWithDateMinimum:month.startDateOfMonthandDateMaximum:month.endDateOfMonth];

    SChartDateTimeAxis *xAxis = [[SChartDateTimeAxisalloc] initWithRange:range];

    NSDateFormatter *dayFormatter = [[NSDateFormatteralloc] init];

    [dayFormatter setDateFormat:@“MMM d”];

 SChartTickLabelFormatter *formatter = [SChartTickLabelFormatterdateFormatter];

    [formatter setFormatter:dayFormatter];

    xAxis.labelFormatter = formatter;

    xAxis.rangePaddingLow = [SChartDateFrequencydateFrequencyWithDay:1];

    xAxis.rangePaddingHigh = [SChartDateFrequencydateFrequencyWithDay:1];

    xAxis.style.majorGridLineStyle.showMajorGridLines = NO;

    xAxis.style.gridStripeStyle.showGridStripes = NO;

    xAxis.style.titleStyle.position = SChartTitlePositionTopOrRight;

    xAxis.minorTickFrequency = [SChartDateFrequencydateFrequencyWithDay:1];

    xAxis.majorTickFrequency = [SChartDateFrequencydateFrequencyWithDay:1];

   // xAxis.majorTickFrequency = [[SChartDateFrequency alloc] initWithDay:2];  xAxis.style.majorTickStyle.showTicks=YES;

    _shinobiChart.xAxis = xAxis;


#2

Hi Sim777,

I’m afraid I can’t reproduce your issue using the code you’ve supplied. Could you clarify what you’re trying to do? Is it to display tick marks or are the tick labels not appearing for you?

Also, please note that if you set an explicit range (like you have using [[SChartDateTimeAxis alloc] initWithRange:range]), then your values you’ve set for range padding will be ignored.

Sam