Skip to content

Latest commit

 

History

History
2444 lines (1937 loc) · 67.4 KB

datachart-series-error-bars.adoc

File metadata and controls

2444 lines (1937 loc) · 67.4 KB

Series Error Bars

This topic introduces the Error Bars feature of the {DataChartName}™ control and explains, with code examples, how to display error bars on supported series.

Overview

The topic is organized as follows:

Introduction

Error bars are visual representation of the variability of data plotted in the Data Chart using Series objects. They are often used on charts to show an error or uncertainty in data. In general, they provide visualization of how accurate data measurements are or how far the true values could be from the measured values.

Requirements

In {DataChartName}, the length of error bars is calculated using the Infragistics Math Calculators™ and the following assemblies must be added to a {PlatformName} project before error bars can be displayed on data points.

Assembly Description

{ApiPlatform}Math.Calculators.{ApiVersion}.dll

{ProductName} assembly containing mathematical calculators to compute error bars, correlation, mean, median, variance and many more mathematical values.

{ApiPlatform}Math.{ApiVersion}.dll

{ProductName} assembly containing standard mathematical constants and all-purpose mathematical functions designed to act on a variety of mathematical objects.

{ApiPlatform}{DataChartAssembly}.{ApiVersion}.dll

{ProductName} assembly containing the {DataChartName} control and various types of Series and Axes for plotting data.

{ApiPlatform}{ApiVersion}.dll

{ProductName} assembly containing shared functionality used by the Infragistics assemblies.

Supported Types of Series

This section provides a list of series types that support error bars in the Data Chart control.

Table 1 – Supported Types of Series

Type of Series Supported Error Bars Preview
  • AreaSeries

  • ColumnSeries

  • LineSeries

  • SplineSeries

  • SplineAreaSeries

  • StepAreaSeries

  • StepLineSeries

Vertical Error Bars

xamDataChart Series Error Bars  01

Figure 1 – Category Series with Error Bars

  • ScatterSeries

  • ScatterLineSeries

  • ScatterSplineSeries

Horizontal Error Bars

Vertical Error Bars

xamDataChart Series Error Bars  02

Figure 2 – Scatter Series with Error Bars

Note
Note:

Error bars are not supported by stacked or range types of series in the group of the Category Series .

Types of Error Bars

The Data Chart supports a number of types of error bars that are listed in the Table 2 below. The length of error bars is calculated using the Infragistics Math Calculators that implements the IErrorBarCalculator interface.

Table 2 – Types of Error Bars

Type of Error Bars Description

Fixed Value Error Bars

The length of these error bars is equal to a fixed value bound to the Value property of the Infragistics Fixed Value Calculator.

Percentage Error Bars

The length of these error bars is equal a percentage value bound to the Value property of the Infragistics Percentage Calculator.

Standard Error Bars

The length of these error bars is calculated using the standard error of a set of data bound to the ItemsSource property of the Infragistics Standard Error Calculator.

Standard Deviation Error Bars

The length of these error bars is calculated using the standard deviation of a set of data bound to the ItemsSource property of the Infragistics Standard Deviation Calculator.

Custom Data Error Bars

The length of these error bars is provided by arbitrary or custom values in a set of data bound to the ItemsSource property of Infragistics Data Calculator.

Error Bars Properties

Category Error Bars Properties

The following table provides overview of properties relevant to error bars for all series in the Category Series group.

Property Name Property Type Description

CategorySeries. ErrorBarSettings

Gets or sets the settings of error bars on a Category Series.

CategoryErrorBarSettings. EnableErrorBars

Gets or sets the enumeration value that specifies the display type of the error bars:

Both – Displays both positive and negative error bars

Positive – Displays only positive error bars (above data points)

Negative – Displays only negative error bars(below data points)

None – Hides all error bars

CategoryErrorBarSettings. ErrorBarCapLength

Int

Gets or sets the cap length of the error bars.

