Add Sparklines to a Report
- 2 minutes to read
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:19.1: Report Controls Toolbox tab onto the report.
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.
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.
Alternatively, you can call the static SparklineViewBase.CreateView method.
The sparkline supports the following view types:
View Type | Image | Description |
---|---|---|
LineSparklineView | A line chart. | |
AreaSparklineView | An area chart. | |
BarSparklineView | A bar chart. | |
WinLossSparklineView | A win-loss chart. |
The View property provides access to options that change the sparkline’s appearance.
Each view type has properties that define the extreme values’ visibility:
- SparklineViewBase.HighlightStartPoint and SparklineViewBase.HighlightEndPoint;
- SparklineViewBase.HighlightMinPoint and SparklineViewBase.HighlightMaxPoint.
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: