HtmlForgeX

API Reference

Class

ApexCharts

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Represents an ApexCharts component that can be embedded in the HTML output for displaying dynamic client-side charts.

Inheritance

Constructors

public ApexCharts() #

Initializes a new instance of the ApexCharts class.

Methods

public ApexCharts AddArea(String name, Double value) #
Returns: ApexCharts

Adds an area chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddBar(String name, Double value) #
Returns: ApexCharts

Adds a bar chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddBoxPlot(String x, Double min, Double q1, Double median, Double q3, Double max) #
Returns: ApexCharts

Adds a boxplot data point.

Parameters

x System.String requiredposition: 0
X value (category).
min System.Double requiredposition: 1
Minimum value.
q1 System.Double requiredposition: 2
First quartile.
median System.Double requiredposition: 3
Median value.
q3 System.Double requiredposition: 4
Third quartile.
max System.Double requiredposition: 5
Maximum value.

Returns

The current ApexCharts instance.

public ApexCharts AddBubble(Double x, Double y, Double z) #
Returns: ApexCharts

Adds a bubble chart data point.

Parameters

x System.Double requiredposition: 0
X coordinate.
y System.Double requiredposition: 1
Y coordinate.
z System.Double requiredposition: 2
Bubble size.

Returns

The current ApexCharts instance.

public ApexCharts AddBullet(String label, Double value, Double target = 100) #
Returns: ApexCharts

Adds a compact KPI-style bullet (horizontal bar) with an optional target marker using Apex "goals".

Parameters

label System.String requiredposition: 0
Bullet label/category.
value System.Double requiredposition: 1
Actual value.
target System.Double = 100 optionalposition: 2
Target marker value (default 100).
public ApexCharts AddCandlestick(String x, Double open, Double high, Double low, Double close) #
Returns: ApexCharts

Adds a candlestick data point.

Parameters

x System.String requiredposition: 0
X value (typically date/time).
open System.Double requiredposition: 1
Opening price.
high System.Double requiredposition: 2
High price.
low System.Double requiredposition: 3
Low price.
close System.Double requiredposition: 4
Closing price.

Returns

The current ApexCharts instance.

public ApexCharts AddColumn(String name, Double value) #
Returns: ApexCharts

Adds a column chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

AddDonut 3 overloads
public ApexCharts AddDonut(String name, Double value) #
Returns: ApexCharts

Adds a donut chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddDonut(String name, Double value, RGBColor color) #
Returns: ApexCharts

Adds a donut chart data point with a specific color.

Parameters

name System.String requiredposition: 0
value System.Double requiredposition: 1
color System.String requiredposition: 2
AddDonut(System.String name, System.Double value, HtmlForgeX.RGBColor color) #

Adds a donut chart data point with a specific color.

Parameters

name System.String required
value System.Double required
color HtmlForgeX.RGBColor required
public ApexCharts AddFunnel(String name, Double value) #
Returns: ApexCharts

Adds a funnel chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddHeatmap(String name, IEnumerable<ValueTuple<String, Double>> points) #
Returns: ApexCharts

Adds a heatmap series consisting of multiple points.

Parameters

name System.String requiredposition: 0
Series name.
points System.Collections.Generic.IEnumerable{System.ValueTuple{System.String,System.Double}} requiredposition: 1
Collection of points (X,Y).

Returns

The current ApexCharts instance.

public ApexCharts AddLine(String name, Double value) #
Returns: ApexCharts

Adds a line chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddMixed(String name, Double value) #
Returns: ApexCharts

Adds a data point for a mixed chart.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

AddPie 3 overloads
public ApexCharts AddPie(String name, Double value) #
Returns: ApexCharts

Adds a pie chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddPie(String name, Double value, RGBColor color) #
Returns: ApexCharts

Adds a pie chart data point with a specific color.

Parameters

name System.String requiredposition: 0
value System.Double requiredposition: 1
color System.String requiredposition: 2
AddPie(System.String name, System.Double value, HtmlForgeX.RGBColor color) #

Adds a pie chart data point with a specific color.

Parameters

name System.String required
value System.Double required
color HtmlForgeX.RGBColor required
public ApexCharts AddPolarArea(String name, Double value) #
Returns: ApexCharts

Adds a polar area chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddRadar(String name, Double value) #
Returns: ApexCharts

