Note that there are some explanatory texts on larger screens.

plurals
  1. POCorePlot: Automatic labeling policy for Date
    primarykey
    data
    text
    <p>I am using CorePlot for an iPhone app. My x-axis consists of dates. I set my refDate like this:</p> <pre><code>NSDateComponents *dateComponents = [[NSDateComponents alloc]init]; [dateComponents setHour:12]; [dateComponents setMinute:0]; [dateComponents setSecond:0]; NSCalendar *gregorian = [[NSCalendar alloc]initWithCalendarIdentifier:NSGregorianCalendar]; NSDate *refDate = [gregorian dateFromComponents:dateComponents]; NSDateFormatter *dateFormater = [[NSDateFormatter alloc]init]; [dateFormater setDateFormat:@"HH:mm"]; CPTTimeFormatter *timeFormater = [[CPTTimeFormatter alloc]initWithDateFormatter:dateFormater]; timeFormater.referenceDate = refDate; </code></pre> <p>and I set the x-axis like this:</p> <pre><code>CPTXYAxisSet *axisSet = (CPTXYAxisSet *)graph.axisSet; CPTXYAxis *x = axisSet.xAxis; x.majorGridLineStyle = majorXGridLineStyle; x.majorIntervalLength = CPTDecimalFromFloat(oneHour * 4); x.minorTicksPerInterval = 3; x.labelFormatter = timeFormater; </code></pre> <p>When I don't use the automatic labeling policy the graph looks like this: <img src="https://i.stack.imgur.com/FWzDx.png" alt="enter image description here"></p> <p>Which is fine, but when I zoom in I'd love to have the automatic labeling feature. So when I enable it:</p> <pre><code>x.labelingPolicy = CPTAxisLabelingPolicyAutomatic; </code></pre> <p>I get these results:</p> <p><img src="https://i.stack.imgur.com/9txmS.png" alt="enter image description here"></p> <p>Is there a way to combine my values with the ones form the automatic labeling policy?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload