Overview
To understand how the appearance of data is implemented, it is important to first understand how data is grouped. Each data element is represented by a data point, and each data point must belong to a Series. A Series is the grouping of related data that gets displayed in a chart area. This topic covers the appearance of data, Series, and how data is displayed.
Appearance Attributes
Data points and series each have appearance attributes that determine how data is displayed. An attribute that is set for a series is used by all the data points in that series.
The following is a listing of the appearance attributes of series and data points:
Appearance Attribute |
Description |
The type of gradient to be implemented. If not set gradient colors are not used. | |
The secondary gradient color, used if the BackGradientType property is set. | |
Hatching style. If set, hatching is implemented** | |
Background image to be displayed.** | |
Alignment of the background image, if one is specified. | |
Determines the image mode (tile, stretch, etc.) if a background image is specified). | |
A color in the background image that will be transparent, if an image is used. | |
Border color. | |
Width of the border (pixels). | |
Style of the border (solid, dashed, etc.) | |
Primary color. | |
Any custom attributes (e.g. exploding a pie slice, etc.). | |
Font to be used. | |
Font color to be used. | |
The angle at which data labels will be drawn. | |
Displays a label over, above or beside a data point. | |
The border color of markers, if MarkerStyle property is set.* | |
The color of markers, if MarkerStyle property is set.* | |
The size of markers, if MarkerStyle property is set.* | |
An image file to be used for the marker.* | |
A color in the marker's image that will be transparent, if a marker is used.* | |
The style of markers to be used. If set, markers will be used.* | |
Determines if a series or data point (depends on the chart type) has a corresponding legend item. | |
Determines if data point values are used for data labels. |
* Markers will not be applied to pie, doughnut, candlestick, stock, or any of the stacked chart types.
** All appearance attributes cannot be utilized at the same time.
The following are mutually exclusive visual effects, starting with the highest precedence:
- Background Image.
- Hatching.
- Gradient Colors.
Precedence of Series and Data Point Attributes
With regards to appearance properties, data points have precedence over series. In other words, if the color is set for a data point, and its associated data series also has a color assigned to it, then the data points' color will be used. However, if a color is only specified for that data points' associated series, then the data point will be displayed using the series' assigned color.
This gives you a great deal of control over the appearance of data. For example, by setting a color for a data series, that series of data is displayed using one common color. At the same time, one data point within that series could have its own, different, color assigned to it.
Colors and Palettes
By default, the chart control will assign colors to a data point if no colors are specified for both the data point, and its associated series. The control will use colors from the associated series' palette (set by the Series.Palette property) if one is specified, otherwise it will use the first available color from the control's palette (set by the Chart.Palette property). Colors are retrieved sequentially from a palette when used as default colors.
A custom palette lets you define your own set of colors to be used when drawing series or data points. If you define color values for the Chart.PaletteCustomColors property, the Chart will only use these values to color series or data points and the Chart.Palette property will be ignored.
Note |
---|
Most pre-defined palettes in the Chart contain more than 16 colors. When defining a custom palette, you should consider how many series or data points your chart will display and add the appropriate number of colors. If there are more series or data points than custom palette colors in your chart, the control will display these colors more than once. |
The colors used in your chart depend on the following items:
- The chart type used.
- The chart control's color palette.
- The palette of the associated data series, if one was specified.
Refer to the following table for a summary of how color palettes are used:
Chart Type |
Series Palette Used? |
Colors Displayed by Data Points |
Pie, Doughnut, Funnel, Pyramid Charts |
No |
First available colors used from Control's palette. One color per data point. |
All charts except Pie, Doughnut, Funnel, Pyramid |
No |
First available colors from Control's palette. One color per data series. |
Pie, Doughnut, Funnel, Pyramid Charts |
Yes |
First available colors used from Series's palette. One color per data point. |
All charts except Pie, Doughnut, Funnel, Pyramid |
Yes |
First available colors used from Control's palette. One color per data point. |
The DataPoint Tag
The DataPoint tag is used at design-time to specify all of the appearance attributes for points. In the example below, we specify different colors, and labels for the data points used:
Data Point Labels
Data point labels are implemented using the Label property, and unlike axis labels, they are displayed inside of plotting areas next to a data point. Where a data point label is located depends on the chart type being drawn (e.g. just above the columns of column charts, to the right of the bars in bar charts, etc.).
Setting this property for a Series object will cause all data points that belong to the series to display the specified label. If the Label property is set for both a series and one of its DataPoint objects, the data point label has precedence.
To display labels as values, set the ShowLabelAsValue property to True. If you are using a chart type that uses more than one Y value, then the first Y value will be displayed in the label. Stock and Candlestick charts can display, as labels, Y values other than the first one by using the "LabelValueType" custom attribute, implemented in the CustomAttributes property.
The Label property lets you lets set special variables to display different types of Chart-related data.