[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Collapse]Spreadsheet Document API
   Product Structure
   Getting Started
  [Expand]Spreadsheet Document
   Supported Formats
  [Expand]Cell Basics
   Defined Names
   Data Binding
  [Expand]Pivot Tables
  [Expand]Charts and Graphics
  [Expand]Mail Merge
   [Expand]Rows and Columns
   [Expand]Import and Export Data
   [Expand]Data Binding
   [Expand]Mail Merge
     How to: Create Sparklines
     How to: Group and Ungroup Sparklines
     How to: Customize the Sparkline Appearance
     How to: Specify Sparkline Axis Settings
     How to: Delete Sparklines
   [Expand]Formatting Cells
   [Expand]Conditional Formatting
   [Expand]Group Data
   [Expand]Filter Data
   [Expand]Pivot Tables
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Customize the Sparkline Appearance

The example below demonstrates how to customize the sparkline appearance.

  • Specify a sparkline color

    To specify a color used to draw each sparkline in the sparkline group, use the SparklineGroup.SeriesColor property. For a group of line sparklines, you can also set the line weight by utilizing the SparklineGroup.LineWeight property.

  • Highlight data points

    You can highlight important data points on a sparkline by displaying and coloring markers on line sparklines, or by differentiating points by color on column and win/loss sparklines. To get access to the marker options, use the SparklineGroup.Points property, which returns the SparklinePoints object. The table below lists the object's properties used to show specific points on each sparkline in the sparkline group. All these properties return the SparklineColor object which controls the visibility and color of data markers.

    Thus, to display the desired marker on a line sparkline, use the corresponding property to get access to the SparklineColor object, and set the SparklineColor.IsVisible property to true. In case of column and win/loss sparklines (which display all data markers by default), setting the SparklineColor.IsVisible property highlights the proper sparkline bars using the color defined by the applied sparkline style. To apply a custom color to the marker, assign the desired color to the SparklineColor.Color property.

    Property Description
    SparklinePoints.Markers Displays all markers on a line sparkline to differentiate individual data points.
    SparklinePoints.Negative Highlights markers that correspond to all data values less than zero.
    SparklinePoints.Highest Highlights a marker that corresponds to the highest data value.
    SparklinePoints.Lowest Highlights a marker that corresponds to the lowest data value.
    SparklinePoints.First Highlights a marker that corresponds to the first data point.
    SparklinePoints.Last Highlights a marker that corresponds to the last data point.

The following image shows sparkline charts created by the code above (the workbook is opened in Microsoft® Excel®).

Expanded See Also

Is this topic helpful?​​​​​​​