[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: Specify Sparkline Axis Settings

After you add sparkline charts to a worksheet, you can configure their horizontal and vertical axis settings to represent your data in the most efficient manner.

Expanded Horizontal Axis Options

To adjust the horizontal axis settings for a sparkline group, use the SparklineGroup.HorizontalAxis property. This property provides access to the SparklineHorizontalAxis object, which allows you to specify the following axis options.

  • Visibility

    To display the horizontal axis on a sparkline, set the SparklineColor.IsVisible property of the SparklineHorizontalAxis object to true. Note that the horizontal axis for a sparkline is displayed only when the sparkline data contains both positive and negative values; otherwise, the axis is not shown.

    To change the axis color, set the SparklineColor.Color property for the SparklineHorizontalAxis object.

  • Axis Type

    By default, when you create a sparkline, it uses the general axis type that displays data points on a sparkline at regular intervals. However, if the underlying data occurs in irregular periods of time, you can reflect these time intervals on a sparkline by spacing data markers out in proportion to the date (the longer the interval between dates, the longer the space between the corresponding data markers on a sparkline). To change the axis type to date axis, assign the cell range containing date values for the required sparkline group to the SparklineGroup.DateRange property. This will automatically convert the horizontal axis to the date axis (the SparklineHorizontalAxis.IsDateAxis property will return true).

  • Data Plotting Order

    If you wish to display data points on each sparkline in the sparkline group in the reverse direction (in right-to-left order), set the SparklineHorizontalAxis.RightToLeft property to true.

Expanded Vertical Axis Options

To specify scaling options for the vertical axis of a sparkline group, use the SparklineGroup.VerticalAxis property. This property allows you to specify how to calculate the minimum and maximum values for the vertical axis.

You can select one of the following options.

The example below demonstrates how to specify custom scaling values for the vertical axis of a sparkline group.

Expanded See Also

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