IGraphSpecs

Defines the public contract for the GraphSpecs class, exposing series accessors for simple (non-time-series) charts and a nested collection of graph specification entries for complex (time series) charts. Consumers call CreateSeries to populate the series data, then read individual series properties or the SpecsLists collection depending on the graph mode. Graph specs creation mode

SeriesAccess

NumberOfSeries #

Number of chart series in simple mode

Signature:

Public Property Get NumberOfSeries() As Long: End Property

Series accessors for simple mode (non-time-series charts). Returns the count of series pushed during simple mode building. Always returns 0 in complex mode or before CreateSeries is called.

Returns: Long. Count of series entries (1-based).


SeriesName #

Named range reference for series data at a given index

Signature:

Public Property Get SeriesName(ByVal index As Long) As String: End Property

Returns the Excel named range string (e.g. "VALUES_COL_1_table1") that a chart builder uses as the data source for this series.

Parameters:

  • index: Long. 1-based index of the series (1 to NumberOfSeries).

Returns: String. Named range reference for the series data.


SeriesType #

Chart rendering type for a series at a given index

Signature:

Public Property Get SeriesType(ByVal index As Long) As String: End Property

Returns the chart type string controlling how the series is rendered. Common values are "bar", "hbar", "point", and "line".

Parameters:

  • index: Long. 1-based series index.

Returns: String. Chart rendering type.


SeriesPos #

Axis position for a series at a given index

Signature:

Public Property Get SeriesPos(ByVal index As Long) As String: End Property

Returns "left" for the primary value axis or "right" for the secondary axis, typically used for percentage overlays.

Parameters:

  • index: Long. 1-based series index.

Returns: String. Axis placement ("left" or "right").


SeriesLabel #

Row category named range for a series at a given index

Signature:

Public Property Get SeriesLabel(ByVal index As Long) As String: End Property

Returns the named range providing category axis labels (e.g. "ROW_CATEGORIES_table1") displayed along the chart axis.

Parameters:

  • index: Long. 1-based series index.

Returns: String. Named range for row category labels.


SeriesColumnLabel #

Column label named range for a series at a given index

Signature:

Public Property Get SeriesColumnLabel(ByVal index As Long) As String: End Property

Returns the named range providing the legend entry text (e.g. "LABEL_COL_2_table1") that identifies this series in the chart legend.

Parameters:

  • index: Long. 1-based series index.

Returns: String. Named range for the legend entry.


SeriesLabelPrefix #

Label prefix for a series at a given index

Signature:

Public Property Get SeriesLabelPrefix(ByVal index As Long) As String: End Property

Returns the optional display prefix prepended to the series legend entry. Always vbNullString in simple mode; populated in complex mode from the user-defined "label" column of the graph setup table.

Parameters:

  • index: Long. 1-based series index.

Returns: String. Prefix string or vbNullString when none is set.


ComplexAccess

NumberOfGraphs #

Number of distinct graphs in complex mode

Signature:

Public Property Get NumberOfGraphs() As Long: End Property

Multi-graph accessors for complex (time series) mode. Returns the count of unique graph IDs whose series were successfully built. Returns 0 in simple mode or before CreateSeries is called.

Returns: Long. Count of graph entries in the SpecsLists collection.


SpecsLists #

Nested collection of all graph specifications

Signature:

Public Property Get SpecsLists() As BetterArray: End Property

Each element is a 7-element BetterArray representing one graph: [seriesNames, seriesTypes, seriesPositions, seriesLabels, seriesColumnLabels, seriesLabelPrefixes, titleString]. Returns an empty BetterArray in simple mode.

Returns: BetterArray. Cloned collection of graph spec entries.


GraphIDs #

Unique graph identifiers for complex mode

Signature:

Public Property Get GraphIDs() As BetterArray: End Property

Returns a deduplicated list of graph ID strings in the order of first appearance in the graph setup ListObject. Useful for iterating over graphs independently of SpecsLists.

Returns: BetterArray. Cloned list of unique graph ID strings.


State

Valid #

Whether the graph specifications were successfully built

Signature:

Public Property Get Valid() As Boolean: End Property

Validity and worksheet accessors. Triggers a lazy CreateSeries call on first access. In simple mode always returns True; in complex mode returns True only when at least one graph produced valid series definitions.

Returns: Boolean. True when series data is available for consumption.


Wksh #

Output worksheet where the chart will be drawn

Signature:

Public Property Get Wksh() As Worksheet: End Property

In simple mode returns the cross-table worksheet; in complex mode returns the dedicated output worksheet supplied during construction.

Returns: Worksheet. Target worksheet for chart creation.


Operations

CreateSeries #

Build all series from the stored specifications

Signature:

Public Sub CreateSeries(): End Sub

Series building entry point. Dispatches to the appropriate builder based on the graph mode. Must be called before accessing series properties or SpecsLists. Also called lazily by the Valid property on first access.