Dundas Chart for ASP.NET
Appearance of Data
See Also Send comments on this topic.
Working with Data > Appearance of Data

Glossary Item Box

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

BackGradientType

The type of gradient to be implemented. If not set gradient colors are not used.

BackGradientEndColor

The secondary gradient color, used if the BackGradientType property is set.

BackHatchStyle

Hatching style. If set, hatching is implemented**

BackImage

Background image to be displayed.**

BackImageAlign

Alignment of the background image, if one is specified.

BackImageMode

Determines the image mode (tile, stretch, etc.) if a background image is specified).

BackImageTranspColor

A color in the background image that will be transparent, if an image is used.

BorderColor

Border color.

Color

Primary color.

CustomAttributes

Any custom attributes (e.g. exploding a pie slice, etc.).

Font

Font to be used.

FontColor

Font color to be used.

FontAngle

The angle at which data labels will be drawn.

Label

Displays a label over, above or beside a data point.

MarkerBorderColor

The border color of markers, if MarkerStyle property is set.*

MarkerColor

The color of markers, if MarkerStyle property is set.*

MarkerSize

The size of markers, if MarkerStyle property is set.*

MarkerImage

An image file to be used for the marker.*

MarkerImageTranspColor

A color in the marker's image that will be transparent, if a marker is used.*

MarkerStyle

The style of markers to be used. If set, markers will be used.*

ShowInLegend

Determines if a series or data point (depends on the chart type) has a corresponding legend item.

ShowLabelAsValue

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:

  1. Background Image.
  2. Hatching.
  3. 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 allows you to define a set of your own 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.

All Chart series also have a PaletteCustomColors property that allows you to set an array of custom colors to use for that series' data points. This property can also be used to access an array of custom colors that may have previously been set for the chart's series.

 

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:

 

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:

HTML Copy Code
<Points>
  <dcwc:DataPoint YValues="1" Color="Red"></dcwc:DataPoint>
  <dcwc:DataPoint YValues="2" AxisLabel="MyLabel"></dcwc:DataPoint>
</Points>

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 allows you to set special keywords to display different types of Chart-related data. For more information, refer to the topic on Using Keywords.

See Also

Copyright © 2001 - 2009 Dundas Data Visualization, Inc. and others.