Scatter Plot Lines and Symbols

The attributes that define how a series of data looks in the scatter plot are called a Chart3DStyle. Each series has its own Chart3DStyle, which can be customized. The Chart3DStyle object allows the following properties of a series to be changed programmatically:

      The LineStyle property, which defines the line style for the object. This specifies the color, pattern, and thickness of drop lines.

      The SymbolStyle property, which defines the symbol style for the object. This specifies the color, size and shape of points.

The Chart3DStylesCollection contains the Chart3DStyle objects defined for each series. The following methods are defined for the Chart3DStylesCollection:

 

Method

Description

AddNewStyle()

Add a new ChartStyle object to the collection.

Remove(index)

Remove a ChartStyle object from the collection.

 

Normally, manual adding or removing of Chart3DStyle objects from the collection is not needed. If a Chart3DStyle object already exists when its corresponding series is created, the previously created Chart3DStyle object is used to display the data in this series.

Looping through the Chart3DstylesCollection can quickly change the behavior of all of the lines or points in a chart. For example, the following code lightens all of the points in a chart whenever the mouse is clicked:

      Visual Basic

      C#

Setting the line pattern

The following sets the line pattern for the second series to a dotted line:

      Visual Basic

      C#

Setting the symbol style

And the following statement sets the symbol style for the third series to an unfilled circle:

      Visual Basic

      C#

Formatting data point symbols

You can easily format the Scatter Plot's data point symbols shape, size, color, and width using the properties of the Chart3DSymbolStyle class.

Use the Symbol Shape property to set the symbol type, the Size property to set its size, and the Color properties to set the symbol color for a ChartStyle. The valid types of symbols are shown below:

 

Type

Image

Type

Image

None

 

Vertical Line

Dot

Horizontal Line

Box

Cross

Triangle

Circle

Diamond

Square

Star

Inverted Triangle

Diagonal Cross

Open Triangle

Open Diamond

Open Inverted Triangle

 

These properties are available at design time under the LineStyle node in the Chart3DStyle Collection Editor.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.