# Specifying Horizontal and Vertical Axes

Spread for ASP.NET allows you to display a horizontal axis or vertical axis with sparkline graphs. Learn more in documentation.

## Content

The horizontal axis has a general type. The general type specifies that all the points are painted along the axis at the same distance.
Set the [DisplayXAxis](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.DisplayXAxis.html) property if you wish to display the axis line. The following image displays all three points on the graph.
![Date Axis](https://cdn.mescius.io/document-site-files/images/346c9178-0ed8-4fb9-908b-1565b22fb408/artwork/sparkdata.png)
You can specify different minimum and maximum value options for the vertical axis. The automatic option allows each sparkline to have a different minimum and maximum value. The same option uses the same minimum and maximum value for all the sparklines. The custom option allows you to specify the minimum and maximum value for all the sparklines in a group.
If the custom option is used for the vertical axis, and the minimum value is equal to or larger than all data points, points or lines are not drawn. Lines or columns are truncated if they are not completely in the drawing area. If a column sparkline has at least one point drawn completely or partially, then all columns with values less than the minimum are drawn as thin columns that extend down.
See the [ManualMax](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.ManualMax.html),[ManualMin](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.ManualMin.html), [MaxAxisType](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.MaxAxisType.html), and [MinAxisType](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.MinAxisType.html) properties in the [ExcelSparklineSetting](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.html) class for vertical axis examples.

## Using Code

1. Create an [ExcelSparklineSetting](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.html) object.
2. Set the [DisplayXAxis](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.DisplayXAxis.html) property to true if you wish to display the axis.
3. Add values and dates to the cells.
4. Add the sparkline to the cell.

## Example

This example creates a column sparkline in a cell with a horizontal axis.

```csharp
FarPoint.Web.Spread.ExcelSparklineSetting ex = new FarPoint.Web.Spread.ExcelSparklineSetting();
ex.DisplayXAxis = true;
ex.Formula = "Sheet1!$A$1:$C$1";
fpSpread1.Sheets[0].RowCount = 4;
fpSpread1.Sheets[0].ColumnCount = 4;
fpSpread1.Sheets[0].Cells[0, 0].Text = "1/2/2011";
fpSpread1.Sheets[0].Cells[0, 1].Text = "1/3/2011";
fpSpread1.Sheets[0].Cells[0, 2].Text = "1/5/2011";
fpSpread1.Sheets[0].Cells[1, 0].Value = 2;
fpSpread1.Sheets[0].Cells[1, 1].Value = 11;
fpSpread1.Sheets[0].Cells[1, 2].Value = 4;
fpSpread1.Sheets[0].AddSparkline("Sheet1!$A$2:$C$2", "Sheet1!$D$2:$D$2", FarPoint.Web.Spread.SparklineType.Column, ex);
```

```vbnet
Dim ex As New FarPoint.Web.Spread.ExcelSparklineSetting()
ex.DisplayXAxis = True
ex.Formula = "Sheet1!$A$1:$C$1"
FpSpread1.Sheets(0).RowCount = 4
FpSpread1.Sheets(0).ColumnCount = 4
FpSpread1.Sheets(0).Cells(0, 0).Text = "1/2/2011"
FpSpread1.Sheets(0).Cells(0, 1).Text = "1/3/2011"
FpSpread1.Sheets(0).Cells(0, 2).Text = "1/5/2011"
FpSpread1.Sheets(0).Cells(1, 0).Value = 2
FpSpread1.Sheets(0).Cells(1, 1).Value = 11
FpSpread1.Sheets(0).Cells(1, 2).Value = 4
FpSpread1.Sheets(0).AddSparkline("Sheet1!$A$2:$C$2", "Sheet1!$D$2:$D$2", FarPoint.Web.Spread.SparklineType.Column, ex)
```

## Using the Spread Designer

1. Type data in a cell or a column or row of cells in the designer.
2. Type dates in a cell or a column or row of cells in the designer.
3. Select a cell for the sparkline.
4. Select the **Insert** menu.
5. Select a sparkline type.
6. Set the **Data Range** in the **Create Sparklines** dialog (such as =Sheet1!$E$1:$E$3).
7. Select **OK**.
8. Select the sparkline cell, select the **Axis** icon, and then make any changes to the axis.
9. Select **Apply and Exit** from the **File** menu to save your changes and close the designer.

## See Also

[ExcelSparklineSetting Class](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.ExcelSparklineSetting.html)
[SparklineType Enumeration](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SparklineType.html)
[AddSparkline Method](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.SheetView.AddSparkline.html)