Adds a radar chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddRadialBar(String name, Double value) #
Returns: ApexCharts

Adds a radial bar chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddScatter(Double x, Double y) #
Returns: ApexCharts

Adds a scatter chart data point.

Parameters

x System.Double requiredposition: 0
X coordinate.
y System.Double requiredposition: 1
Y coordinate.

Returns

The current ApexCharts instance.

public ApexCharts AddSeries(String seriesName, params Double[] data) #
Returns: ApexCharts

Adds a series with multiple data points for multi-series charts.

Parameters

seriesName System.String requiredposition: 0
Name of the series.
data System.Double[] requiredposition: 1
Array of data values.

Returns

The current ApexCharts instance.

public ApexCharts AddStackedBar(String seriesName, params ValueTuple<String, Double>[] points) #
Returns: ApexCharts

Adds/extends a stacked bar series and aligns categories automatically.

Parameters

seriesName System.String requiredposition: 0
Series name.
points System.ValueTuple{System.String,System.Double}[] requiredposition: 1
Pairs of (category, value).
public ApexCharts AddTreemap(String name, Double value) #
Returns: ApexCharts

Adds a treemap chart data point.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts AddWaffle(Double percent) #
Returns: ApexCharts

Adds a 10x10 waffle chart showing a percentage fill using Heatmap.

Parameters

percent System.Double requiredposition: 0
Percentage 0..100.
public ApexCharts Animations(Boolean enabled, Int32 speed = 800) #
Returns: ApexCharts

Sets chart animations.

Parameters

enabled System.Boolean requiredposition: 0
Whether animations are enabled.
speed System.Int32 = 800 optionalposition: 1
Animation speed in milliseconds.

Returns

The current ApexCharts instance.

public ApexCharts Chart(Action<ApexChartOptions> configure) #
Returns: ApexCharts

Configures chart options using a fluent builder.

Parameters

configure System.Action{HtmlForgeX.ApexChartOptions} requiredposition: 0
Delegate used to configure chart options.

Returns

The current ApexCharts instance.

Colors 2 overloads
public ApexCharts Colors(params RGBColor[] colors) #
Returns: ApexCharts

Sets chart colors.

Parameters

colors System.String[] requiredposition: 0
Array of color values.

Returns

The current ApexCharts instance.

Colors(HtmlForgeX.RGBColor[] colors) #

Sets chart colors using RGBColor.

Parameters

colors HtmlForgeX.RGBColor[] required
Array of RGBColor values.

Returns

The current ApexCharts instance.

public ApexCharts Data(String name, Double value) #
Returns: ApexCharts

Adds a data point to the chart using the currently selected type.

Parameters

name System.String requiredposition: 0
Label for the data point.
value System.Double requiredposition: 1
Numeric value.

Returns

The current ApexCharts instance.

public ApexCharts DataLabels(Action<ApexDataLabelsOptions> configure) #
Returns: ApexCharts

Configures data labels options.

Parameters

configure System.Action{HtmlForgeX.ApexDataLabelsOptions} requiredposition: 0
Delegate used to configure data labels options.

Returns

The current ApexCharts instance.

public ApexCharts Fill(Action<ApexFillOptions> configure) #
Returns: ApexCharts

Configures fill options.

Parameters

configure System.Action{HtmlForgeX.ApexFillOptions} requiredposition: 0
Delegate used to configure fill options.

Returns

The current ApexCharts instance.

public ApexCharts Grid(Action<ApexGridOptions> configure) #
Returns: ApexCharts

Configures grid options using a fluent builder.

Parameters

configure System.Action{HtmlForgeX.ApexGridOptions} requiredposition: 0
Delegate used to configure grid options.

Returns

The current ApexCharts instance.

public ApexCharts Legend(Action<ApexLegendOptions> configure) #
Returns: ApexCharts

Configures legend options using a fluent builder.

Parameters

configure System.Action{HtmlForgeX.ApexLegendOptions} requiredposition: 0
Delegate used to configure legend options.

Returns

The current ApexCharts instance.

public ApexCharts PlotOptions(Action<ApexPlotOptions> configure) #
Returns: ApexCharts

Configures plot options using a fluent builder.

Parameters

configure System.Action{HtmlForgeX.ApexPlotOptions} requiredposition: 0
Delegate used to configure options.

