Table of Contents

Class ChartDocumentBuilder

Namespace
OdfKit.Chart
Assembly
OdfKit.dll

Provides a fluent construction flow for high-level chart documents. 提供高階圖表文件的 Fluent 建構流程。

public sealed class ChartDocumentBuilder
Inheritance
ChartDocumentBuilder
Inherited Members

Methods

Build()

Completes construction and returns the chart document. 完成建構並回傳圖表文件。

public ChartDocument Build()

Returns

ChartDocument

The constructed ChartDocument. / 建構完成的 ChartDocument

ConfigureSeries(int, Action<ChartSeriesBuilder>)

Configures the specified data series. 設定指定資料序列。

public ChartDocumentBuilder ConfigureSeries(int index, Action<ChartSeriesBuilder> configure)

Parameters

index int

The zero-based series index. / 序列索引(從 0 起算)。

configure Action<ChartSeriesBuilder>

The series configuration delegate. / 序列配置委派。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

With3D(Action<OdfChart3DOptions>)

Applies practical 3D chart options. 套用實務 3D 圖表選項。

public ChartDocumentBuilder With3D(Action<OdfChart3DOptions> configure)

Parameters

configure Action<OdfChart3DOptions>

The 3D options configuration delegate. / 3D 選項設定委派。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithAxis(string, Action<ChartAxisBuilder>)

Configures the axis for the specified dimension. 設定指定維度座標軸。

public ChartDocumentBuilder WithAxis(string dimension, Action<ChartAxisBuilder> configure)

Parameters

dimension string

The axis dimension, e.g. x, y, z. / 座標軸維度,例如 x、y、z。

configure Action<ChartAxisBuilder>

The axis configuration delegate. / 座標軸配置委派。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithBubbleSeries(params OdfBubbleChartSeriesRequest[])

Replaces the chart data with bubble chart series. 以泡泡圖序列取代圖表資料。

public ChartDocumentBuilder WithBubbleSeries(params OdfBubbleChartSeriesRequest[] series)

Parameters

series OdfBubbleChartSeriesRequest[]

The bubble chart series requests. / 泡泡圖序列要求。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithDataRange(string, OdfCellRange)

Short overload of WithDataRange that accepts sheetName and range; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 sheetName 與 range;其餘可選參數使用預設值並轉呼叫最長 WithDataRange 多載。

public ChartDocumentBuilder WithDataRange(string sheetName, OdfCellRange range)

Parameters

sheetName string
range OdfCellRange

Returns

ChartDocumentBuilder

WithDataRange(string, OdfCellRange, bool)

Short overload of WithDataRange that accepts sheetName, range, and firstRowAsHeader; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 sheetName、range 與 firstRowAsHeader;其餘可選參數使用預設值並轉呼叫最長 WithDataRange 多載。

public ChartDocumentBuilder WithDataRange(string sheetName, OdfCellRange range, bool firstRowAsHeader)

Parameters

sheetName string
range OdfCellRange
firstRowAsHeader bool

Returns

ChartDocumentBuilder

WithDataRange(string, OdfCellRange, bool, bool)

Sets the chart data range. 設定圖表資料範圍。

public ChartDocumentBuilder WithDataRange(string sheetName, OdfCellRange range, bool firstRowAsHeader, bool firstColumnAsLabel)

Parameters

sheetName string

The sheet name. / 工作表名稱。

range OdfCellRange

The cell range. / 儲存格範圍。

firstRowAsHeader bool

Whether the first row is treated as a header row. / 首列是否視為標題列。

firstColumnAsLabel bool

Whether the first column is treated as a category label. / 首欄是否視為分類標籤。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithLegend()

Short overload of WithLegend that uses default values for all optional parameters and forwards to the full overload. 便利多載:WithLegend 的所有可選參數使用預設值並轉呼叫最長多載。

public ChartDocumentBuilder WithLegend()

Returns

ChartDocumentBuilder

WithLegend(string?)

Short overload of WithLegend that accepts position; remaining optional parameters use defaults and forward to the full overload. 便利多載:提供 position;其餘可選參數使用預設值並轉呼叫最長 WithLegend 多載。

public ChartDocumentBuilder WithLegend(string? position)

Parameters

position string

Returns

ChartDocumentBuilder

WithLegend(string?, string?)

Sets the legend layout. 設定圖例配置。

public ChartDocumentBuilder WithLegend(string? position, string? alignment)

Parameters

position string

The legend position; blank hides the legend. / 圖例位置;空白表示隱藏圖例。

alignment string

The legend alignment. / 圖例對齊方式。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithPreset(OdfChartPreset)

Sets the chart type and practical defaults from a preset. 依圖表預設設定圖表類型與實務預設值。

public ChartDocumentBuilder WithPreset(OdfChartPreset preset)

Parameters

preset OdfChartPreset

The chart preset. / 圖表預設。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithStockMarkers(OdfStockMarkerStyle)

Applies practical stock marker styles. 套用實務股票圖標記樣式。

public ChartDocumentBuilder WithStockMarkers(OdfStockMarkerStyle style)

Parameters

style OdfStockMarkerStyle

The stock marker style. / 股票圖標記樣式。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithStockSeries(params OdfStockChartSeriesRequest[])

Replaces the chart data with stock chart series. 以股票圖序列取代圖表資料。

public ChartDocumentBuilder WithStockSeries(params OdfStockChartSeriesRequest[] series)

Parameters

series OdfStockChartSeriesRequest[]

The stock chart series requests. / 股票圖序列要求。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithStyles(OdfStyleSet)

Sets the style set this builder applies to subsequently created chart series. 設定此 builder 後續建立圖表序列會套用的樣式集合。

public ChartDocumentBuilder WithStyles(OdfStyleSet styles)

Parameters

styles OdfStyleSet

The style set. / 樣式集合。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithStyles(Action<OdfStyleSet>)

Sets the style set this builder applies to subsequently created chart series. 設定此 builder 後續建立圖表序列會套用的樣式集合。

public ChartDocumentBuilder WithStyles(Action<OdfStyleSet> configure)

Parameters

configure Action<OdfStyleSet>

The style set configuration delegate. / 樣式集合設定委派。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithTitle(string?)

Sets the chart title. 設定圖表標題。

public ChartDocumentBuilder WithTitle(string? title)

Parameters

title string

The chart title. / 圖表標題。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。

WithType(OdfChartType)

Sets the chart type. 設定圖表類型。

public ChartDocumentBuilder WithType(OdfChartType chartType)

Parameters

chartType OdfChartType

The chart type. / 圖表類型。

Returns

ChartDocumentBuilder

The current builder. / 目前 builder。