Skip to content

ClassBreak

Namespace: ThinkGeo.Core

This class represents a single class break.

public class ClassBreak

Inheritance ObjectClassBreak

Remarks:

Class breaks are used in the ClassBreakStyle. They allow you to display data differently depending on ranges of data in the FeatureSource.

How class breaks work:

You add a number of ClassBreak classes to the ClassBreak collection. The numeric values of the breaks are important and you must place the breaks in numerical order. For example, break 0 must be added before break 100. In each ClassBreak, you specify the style you want to represent that break. Additionally, in the ColumnName property, you specify the name of the column where we will find the data used to compare the breaks. The column name must point to a column that is numeric.

When we proceed to draw the style, we look through the ClassBreaks and select the ClassBreak that is where the features column data is greater than and closest to the break value.

Example:

Feature Value = 42

ClassBreak1.Value = 0
ClassBreak2.Value = 20
ClassBreak3.Value = 40
ClassBreak4.Value = 60

In this case, the break closest to the feature value without exceeding it is ClassBreak3(40). If the feature value had been less than zero, nothing would have been drawn. If the feature value were 1000, then ClassBreak4 would draw.

If you wanted to represent a value that is less then zero, you could do that as shown in the sample below.

Feature Value = -1

ClassBreak1.Value = Double.Min
ClassBreak2.Value = 0
ClassBreak3.Value = 20
ClassBreak4.Value = 40

In this example, the first class break would be used.

Properties

Value

This property get and sets the break value.

public double Value { get; set; }

Property Value

Double
This property get the break value.

Remarks:

This value determines where the break is in the ClassBreakStyle.

Please see the ClassBreakStyle class remarks for a full description of how the ClassBreakStyle works.

DefaultAreaStyle

This property gets and sets the default AreaStyle used to draw the class break.

public AreaStyle DefaultAreaStyle { get; set; }

Property Value

AreaStyle
This property gets the default AreaStyle used to draw the class break.

Remarks:

If you set this style, then when the data for a feature is within the current break it will use this style to draw.

If you use the default styles, then you should only use one. The one you use should match your feature data. For example, if your features are lines, then you should use the DefaultLineStyle.

DefaultLineStyle

This property gets and sets the default LineStyle used to draw the class break.

public LineStyle DefaultLineStyle { get; set; }

Property Value

LineStyle
This property gets the default LineStyle used to draw the class break.

Remarks:

If you set this style, then when the data for a feature is within the current break it will use this style to draw.

If you use the default styles, then you should only use one. The one you use should match your feature data. For example, if your features are lines, then you should use the DefaultLineStyle.

DefaultPointStyle

This property gets and sets the default PointStyle used to draw the class break.

public PointStyle DefaultPointStyle { get; set; }

Property Value

PointStyle
This property gets the default PointStyle used to draw the class break.

Remarks:

If you set this style, then when the data for a feature is within the current break it will use this style to draw.

If you use the default styles, then you should only use one. The one you use should match your feature data. For example, if your features are lines, then you should use the DefaultLineStyle.

DefaultTextStyle

This property gets and sets the default TextStyle used to draw the class break.

public TextStyle DefaultTextStyle { get; set; }

Property Value

TextStyle
This property gets the default TextStyle used to draw the class break.

Remarks:

If you set this style, then when the data for a feature is within the current break it will use this style to draw.

If you use the default styles, then you should only use one. The one you use should match your feature data. For example, if your features are lines then you should use the DefaultLineStyle.

CustomStyles

This property gets a collection of custom styles used to draw the class break.

public Collection<Style> CustomStyles { get; }

Property Value

Collection<Style>

        This property gets a collection of custom styles used to draw the class
        break.

Remarks:

If you set these styles, then when the data for a feature is within the current break it will use this style to draw.

If you do not wish to use the default style properties, then you can use this collection to specify any types of styles you want to use.

Constructors

ClassBreak()

This is the class constructor.

public ClassBreak()

Remarks:

If you use this default constructor, then you should set the properties manually.

ClassBreak(Double, AreaStyle)

This is the class constructor.

public ClassBreak(double value, AreaStyle areaStyle)

Parameters

value Double
The parameter represents the break value.

areaStyle AreaStyle
This parameter is the AreaStyle you want to use to represent this break.

Remarks:

This overload allows you to pass in a break value and an AreaStyle to use.

ClassBreak(Double, PointStyle)

This is the class constructor.

public ClassBreak(double value, PointStyle pointStyle)

Parameters

value Double
The parameter represents the break value.

pointStyle PointStyle
This parameter is the PointStyle you want to use to represent this break.

Remarks:

This overload allows you to pass in a break value and a Point to use.

ClassBreak(Double, LineStyle)

This is the class constructor.

public ClassBreak(double value, LineStyle lineStyle)

Parameters

value Double
The parameter represents the break value.

lineStyle LineStyle
This parameter is the LineStyle you want to use to represent this break.

Remarks:

This overload allows you to pass in a break value and a LineStyle to use.

ClassBreak(Double, TextStyle)

This is the class constructor.

public ClassBreak(double value, TextStyle textStyle)

Parameters

value Double
The parameter represents the break value.

textStyle TextStyle
This parameter is the TextStyle you want to use to represent this break.

Remarks:

This overload allows you to pass in a break value and a TextStyle to use.

ClassBreak(Double, Collection<Style>)

This is the class constructor.

public ClassBreak(double value, Collection<Style> customStyles)

Parameters

value Double
The parameter represents the break value.

customStyles Collection<Style>
This parameter is the TextStyles you want to use to represent this break.

Remarks:

This overload allows you to pass in a break value and a collection of TextStyles to use.