Skip to content

Latest commit

 

History

History
971 lines (764 loc) · 32.9 KB

datachart-bubble-series.adoc

File metadata and controls

971 lines (764 loc) · 32.9 KB

Scatter Bubble Series

This topic explains, with code examples, how to use BubbleSeries in the {DataChartName}™ control. Some important conceptual information is provided as well.

The topic is organized as follows:

Introduction

BubbleSeries belongs to a group of ItemsSource pick:[win-forms=" DataSource"] property to bind any data object that implements the IEnumerable interface (e.g. List, Collection, Queue, Stack). However, each item in this object must have one numeric data column (for the size of a bubble) in addition to two numeric data columns (for X and Y values to position a bubble in the Cartesian coordinate system). These data columns are mapped using RadiusMemberPath, XMemberPath, and YMemberPath properties.

Binding Data to the Bubble Series

An example of object that meets the criteria listed above is the BubbleDataSample which you can download from the Sample Bubble Data resource and use it in your project. Figure 1 shows a schematic representation of binding data to BubbleSeries in the {DataChartName} control.

Figure 1: Schematic representation of binding data to BubbleSeries in the {DataChartName} control.

This code snippet below demonstrates how to bind sample bubble data to the BubbleSeries.

xamDataChart Scatter Bubble Series 02

Figure 2: Sample implementation of the binding data with varius bubble sizes to Bubble Series

Features of the BubbleSeries

The Bubble Size Scale Feature

Overview

Bubble Size Scale is an optional feature of BubbleSeries that determines the sizes of bubbles though the RadiusScale property of the series. This feature is implemented through the SizeScale object. When the radius scale is set, the smallest bubble will be equal to MinimumValue, the largest bubble will be equal to MaximumValue, and all the remaining bubbles will be scaled accordingly. The size scale can be either linear or logarithmic. When the radius scale is not set, each bubble’s size is equal to the value of the RadiusMemberPath column.

xamDataChart Scatter Bubble Series 03

Figure 3: Sample implementation of the Bubble Size Scale

Code Example

This code snippet demonstrates how to scale size of bubbles in the BubbleSeries using SizeScale object.

The Bubble Brush Scale Feature

The Bubble Brush Scale is an optional feature which determines the color pattern within a single BubbleSeries though the series object’s FillScale property. BubbleSeries support the following brush scales:

  • Custom Brush Scale

  • Value Brush Scale

Each scale has a collection of brushes which defines color pattern. The scales are explained in the sub-sections that follow.

Custom Brush Scale

Overview

CustomPaletteBrushScale uses the index of a bubble marker to select a brush from the Brushes collection. When the BrushSelectionMode property is set to the Select enumerable value, the bubbles are colored sequentially. When BrushSelectionMode is set to Interpolate, the brush is interpolated based on the bubble’s index and the number of brushes in the collection.

xamDataChart Scatter Bubble Series 04

Figure 4: Sample implementation of the Custom Brush Scale

Code Example

This code snippet demonstrates how to fill the color of the bubbles in the BubbleSeries using CustomPaletteBrushScale object.

Value Brush Scale

Overview

ValueBrushScale uses a set of values from one of the numeric columns in the ItemsSource to determine an interpolated brush for bubbles. The column is specified with FillMemberPath property. This axis scale can be linear or logarithmic. Also, it can have user-specified MinimumValue and MaximumValue. When a range is set on this scale, bubbles with values that fall outside the range do not get a brush from the Brushes collection and are not colored.

xamDataChart Scatter Bubble Series 05

Figure 5: Sample implementation of the Value Brush Scale

Code Example

This code snippet demonstrates how to fill the color of the bubbles in the BubbleSeries using ValueBrushScale object.

Supported Types of Legends

The BubbleSeries supports the following types of legends:

For details on the supported legends and how to use them with BubbleSeries, refer to the Chart Legends topic.