> For the complete documentation index, see [llms.txt](https://vc-docs.gitbook.io/engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vc-docs.gitbook.io/engine/home/doxygen_synced/classes/class_chart_gen.md).

# ChartGen

**Usage:** `api.ChartGen.GenerateLineGraph(x, y, "V", "I", "Chart", anchor, 640, 320)`

Draw line graphs in the scene.

## Public Functions

|             | Name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IEnumerator | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_chart_gen.md#function-inner_generatelinegraph"><strong>inner\_generateLineGraph</strong></a>(List< float > X, List< float > Y, string XLabel, string YLabel, string title, GameObject anchorUI, float sizeX, float sizeY, int HighlightIndex)<br>The work behind GenerateLineGraph. Prefer calling GenerateLineGraph instead of this directly.</p>                                              |
| void        | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_chart_gen.md#function-generatelinegraph"><strong>GenerateLineGraph</strong></a>(List< float > X, List< float > Y, string XLabel, string YLabel, string title, GameObject anchorUI, float sizeX, float sizeY, int HighlightIndex =-1)<br>Draws a line graph of the given X/Y values as a UI element inside <em>anchorUI</em>. Optionally highlights one point with a red marker and a label.</p> |

## Public Attributes

|                    | Name                                                                                                                                                                                                                                                         |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| List< GameObject > | <p><a href="https://git.unimetaverse.net/vc-core-engine/doxygen/-/tree/main/Classes/Classes/class_chart_gen.md#variable-createdcharts"><strong>CreatedCharts</strong></a><br>The charts created so far, so they can be cleaned up when the script stops.</p> |

## Public Functions Documentation

### function inner\_generateLineGraph

```csharp
static IEnumerator inner_generateLineGraph(
    List< float > X,
    List< float > Y,
    string XLabel,
    string YLabel,
    string title,
    GameObject anchorUI,
    float sizeX,
    float sizeY,
    int HighlightIndex
)
```

The work behind GenerateLineGraph. Prefer calling GenerateLineGraph instead of this directly.

**Parameters**:

* **X** X-axis values.
* **Y** Y-axis values.
* **XLabel** X-axis label.
* **YLabel** Y-axis label (also the line's name).
* **title** Chart title.
* **anchorUI** UI object to place the chart inside.
* **sizeX** Chart width.
* **sizeY** Chart height.
* **HighlightIndex** Index of a point to highlight, or negative for none.

**Return**: Coroutine enumerator.

### function GenerateLineGraph

```csharp
static void GenerateLineGraph(
    List< float > X,
    List< float > Y,
    string XLabel,
    string YLabel,
    string title,
    GameObject anchorUI,
    float sizeX,
    float sizeY,
    int HighlightIndex =-1
)
```

Draws a line graph of the given X/Y values as a UI element inside *anchorUI*. Optionally highlights one point with a red marker and a label.

**Parameters**:

* **X** X-axis values.
* **Y** Y-axis values.
* **XLabel** X-axis label.
* **YLabel** Y-axis label (also the line's name).
* **title** Chart title.
* **anchorUI** UI object to place the chart inside.
* **sizeX** Chart width.
* **sizeY** Chart height.
* **HighlightIndex** Index of a point to highlight; leave as -1 for none.

## Public Attributes Documentation

### variable CreatedCharts

```csharp
static List< GameObject > CreatedCharts;
```

The charts created so far, so they can be cleaned up when the script stops.

***

Updated on 2026-07-22 at 12:00:00 +0800
