Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks like you're using the same <code>peakVal</code> for every data point. Check the <code>-generateDataSamples</code> method and make sure you're storing the correct values in the <code>samples</code> array. If you already have the data in an array, you can skip that method completely and just do the lookup by index in <code>-numberForPlot:field:recordIndex:</code>.</p> <p>Also, check the <code>xRange</code> and <code>yRange</code> on the plot space to make sure they fit your data. Remember that plot ranges are like NSRange—they are created using a starting location and length, not start and end values.</p> <p>To move the labels to the right side of the y-axis, use <code>yAxis.tickDirection = CPTSignPositive;</code>.</p> <p><em>Edit in response to the comments</em></p> <p>Don't call <code>-generateDataSamples</code> every time you get new data. Instead, add the new value to the <code>samples</code> array. Don't forget to initialize the array before using it for the first time.</p> <pre><code>NSDictionary *sample = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithDouble:peakVal],Y_VAL,nil]; [samples addObject:sample]; </code></pre> <p>Once the data is in the array, tell Core Plot to load only the new point. This will be faster than reloading all of the data every time you update.</p> <pre><code>[myScatterPlot insertDataAtIndex:(samples.count - 1) numberOfRecords:1]; </code></pre> <p>You can use the CPTPlot method <code>-deleteDataInIndexRange:</code> to remove old data points if you don't need to keep all of the history in the graph. Don't forget to remove the corresponding point from the <code>samples</code> array also.</p>
    singulars
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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