NChartScatterSeries Class Reference

Inherits from NChartSeries : NChartObject : NSObject
Declared in NChartScatterSeries.h

Overview

The NChartScatterSeries class provides methods to display scatter series. Scatter is visually similar to NChartBubbleSeries, but it is made to display really big amounts of data. While NChartBubbleSeries barely makes to stay interactive with 10k+ data points (and is terribly slow at 50k), can handle 1M and more. The price to pay is reduced feature set. For example, you cannot set tooltips on the points level like you can in NChartBubbleSeries. Still, you can handle data point selection and describe individual points using NChartCrosshair.

Handling point selection and hover is a bit different from regular series. In the corresponding delegate methods, you will receive a point of series with the index property set to the scatter array element index (starting from 0).

– updateScatterForPoint:startElement:elementsCount:patch:

Do a partial and efficient update of the scatter data. Use this method to organize streamed scatter updates. This method bypasses all the updateData, streamData, etc. machinery of NChart3D and accesses the plot internals directly (still ensuring the thread safety).

- (void)updateScatterForPoint:(NSUInteger)pointIndex startElement:(NSUInteger)startElementIndex elementsCount:(NSUInteger)elementsCount patch:(const double *)patch

Parameters

pointIndex
  • index of point to update.
startElementIndex
  • index of scatter element inside of the point, at which to start the update.
elementsCount
  • number of elements to update.
patch
  • patch for the elements. It should be organized exactly the same, as values array in the NChartScatterArray, but being only a part of it. This array can be reused/deleted right after this call.

Discussion

This method cannot reshape the scatter data. It means, your update has to be perfectly inside of the data you already supplied by updateData call. Also, the same type of elements has to be exactly the same as it was by the updateData call.

It is meant to be a partial update. Preferably, just for a very small part. But you can also update the entire dataset, which will be still faster than doing the new updateData call.

For the sake of speed, this method does no integrity checks. So, if your given parameter values do not correspond to what you had (for example, the indices do not match), expect crashing or undefined behavior.

Declared In

NChartScatterSeries.h

– updateScatterAnimatedForPoint:startElement:elementsCount:patch:duration:delay:

Do an animated partial update. The same as updateScatterForPoint:startElement:elementsCount:patch: but with an animated transition.

- (void)updateScatterAnimatedForPoint:(NSUInteger)pointIndex startElement:(NSUInteger)startElementIndex elementsCount:(NSUInteger)elementsCount patch:(const double *)patch duration:(float)duration delay:(float)delay

Parameters

pointIndex
  • index of point to update.
startElementIndex
  • index of scatter element inside of the point, at which to start the update.
elementsCount
  • number of elements to update.
patch
  • patch for the elements. It should be organized exactly the same, as values array in the NChartScatterArray, but being only a part of it. This array can be reused/deleted right after this call.
duration
  • duration of the animation in seconds.
delay
  • delay of animation start after this call in seconds.

Discussion

This method is much more performance demanding than its non-animated version, so use it with care.

Declared In

NChartScatterSeries.h