ActiveReports 12
Sparkline
ActiveReports 12 > ActiveReports User Guide > Concepts > Page Report/RDL Report Concepts > Toolbox > Sparkline

You can use the Sparkline report control as a simple means of displaying the trend of data in a small graph. The Sparkline displays the most recent value as the rightmost data point and compares it with earlier values on a scale, allowing you to view general changes in data over time. With the height similar to the surrounding text and the width not more than 14 letters wide, the sparkline fits well in dashboards, reports, and other documents.

Customize the Sparkline control with the following types.

Type Description
Line The Line sparkline is widely used in financial and economic data analysis and is based on a continuous flow of data. The currency exchange rates, changes in price are the examples of application of this type of sparklines.
Columns The Column sparkline is used for sports scores, cash register receipts, and other cases where previous values and the current value do not closely influence one another. In this case you are dealing with discrete data points, and not a continuous flow of data as in the Line sparkline.
Whiskers The Whisker sparkline is typically used in win/loss/tie or true/false scenarios. This type is similar to the Column sparkline, but it renders a tie (0 value) in a different manner. The bars in a whisker sparkline render below the baseline for a negative value, above the baseline for a positive value, and on the baseline for a zero value.
Area The Area sparkline is similar to the Line sparkline but visually you see the space under the line as shaded.
StackedBar The Stacked Bar sparkline is presented as a horizontal bar with different segment lengths marked by distinct color hues. The Stacked bar illustrates how the various segments of a part-to-whole relationship correspond to one another - the largest segment represents the highest value and the change in brightness indicates a new value on a scale.

Sparkline Dialog

Properties for the Sparkline are available in the Sparkline dialog. To open it, with the Sparkline control selected on the report, under the Properties Window, click the Property dialog link.

The Sparkline dialog lets you set properties on the report control with the following pages.

General

Name: Enter a name for the sparkline that is unique within the report. This name can be called in code. You can only use underscore (_) as a special character in the Name field. Other special characters such as period (.), space ( ), forward slash (/), back slash (\), exclamation (!), and hyphen (-) are not supported.

Data

Value: Enter an expression to use as the sparkline value.

Name: Enter a name for the sparkline that is unique within the report. This name can be called in code. A name is created automatically if you do not enter one.

Group on: Enter an expression to use for grouping the data. If you open the expression editor, you can select a field from the dataset.

Detail Grouping: Enter an expression to use if you do not want to repeat values within the details. If you open the expression editor, you can select a field from the dataset.

Parent Group:  For use in recursive hierarchies. Enter an expression to use as the parent group.

Appearance

Sparkline Type: Choose Line, Columns, Whiskers, Area or StackedBar. Each of these types has its own set of Appearance properties that appears when you select the type.

Line Type Appearance Properties

Last point marker is visible: Select to display a marker at the last point on the sparkline.

Marker Color: Select a color to use for the last point marker, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Line Style

Color: Select a color to use for the line, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Width: Enter a value in points to set the width of the line.

Enable Wall Range: Select this check box to display a wall range for the sparkline. Selecting this box enables the rest of the properties in this section.

Lower Bound: Select a value or enter an expression that defines the lower bound of the wall range.

Upper Bound: Select a value or enter an expression that defines the upper bound of the wall range.

Wall Range Backdrop

Fill Color: Select a color to use for the wall range, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Gradient: Choose the type of gradient to use for the backdrop: None, LeftRight, TopBottom, Center, DiagonalLeft, DiagonalRight, HorizontalCenter or VerticalCenter.

Gradient End Color: Select a color to use for the end of the wall range gradient, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Columns Type Appearance Properties

Fill Color: Select a color to use for the fill of the sparkline, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Maximum Column Width: Select the maximum width of columns in the sparkline. If blank, all columns are sized to fit.

Enable Wall Range: Select this check box to display a wall range for the sparkline. Selecting this box enables the rest of the properties in this section.

Lower Bound: Select a value or enter an expression that defines the lower bound of the wall range.

Upper Bound: Select a value or enter an expression that defines the upper bound of the wall range.

Wall Range Backdrop

Fill Color: Select a color to use for the wall range, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Gradient: Choose the type of gradient from these choices: None, LeftRight, TopBottom, Center, DiagonalLeft, DiagonalRight, HorizontalCenter or VerticalCenter.

Gradient End Color: Select a color to use for the end of the wall range gradient, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Whiskers Type Appearance Properties

Fill Color: Select a color to use for the fill of the sparkline, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Maximum Column Width: Select the maximum width of columns in the sparkline. If blank, all columns are sized to fit.

Enable Wall Range: Select this check box to display a wall range for the sparkline. Selecting this box enables the rest of the properties in this section.

Lower Bound: Select a value or enter an expression that defines the lower bound of the wall range.

Upper Bound: Select a value or enter an expression that defines the upper bound of the wall range.

Wall Range Backdrop

Fill Color: Select a color to use for the wall range, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Gradient: Choose the type of gradient from these choices: None, LeftRight, TopBottom, Center, DiagonalLeft, DiagonalRight, HorizontalCenter or VerticalCenter.

Gradient End Color: Select a color to use for the end of the wall range gradient, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Area Type Appearance Properties

Fill Color: Select a color to use for the fill of the sparkline, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Enable Wall Range: Select this check box to display a wall range for the sparkline. Selecting this box enables the rest of the properties in this section.

Lower Bound: Select a value or enter an expression that defines the lower bound of the wall range.

Upper Bound: Select a value or enter an expression that defines the upper bound of the wall range.

Wall Range Backdrop

Fill Color: Select a color to use for the wall range, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

Gradient: Choose the type of gradient from these choices: None, LeftRight, TopBottom, Center, DiagonalLeft, DiagonalRight, HorizontalCenter or VerticalCenter.

Gradient End Color: Select a color to use for the end of the wall range gradient, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color.

StackedBar Type Appearance Properties

Fill Color: Select a color to use for the base color of the stacked bars, or select the <Expression...> option to open the Expression Editor and create an expression that evaluates to a .NET color. The other colors of the stacked bars are calculated using this based color.

Visibility

Initial visibility

Visibility can be toggled by another report control: Select this check box to display a toggle image next to another report item. This enables the drop-down box below where you can specify the TextBox control which, if clicked, toggles the visibility of the sparkline in the Viewer.

Navigation

Document map label: Enter an expression to use as a label to represent this item in the table of contents (document map).

Bookmark ID: Enter an expression to use as a locator for this sparkline. You will then be able to provide a bookmark link to this item from another report item using a Jump to bookmark action.

Filters

You need to provide three values to add a new filter to the collection: Expression, Operator, and Value.

Expression: Enter the expression to use for evaluating whether data should be included in the group.

Operator: Select from the following operators to decide how to compare the expression to the left with the value to the right.

Value: Enter a value to compare with the expression on the left based on the selected operator. For multiple values used with the Between operator, the lower two value boxes are enabled.

Values: When you choose the In operator, you can enter as many values as you need in this list.

Sorting

Click the plus sign button to enter new sort expressions, and remove them using the X button.

In the Expression box, enter an expression by which to sort the data in the group, and under Direction, select Ascending or Descending for the selected sort expression.

 

Data Output

Element name: Enter a name to be used in the XML output for this sparkline report control.

Output: Choose Auto, Yes, No, Contents Only to decide whether to include this Sparkline in the XML output. Choosing Auto exports the contents of the Sparkline report control.

See Also

How To