CategoryErrorBarSettings. StrokeThickness

Double

Gets or sets the thickness of the error bars.

CategoryErrorBarSettings. Stroke

Brush

Gets or sets the stoke brush of the error bars.

CategoryErrorBarSettings. Calculator

Gets or sets a calculator used for calculating values of the error bars:

DataCalculator – Provides arbitrary or custom values for the error bars

FixedValueCalculator – Generates error bars with length equal to a fixed value bound to the Value property of the Calculator.

PercentageCalculator – Generates error bars with length equal to a percentage value bound to the Value property of the calculator.

StandardDeviationCalculator – Calculates error bars based on the standard deviation of all data items bound to the ItemsSource property of the calculator.

StandardErrorCalculator – Calculates error bars based on the standard error of a set of data bound to the ItemsSource property of the calculator.

Scatter Error Bars Properties

The following table provides overview of properties relevant to error bars for all series in the Scatter Series group.

Property Name Property Type Description

ScatterBase. ErrorBarSettings

Gets or sets the settings of horizontal error bars on a Scatter Series.

ScatterErrorBarSettings. EnableErrorBarsHorizontal

Gets or sets the enumeration value that specifies the display type of the horizontal error bars:

Both – Displays both positive and negative error bars

Negative –Displays only negative error bars (on the left side of data points)

Positive – Displays only positive error bars (on the right side of data points)

None – Hides all error bars

ScatterErrorBarSettings. HorizontalErrorBarCapLength

Int

Gets or sets the cap length of the horizontal error bars.

ScatterErrorBarSettings. HorizontalStrokeThickness

Double

Gets or sets the thickness of the horizontal error bars.

ScatterErrorBarSettings. HorizontalStroke

Brush

Gets or sets the stoke brush of the horizontal error bars.

ScatterErrorBarSettings. HorizontalCalculator

Gets or sets a calculator used for calculating values of the horizontal error bars:

DataCalculator – Provides arbitrary or custom values for the error bars

FixedValueCalculator – Generates error bars with length equal to a fixed value bound to the Value property of the Calculator.

PercentageCalculator – Generates error bars with length equal to a percentage value bound to the Value property of the calculator.

StandardDeviationCalculator – Calculates error bars based on the standard deviation of all data items bound to the ItemsSource property of the calculator.

StandardErrorCalculator – Calculates error bars based on the standard error of a set of data bound to the ItemsSource property of the calculator.

ScatterErrorBarSettings. HorizontalCalculatorReference

Gets or sets the enumeration value that specifies the reference value for the PercentageCalculator bound to the HorizontalCalculator property:

X – Specifies the X member as the reference value for calculation of horizontal error bars

Y – Specifies the Y member as the reference value for calculation of horizontal error bars

ScatterErrorBarSettings. HorizontalErrorBarStyle

Style

Gets or sets the style of the horizontal error bars

ScatterErrorBarSettings. EnableErrorBarsVertical

Gets or sets the enumeration value that specifies the display type of the vertical error bars:

Both – Displays both positive and negative error bars

Positive – Displays only positive error bars (above data points)

Negative – Displays only negative error bars (below data points)

None – Hides all error bars

ScatterErrorBarSettings. VerticalErrorBarCapLength

Int

Gets or sets the cap length of the vertical error bars

ScatterErrorBarSettings. VerticalStrokeThickness

Double

Gets or sets the thickness of the vertical error bars

ScatterErrorBarSettings. VerticalStroke

Brush

Gets or sets the stoke brush of the vertical error bars

ScatterErrorBarSettings. VerticalCalculator

Gets or sets a calculator used for calculating values of the vertical error bars:

DataCalculator – Provides arbitrary or custom values for the error bars

FixedValueCalculator – Generates error bars with length equal to a fixed value bound to the Value property of the calculator.

PercentageCalculator – Generates error bars with length equal to a percentage value bound to the Value property of the calculator.

