Jittering (or blurring) is a very convenient way to antialias the whole scene. The idea behind it is very simple, which is why this special visual effect is so effective. Instead of rendering the scene only once, the control renders it several times and produces different image samples of the image. All these samples have a small offset along the X and Y directions. These samples are then added together with weight coefficients calculated by using the following formula:
Weight percent = 100 / Number of samples
You enable the jittering feature by setting the EnableJittering property of the Settings object to true:
VB.NET | |
---|---|
ChartControl.Settings.EnableJittering = True |
C# | |
---|---|
ChartControl.Settings.EnableJittering = true; |
The number of samples generated to produce the jittered image is specified in the JitteringSteps property of the Settings object. By default the value of this property is 2; it accepts values in the range [2, 16]. For example, the following line of code will increase the number of jittering samples used to produce the final image:
VB.NET | |
---|---|
ChartControl.Settings.JitteringSteps = 4 |
C# | |
---|---|
ChartControl.Settings.JitteringSteps = 4; |
By default all the deviations of the samples along the X and Y axes are smaller than 1 pixel, but you can control the deviation factor by using the JitteringDeviation property of the Settings object:
VB.NET | |
---|---|
ChartControl.Settings.JitteringDeviation = 3 ' set the deviation to three pixels |
C# | |
---|---|
ChartControl.Settings.JitteringDeviation = 3; //set the deviation to three pixels |
A bubble chart with no jittering. The bubble edge is jagged. |
A bubble chart with jittering. 4 samples and deviation 1. The bubble edge is now antialiased. |
A bubble chart with jittering. 4 samples and deviation 3. The image looks blurred. |
As you can see in the table above, jittering in conjunction with a large deviation and more jittering samples leads to a blurred image. This is why jittering can be considered a type of blurring effect.
The control does not jitter 2D objects such as texts, legends, and labels. As with every antialiasing effect, jittering reduces performance. The performance hit is proportional to the number of jittering samples. For example, if you apply a jittering effect with 4 samples to the scene, the control will render approximately 4 times slower than without jittering. To improve performance, you may consider decreasing as much as possible the number of jittering samples. For example, a value of 4 jittering samples delivers good quality at a comparatively low performance cost.
Typically you may consider using jittering in applications where the quality of the generated image is more important than the speed, on low-traffic web servers and in high-end presentations, for example.
Related Examples
Windows Forms: Special Visual Effects\Jittering