Returns

The current ApexCharts instance.

RegisterLibraries() #

Registers the required libraries for ApexCharts.

public ApexCharts Responsive(Object value) #
Returns: ApexCharts

Sets the responsive option value.

Parameters

value System.Object requiredposition: 0
Responsive configuration object.

Returns

The current ApexCharts instance.

public ApexCharts SetOption(String key, Object value) #
Returns: ApexCharts

Sets a raw option value passed directly to the ApexCharts configuration.

Parameters

key System.String requiredposition: 0
Option key.
value System.Object requiredposition: 1
Option value.

Returns

The current ApexCharts instance.

public ApexCharts Stroke(Action<ApexStrokeOptions> configure) #
Returns: ApexCharts

Configures stroke options.

Parameters

configure System.Action{HtmlForgeX.ApexStrokeOptions} requiredposition: 0
Delegate used to configure stroke options.

Returns

The current ApexCharts instance.

public ApexCharts Theme(Action<ApexThemeOptions> configure) #
Returns: ApexCharts

Configures theme options.

Parameters

configure System.Action{HtmlForgeX.ApexThemeOptions} requiredposition: 0
Delegate used to configure theme options.

Returns

The current ApexCharts instance.

public ApexCharts Tooltip(Action<ApexTooltipOptions> configure) #
Returns: ApexCharts

Configures tooltip options using a fluent builder.

Parameters

configure System.Action{HtmlForgeX.ApexTooltipOptions} requiredposition: 0
Delegate used to configure tooltip options.

Returns

The current ApexCharts instance.

public override String ToString() #
Returns: String

Generates the HTML and JavaScript required to render the chart.

Returns

HTML markup representing the chart.

public ApexCharts ValueClamping(Action<ChartValueClampingOptions> configure) #
Returns: ApexCharts

Enables value clamping/rounding for this chart.

Parameters

configure System.Action{HtmlForgeX.ChartValueClampingOptions} requiredposition: 0
public ApexCharts XAxis(Action<ApexAxisOptions> configure) #
Returns: ApexCharts

Configures X-axis options.

Parameters

configure System.Action{HtmlForgeX.ApexAxisOptions} requiredposition: 0
Delegate used to configure X-axis options.

Returns

The current ApexCharts instance.

public ApexCharts YAxis(Action<ApexAxisOptions> configure) #
Returns: ApexCharts

Configures Y-axis options.

Parameters

configure System.Action{HtmlForgeX.ApexAxisOptions} requiredposition: 0
Delegate used to configure Y-axis options.

Returns

The current ApexCharts instance.

Properties

public String Id { get; set; } #

Gets or sets the DOM element identifier for the chart container.

public ApexChartType Type { get; set; } #

Gets or sets the type of chart to render.

public List<Double> Series { get; set; } #

Gets the numeric data series used by most chart types.

public List<String> Labels { get; set; } #

Gets the labels associated with Series values.

public List<ApexHeatmapSeries> HeatmapSeries { get; set; } #

Gets the heatmap specific series collection.

public List<ApexSeriesData> MultipleSeries { get; set; } #

Gets the multi-series data collection for charts like Line, Column, etc.

public List<ApexCandlestickSeries> CandlestickSeries { get; set; } #

Gets the candlestick specific series collection.

public List<ApexBubbleSeries> BubbleSeries { get; set; } #

Gets the bubble specific series collection.

public List<ApexBoxPlotSeries> BoxPlotSeries { get; set; } #

Gets the boxplot specific series collection.

public ApexChartsTitle Title { get; set; } #

Gets or sets the title configuration for the chart.

public ApexChartSubtitle Subtitle { get; set; } #

Gets the subtitle configuration.

public Dictionary<String, Object> Options { get; set; } #

Gets additional options passed directly to ApexCharts.

Fields

_sliceColors #

Optional per-slice colors for Pie/Donut charts aligned with Labels. When provided via AddPie/AddDonut overloads, these override global palette entries.

_title #

Gets the title configuration.

Extension Methods

public static ApexCharts Title(ApexCharts chart, String text) #
Returns: ApexCharts

Sets the main chart title text (mirrors ChartJs.Title.Text("…")).

Parameters

chart HtmlForgeX.ApexCharts requiredposition: 0
text System.String requiredposition: 1