Table of Contents

Class ChartData

Namespace
DocToolkit
Assembly
DocToolkit.Primitives.dll

The categories and series a chart plots — one category axis shared by every series, the same shape OfficeIMO.Drawing.OfficeChartData uses, which is what lets AddChart methods on WorkbookEditor and PresentationEditor share one data model.

public sealed class ChartData
Inheritance
ChartData
Inherited Members

Constructors

ChartData(IEnumerable<string>, IEnumerable<ChartSeries>)

Creates the data behind a chart: the labels along the category axis, and one or more named series plotted against them.

public ChartData(IEnumerable<string> categories, IEnumerable<ChartSeries> series)

Parameters

categories IEnumerable<string>

The category axis labels — one per data point in every series.

series IEnumerable<ChartSeries>

One or more named value series, plotted against categories.

Remarks

Every series must carry exactly as many values as there are categories. That is checked here rather than at render time, so a mismatch is reported against the argument that caused it instead of surfacing later as a malformed chart.

Exceptions

ArgumentNullException

categories or series is null.

ArgumentException

categories is empty, series is empty, or a series' value count does not match categories' count.

Properties

Categories

The category axis labels — one per data point in every series.

public IReadOnlyList<string> Categories { get; }

Property Value

IReadOnlyList<string>

Series

One or more named value series, plotted against Categories.

public IReadOnlyList<ChartSeries> Series { get; }

Property Value

IReadOnlyList<ChartSeries>