> ## 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.

# Text and markers

> Attaching fixed text to plotshape and plotchar marks, and showing text built from data with label.new.

`plotshape` and `plotchar` mark the bars where a condition is true and may carry a fixed text. Text that depends on the data (a
price, a count) is a label.

## Fixed text on a mark

`text` on `plotshape` and `plotchar` is a `const string`: the same text on every mark. `textcolor` may change by bar; `size` and
`location` are `input` values. `plotchar` draws one `char` (a longer string is cut to its first character).

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Signals", overlay=true)
avg = talib.sma(close, 20)
plotshape(talib.crossover(close, avg), title="Buy", text="Buy", textcolor=color.green, location=location.belowbar, color=color.green, shape=shape.labelup, size=size.small)
plotchar(talib.crossunder(close, avg), title="Sell", char="S", location=location.abovebar, color=color.red)
```

Text built from data is refused:

```lipi-invalid theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Price on mark", overlay=true)
plotshape(close > open, text=str.tostring(close))
```

The compiler says: Cannot call `plotshape` with argument `text`=`str.tostring(close)`. An argument of `series string` type was used but a `const string` is expected. The same holds for `title`, and for `char` on `plotchar`.

## Text from data: label.new

`label.new(x, y, text, xloc, yloc, color, style, textcolor, size, textalign, tooltip, text_font_family, force_overlay, text_formatting)`
puts a label at bar `x` and price `y`, with any string. A label is a drawing: it may be created inside `if`, loops and functions,
and the oldest labels are removed past `max_labels_count` (see [Lines, labels, boxes and polylines](https://gocharting.com/docs/scripting/chart-output/drawings.md)).

```lipi wrap theme={"languages":{"custom":["/languages/lipi.json","/languages/lipi-invalid.json"]}}
//@lipi=2
indicator("Volume labels", overlay=true)
if close > open and volume > talib.sma(volume, 20) * 2 {
    label.new(bar_index, low, "Vol " + str.tostring(volume), style=label.style_label_up, color=color.green, textcolor=color.white, size=size.small)
}
```

Label text is limited to 999 characters, and `yloc` is `yloc.price`, `yloc.abovebar` or `yloc.belowbar`. For a grid of values, see [Tables](https://gocharting.com/docs/scripting/chart-output/tables.md).


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