Skip to main content

Sparkline Column

  • 2 minutes to read

A sparkline column visualizes the variation of summary values over time.

Grid_ColumnTypes

In code, sparkline columns are represented by the GridSparklineColumn class.

Data Binding Specifics

The sparkline column is bound to the measure providing sparkline values and to the dimension providing a numeric or date-time interval.

Grid_ColumnTypes_SparklineColumns_DataBinding

To bind the sparkline column to data in code, do the following.

Sparkline Options

You can control sparkline appearance settings using the Column Options dialog. To invoke this dialog, click the column type indicator (Grid_ColumnTypeIndicators_SparklineColumn).

Grid_Sparkline_ColumnOptionsDialog

In this dialog, you can control various settings that affect how the sparkline is displayed within a grid cell.

Grid_SparklineAppearance

Sparkline Options Description API
Show start/end values Species whether to display sparkline start/end values within a grid cell. GridSparklineColumn.ShowStartEndValues
Sparkline view type Defines the view type of a sparkline. Sparkline data points can be represented as area, line, bars, or win and loss squares. SparklineOptions.ViewType
Highlight min/max points Specifies whether to highlight the minimum/maximum points of a sparkline. SparklineOptions.HighlightMinMaxPoints
Highlight start/end points Specifies whether to highlight the start/end points of a sparkline. SparklineOptions.HighlightStartEndPoints

The following code snippet creates the Sparkline column:

var grid = new GridDashboardItem();
grid.DataSource = dataSource;

var gridSparkline = new GridSparklineColumn();
gridSparkline.Measure = new Measure("Count");
gridSparkline.SparklineOptions.ViewType = SparklineViewType.Line;
grid.SparklineArgument = new Dimension("Date", DateTimeGroupInterval.MonthYear);

grid.Columns.Add(gridSparkline);
See Also