WithChartItems
Enables you to examine and perform a wide array of operations against a traditional chart that uses the Expression data bind. This includes providing series with data, returning useful information, disabling or enabling some or all of a chart, altering certain visual properties, and more. The function has no effect on charts that use other data bind types.
The effects of the function will persist for the duration of the active session, but it cannot make permanent changes to a chart definition.
The exact purpose of the function is defined by its first parameter, InstructionType. The remaining parameters are specific to the instruction type used. To start using this function, begin by calling the Initialise instruction followed by one or more other instructions, and lastly call the Close instruction, which commits all changes and updates the rendered chart.
The following table contains a list of all available instructions:
Instruction Name | Integer | Instruction Sub-type | Description | Further Reading |
---|---|---|---|---|
Initialise | 1 | - | Initialises a chart definition. | WithChartItems (Initialise) |
GetSeriesCount | 2 | - | Returns the total number of series in the initialised chart area. | WithChartItems (GetSeriesCount) |
GetSeriesName | 3 | - | Returns a series name based on its index. | WithChartItems (GetSeriesName) |
AddSeries | 4 | - | Adds a series to a specific chart area. | WithChartItems (AddSeries) |
UpdateSeries | 5 | - | Assigns a series to a different chart area, or creates a new series in that chart area if it does not already exist. | WithChartItems (UpdateSeries) |
RemoveSeries | 6 | - | Deletes a series. | WithChartItems (RemoveSeries) |
ClearAllSeries | 7 | - | Removes all series from all chart areas. | WithChartItems (ClearAllSeries) |
SetSeriesColour | 8 | - | Defines the colour of a series. | WithChartItems (SetSeriesColour) |
SetSeriesChartType | 9 | - | Defines the chart type of a series. | WithChartItems (SetSeriesChartType) |
InitialiseChartArea | 10 | - | Initialises a chart area. | WithChartItems (InitialiseChartArea) |
CloseChartArea | 11 | - | Closes the currently initialised chart area and commits all changes made to it, updating the rendered chart. | WithChartItems (CloseChartArea) |
Close | 12 | - | Closes the initialised chart definition and commits all changes made to it. | WithChartItems (Close) |
SetSeriesEnabled | 13 | - | Enables or disables a series. A disabled series will not appear in the rendered chart. | WithChartItems (SetSeriesEnabled) |
SetSeriesOption | 14 | - | Defines generic and chart-specific options for a series. | WithChartItems (SetSeriesOption) |
SetSeriesDataPointOption | 15 | - | Defines generic and chart-specific options for a data point. | WithChartItems (SetSeriesDataPointOption) |
SetSeriesChartArea | 16 | - | Maps an existing series to a specific chart area. | WithChartItems (SetSeriesChartArea) |
GetDataPointYValue | 17 | - | Returns the Y-axis value of a data point. | WithChartItems (GetDataPointYValue) |
SetDataPointYValue | 18 | - | Sets the Y-axis value of a data point. | WithChartItems (SetDataPointYValue) |
GetDataPointXValue | 19 | - | Returns the X-axis value of a data point. | WithChartItems (GetDataPointXValue) |
SetDataPointXValue | 20 | - | Sets the X-axis value of a data point. | WithChartItems (SetDataPointXValue) |
AddDataPoint | 21 | - | Creates a new data point in a specific series. | WithChartItems (AddDataPoint) |
RemoveDataPoint | 22 | - | Removes a data point from a specific series. | WithChartItems (RemoveDataPoint) |
SetDataPointItem | 23 | Tooltip | Changes the tooltip style of a data point. | WithChartItems (SetDataPointItem - Tooltip) |
SetDataPointItem | 23 | Marker | Changes the marker style of a data point. | WithChartItems (SetDataPointItem - Marker) |
SetDataPointItem | 23 | Colour | Defines the colour of a data point. | WithChartItems (SetDataPointItem - Colour) |
AddCustomLegend | 24 | - | Defines new settings for an existing legend, or creates a new one. | WithChartItems (AddCustomLegend) |
ClearCustomLegend | 25 | - | Removes a custom legend. | WithChartItems (ClearCustomLegend) |
ClearDataPoints | 26 | - | Removes all data points from a specific series. | WithChartItems (ClearDataPoints) |
GetDataPointCount | 27 | - | Returns the total number of data points in a specific series. | WithChartItems (GetDataPointCount) |
SetChartAreaItem | 28 | ChartArea | Enables or disables a chart area. | WithChartItems (SetChartAreaItem - ChartArea) |
SetChartAreaItem | 28 | Axis | Configures a chart axis. | WithChartItems (SetChartAreaItem - Axis) |