StandardDeviationCalculator – Calculates error bars based on the standard deviation of all data items bound to the ItemsSource property of the calculator.

StandardErrorCalculator – Calculates error bars based on the standard error of a set of data bound to the ItemsSource property of the calculator.

ScatterErrorBarSettings. VerticalCalculatorReference

Gets or sets the enumeration value that specifies the reference value for the PercentageCalculator bound to the VerticalCalculator property:

X – Specifies the X member as the reference value for calculation of vertical error bars

Y – Specifies the Y member as the reference value for calculation of vertical error bars

ScatterErrorBarSettings. VerticalErrorBarStyle

Style

Gets or sets the style of the vertical error bars.

Examples

This section provides code examples for displaying various types of error bars on series in the Data Chart control.

Category Series with Fixed Value Error Bars

The following code listing demonstrates how to display the Fixed Value Error Bars on the LineSeries.

Figure 3 - Line Series with the Fixed Value Error Bars

Category Series with Percentage Error Bars

The following code listing demonstrates how to display the Percentage Error Bars on the LineSeries.

Figure 3 - Line Series with the Percentage Error Bars

Category Series with Standard Error Bars

The following code listing demonstrates how to display the Standard Error Bars on the LineSeries.

Note
Note:

The same dataset should be bound to the series object as well as to the StandardErrorCalculator using their ItemsSource properties in order to calculate error bars for all data points. You can download a sample set of data from the Category Data Sample resource.

Figure 3 - Line Series with the Standard Error Bars

Category Series with Standard Deviation Error Bars

The following code listing demonstrates how to display the Standard Deviation Error Bars on the LineSeries.

Note
Note:

The same dataset should be bound to the series object as well as to the StandardDeviationCalculator using their ItemsSource properties in order to calculate error bars for all data points. You can download a sample set of data from the Category Data Sample resource.

Figure 3 - Line Series with the Standard Deviation Error Bars

Category Series with Custom Data Error Bars

The following code listing demonstrates how to display Custom Data Error Bars on the LineSeries. Values for the Custom Data Error Bars are provided by a set of data bound to the ItemsSource property of the DataCalculator.

Note
Note:

The following code provides sample logic for generating values for Custom Data Error Bars. You need to add it to your project or provide your own values for data error bars.

Figure 3 - Line Series with the Custom Data Error Bars

Scatter Series with Fixed Value Error Bars

The following code listing demonstrates how to display the Fixed Value Error Bars on the ScatterSeries.

Figure 3 - Scatter Series with the Fixed Value Error Bars

Scatter Series with Percentage Error Bars

The following code listing demonstrates how to display the Percentage Error Bars on the ScatterSeries.

Figure 4 - Scatter Series with the Percentage Error Bars

Scatter Series with Standard Error Bars

The following code listing demonstrates how to display the Standard Error Bars on the ScatterSeries.

Note
Note:

The same dataset should be bound to the Series as well as to the StandardErrorCalculator using their ItemsSource properties in order to calculate error bars for all data points. You can download a sample set of data from the Scatter Data Sample resource.

Figure 4 - Scatter Series with the Standard Error Bars

Scatter Series with Standard Deviation Error Bars

The following code listing demonstrates how to display the Standard Deviation Error Bars on the ScatterSeries.

Note
Note:

The same dataset should be bound to the Series as well as to the StandardDeviationCalculator using their ItemsSource properties in order to calculate error bars for all data points. You can download a sample set of data from the Scatter Data Sample resource.

Figure 5 - Scatter Series with the Standard Deviation Error Bars

Scatter Series with Custom Data Error Bars

The following code listing demonstrates how to display Custom Data Error Bars on the ScatterSeries. Values for the Custom Data Error Bars are provided by a data set bound to the ItemsSource property of the DataCalculator.

Note
Note:

The following code provides sample logic for generating values for Custom Data Error Bars. You need to add it your project or provide your own values for data error bars.

Figure 6 - Scatter Series with Custom Data Error Bars