---
id: "T:cAlgo.API.LineStyle"
kind: "enum"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Chart/LineStyle/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# LineStyle (enum)

An enumeration of different stroke styles used to render lines.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public enum LineStyle
```

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This sample indicator shows how to use different line styles
    public partial class LineStyleSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.DrawVerticalLine("Dots", Chart.LastVisibleBarIndex, Color.Red, 3, LineStyle.Dots);
            Chart.DrawVerticalLine("DotsRare", Chart.LastVisibleBarIndex - 2, Color.Yellow, 3, LineStyle.DotsRare);
            Chart.DrawVerticalLine("DotsVeryRare", Chart.LastVisibleBarIndex - 4, Color.Green, 3, LineStyle.DotsVeryRare);
            Chart.DrawVerticalLine("Lines", Chart.LastVisibleBarIndex - 6, Color.Blue, 3, LineStyle.Lines);
            Chart.DrawVerticalLine("LinesDots", Chart.LastVisibleBarIndex - 8, Color.Magenta, 3, LineStyle.LinesDots);
            Chart.DrawVerticalLine("Solid", Chart.LastVisibleBarIndex - 10, Color.Brown, 3, LineStyle.Solid);
        }

        public override void Calculate(int index)
        {
            Result[index] = Bars.ClosePrices[index];
        }
    }
}
```

Python:

```python
class LineStyleSample():
    def initialize(self):
        api.Chart.DrawVerticalLine("Dots", api.Chart.LastVisibleBarIndex, Color.Red, 3, LineStyle.Dots)
        api.Chart.DrawVerticalLine("DotsRare", api.Chart.LastVisibleBarIndex - 2, Color.Yellow, 3, LineStyle.DotsRare)
        api.Chart.DrawVerticalLine("DotsVeryRare", api.Chart.LastVisibleBarIndex - 4, Color.Green, 3, LineStyle.DotsVeryRare)
        api.Chart.DrawVerticalLine("Lines", api.Chart.LastVisibleBarIndex - 6, Color.Blue, 3, LineStyle.Lines)
        api.Chart.DrawVerticalLine("LinesDots", api.Chart.LastVisibleBarIndex - 8, Color.Magenta, 3, LineStyle.LinesDots)
        api.Chart.DrawVerticalLine("Solid", api.Chart.LastVisibleBarIndex - 10, Color.Brown, 3, LineStyle.Solid)

    def calculate(self, index):
        api.Result[index] = api.Bars.ClosePrices[index]
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true,
  "LineOutputs": [
    {
      "Name": "Result",
      "DisplayName": "Main",
      "Color": "Red",
      "Style": "Dots"
    }
  ]
}
```

## Values

- `LineStyle.Solid` — A solid line: -----
- `LineStyle.Dots` — A dotted line: .....
- `LineStyle.DotsRare` — A dotted line, large gap between dots: . . . .
- `LineStyle.DotsVeryRare` — A dotted line, extra large gap between dots: . . . .
- `LineStyle.LinesDots` — A mixed line / dot style is used to render the line: - . - . - .
- `LineStyle.Lines` — Lines with gaps are used to render the line: - - - -

