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:
- Cascade (default) A cascade of eight cool colors ranging from deep teal down through pale orchid.
- Confetti A sprinkling of bright and pastel colors.
- Iceberg A range of the soft blues and greys found in an iceberg.
- Springtime The colors of spring, in deep green, two vivid colors and five pastels.
- None All data is drawn using the same teal color.
These enumerated values are accessed through the Series class with code like the following.
' Visual Basic Me.ChartControl1.Series(0).ColorPalette = DataDynamics.ActiveReports.Chart.ColorPalette.Iceburg
// C# this.chartControl1.Series[0].ColorPalette = DataDynamics.ActiveReports.Chart.ColorPalette.Iceburg;
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:
- Chart backdrop
- Chart area backdrops
- Wall backdrops
- Title backdrops
- Legend backdrops
- Legend item backdrops (for custom legend items)
- WallRange backdrops
- Series backdrops
- Data point backdrops
- Marker backdrops
- Marker label backdrops
- Annotation TextBar backdrops
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.
' Visual Basic Imports DataDynamics.ActiveReports.Chart.Graphics Dim bItem As New Chart.BackdropItem(GradientType.Vertical, Color.Purple, Color.White) Me.ChartControl1.Backdrop = bItem
// C# using DataDynamics.ActiveReports.Chart.Graphics DataDynamics.ActiveReports.Chart.BackdropItem bItem = new DataDynamics.ActiveReports. Chart.BackdropItem(GradientType.Vertical, Color.Purple, Color.White); this.chartControl1.Backdrop = bItem;