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
categoriesIEnumerable<string>The category axis labels — one per data point in every series.
seriesIEnumerable<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
categoriesorseriesis null.- ArgumentException
categoriesis empty,seriesis empty, or a series' value count does not matchcategories' count.
Properties
Categories
The category axis labels — one per data point in every series.
public IReadOnlyList<string> Categories { get; }
Property Value
Series
One or more named value series, plotted against Categories.
public IReadOnlyList<ChartSeries> Series { get; }