Add Sparklines to a Report

This document describes the XRSparkline control and outlines its main features.

Sparkline Overview

The XRSparkline control displays a compact chart that is commonly used to illustrate the data flow for every row in a report.

You can add this control by dragging the XRSparkline item from the DX:18.1: Report Controls Toolbox tab onto the report.

report-control-sparkline-0

Binding the Sparkline to Data

You can connect the sparkline to individual data without accessing a report's data source. Click the control's smart tag, expand the XRSparkline.DataSource drop-down list and select the required data source.

report-control-sparkline-2

The sparkline uses the report's data source if you do not specify the DataSource property.

After that, specify the XRSparkline.DataMember property and set the XRSparkline.ValueMember property to a data field that provides point values for the sparkline.

Adjusting the Sparkline View

You can specify the sparkline's view type by clicking its smart tag and selecting the required type in the XRSparkline.View drop-down list.

report-control-sparkline-1

Alternatively, you can call the SparklineViewBase.CreateView static method.

The sparkline supports the following view types:

View Type Image Description
LineSparklineView xr-sparkline-line-view A line chart.
AreaSparklineView xr-sparkline-area-view An area chart.
BarSparklineView xr-sparkline-bar-view A bar chart.
WinLossSparklineView xr-sparkline-win-loss-view A win-loss chart.

The View property provides access to options that change the sparkline's appearance.

how-to-add-sparklines-07

Each view type has properties that define the extreme values' visibility:

Specific properties differ between view types, such as the BarSparklineView.HighlightNegativePoints setting that is available only for the Bar sparkline.

The following image illustrates a table report containing sparklines that provide maximum and minimum value indicators in their data range:

sparkline-report