Table of Contents

Class XlsxSparkline

Namespace
DocToolkit
Assembly
DocToolkit.Xlsx.dll

A sparkline: a small chart drawn inside one cell, summarising a range on the same sheet.

public sealed class XlsxSparkline
Inheritance
XlsxSparkline
Inherited Members

Remarks

Unlike XlsxTable or a conditional rule, a sparkline names two places — the cell it is drawn in, and the range it reads. Both are on the sheet Format(byte[], string, XlsxFormat) is given, and neither may carry a sheet qualifier.

Properties

Cell

The cell the sparkline is drawn in, such as D1. A single cell, not a range.

public string Cell { get; }

Property Value

string

Kind

The sparkline's shape.

public XlsxSparklineKind Kind { get; }

Property Value

XlsxSparklineKind

SourceRange

The range the sparkline summarises, such as A1:C1.

public string SourceRange { get; }

Property Value

string

Methods

At(string, string, XlsxSparklineKind)

Draws a sparkline in cell from sourceRange.

public static XlsxSparkline At(string cell, string sourceRange, XlsxSparklineKind kind = XlsxSparklineKind.Line)

Parameters

cell string

The cell to draw in, such as D1. A single cell, not a range.

sourceRange string

The range to summarise, such as A1:C1.

kind XlsxSparklineKind

The shape. Defaults to Line.

Returns

XlsxSparkline

Exceptions

ArgumentNullException

Either string argument is null.

ArgumentException

cell or sourceRange is blank or names a sheet.