ActiveReports 6 Online Help
Chart Effects
Show AllShow All
Hide AllHide All

Colors

In the Chart control, colors can be used in different ways to enhance the chart's appearance, distinguish different series, point out or draw attention to data information such as averages, and more.

Color Palettes

The Chart control includes several pre-defined color palettes that can be used to automatically set the colors for data values in a series. The pre-defined palettes are as follows:

These enumerated values are accessed through the Series class with code like the following.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to set the color palette for the series.

To write the code in Visual Basic.NET

To write the code in C#

Gradients

Gradients can be used in object backdrops to enhance the visual appearance of various chart items. Gradients can be used in the following chart sections:

You can set gradients for a backdrop at run time by creating a BackdropItem, setting its Style property to Gradient, setting the GradientType, and setting the two colors to use for the gradient as shown in the following example.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to set gradients for the backdrop.

To write the code in Visual Basic.NET

To write the code in C#

3D Effects

Using the projection and viewpoint settings, you can display your 3D chart at any angle to provide the desired view or call attention to a specific chart section.

Projection

Determine the projection for a 3D chart using three factors: the Z depth ratio, the projection type, and the projection DX and DY values.

Alpha Blending

The Backdrop class in the Chart control has an Alpha property which employs GDI+, and is used to set the transparency level of each object's backdrop. GDI+ uses 32 bits overall and 8 bits per alpha, red, green, and blue channels respectively to indicate the transparency and color of an object. Like a color channel's levels of color, the alpha channel represents 256 levels of transparency.

The default value of the Alpha property is 255, which represents a fully opaque color. For a fully transparent color, set this value to 0. To blend the color of the object's backdrop with the background color, use a setting between 0 and 255.

In the Chart control, you can use the Color.FromArgb method to set the alpha and color levels for a particular chart element. The following example shows how you can use the method to set the alpha and color values for the chart backdrop.

  1. In design view of the report, double-click the section where you placed your chart. This creates a Format event handling method for the section.
  2. Add code to the handler to set the transparency of the chart objects.

To write the code in Visual Basic.NET

To write the code in C#

Changing the alpha level of a chart element reveals other items that are beneath the object. Because you can set the alpha level for any chart element that supports color, you can create custom effects for any chart. For example, you can use alpha blending to combine background images with a semi-transparent chart backdrop to create a watermark look.

Lighting

The Chart control allows you to completely customize lighting options for 3D charts.

Directional Light Ratio

Using the DirectionalLightRatio property, you can control the directional or ambient intensity ratio.

Light Type

By setting the Type property to one of the enumerated LightType values, you can control the type of lighting used in the chart. The settings are as follows:

Light Source

You can also set the Source property to a Point3d object, which controls the location of the light source.

See Also

How To

Walkthroughs