> ## Documentation Index
> Fetch the complete documentation index at: https://gocharting.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# chart variables

> Reference for the 9 variables of the chart namespace: chart.bg_color, chart.fg_color, chart.is_heikinashi, chart.is_kagi and 5 more, each with its definition and an example.

> [!NOTE]
>
> Language version: 2 · Reference version: 2.7 · Date: 2026-10-25 · Compiler build: df7b3b14 · Namespace: chart · Entries: 10

## `chart` (library)

**Definition**

Values that describe the chart the script is drawn on: its colours (`chart.bg_color` and `chart.fg_color`) and its type (`chart.is_standard`, `chart.is_heikinashi`, `chart.is_renko` and the other `chart.is_*` values).

**Example**

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart Library Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_standard ? "Standard chart" : "Synthetic bars", color=chart.bg_color, textcolor=chart.fg_color)
}
```

## `chart.bg_color` (variable)

**Definition**

The background colour of the chart the script is drawn on, as set by the reader.

**Type**

`input color`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.bg_color Example", overlay=true)
if barstate.islast {
    // A label that blends in with the chart background, with contrasting text
    label.new(bar_index, high, text="Close", color=chart.bg_color, textcolor=chart.fg_color)
}
```

## `chart.fg_color` (variable)

**Definition**

A foreground colour that contrasts with the chart's background, for text and lines that must stay readable on both light and dark charts.

**Type**

`input color`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.fg_color Example", overlay=true)
plot(talib.sma(close, 20), title="SMA", color=chart.fg_color)
```

## `chart.is_heikinashi` (variable)

**Definition**

True when the chart type is Heikin Ashi. Charts built from synthetic bars do not show the instrument's real open, high, low and close, so a script can use this to warn the reader or to adjust its calculations.

**Type**

`simple bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.is_heikinashi Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_heikinashi ? "heikinashi chart" : "Another chart type")
}
```

## `chart.is_kagi` (variable)

**Definition**

True when the chart type is Kagi. Charts built from synthetic bars do not show the instrument's real open, high, low and close, so a script can use this to warn the reader or to adjust its calculations.

**Type**

`simple bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.is_kagi Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_kagi ? "kagi chart" : "Another chart type")
}
```

## `chart.is_linebreak` (variable)

**Definition**

True when the chart type is Line Break. Charts built from synthetic bars do not show the instrument's real open, high, low and close, so a script can use this to warn the reader or to adjust its calculations.

**Type**

`simple bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.is_linebreak Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_linebreak ? "linebreak chart" : "Another chart type")
}
```

## `chart.is_pnf` (variable)

**Definition**

True when the chart type is Point & Figure. Charts built from synthetic bars do not show the instrument's real open, high, low and close, so a script can use this to warn the reader or to adjust its calculations.

**Type**

`simple bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.is_pnf Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_pnf ? "pnf chart" : "Another chart type")
}
```

## `chart.is_range` (variable)

**Definition**

True when the chart type is Range. Charts built from synthetic bars do not show the instrument's real open, high, low and close, so a script can use this to warn the reader or to adjust its calculations.

**Type**

`simple bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.is_range Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_range ? "range chart" : "Another chart type")
}
```

## `chart.is_renko` (variable)

**Definition**

True when the chart type is Renko. Charts built from synthetic bars do not show the instrument's real open, high, low and close, so a script can use this to warn the reader or to adjust its calculations.

**Type**

`simple bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.is_renko Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_renko ? "renko chart" : "Another chart type")
}
```

## `chart.is_standard` (variable)

**Definition**

True when the chart type is a standard chart type (candles, bars, line or area). Charts built from synthetic bars do not show the instrument's real open, high, low and close, so a script can use this to warn the reader or to adjust its calculations.

**Type**

`simple bool`

**Example**

```lipi theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("chart.is_standard Example", overlay=true)
if barstate.islast {
    label.new(bar_index, high, text=chart.is_standard ? "standard chart" : "Another chart type")
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.