# Line Chart

## Purpose

Line graphs are used to track changes over short and long periods of time. When smaller changes exist, line graphs are better to use than bar graphs. Line graphs can also be used to compare changes over the same period of time for more than one group.&#x20;

## Variations <a href="#chart-variations" id="chart-variations"></a>

![](/files/JM0UCJHVMGl2bOGk82IN)

‌There are several variations of Line charts which are supported through the configuration of data and component properties.

* Basic Line Chart&#x20;
* Spline Line Chart&#x20;
* Step line Line Chart&#x20;
* Dashed Line Chart
* Gradient Line Chart

## Working with Data

‌The data format for the Line chart is the same as for other Lowcodera charts. You can bind your chart component's **`items`** property to a Power Apps collection which includes either static data or dynamic data e.g. SharePoint. &#x20;

{% tabs %}
{% tab title="Static Collection Example" %}
In this example, a collection with static data called `LineChartColBasics` is defined in the Power App. The **`items`** property of the line chart component is then bound to this collection.

```csharp
Table(
    {
        name: "Actual",
        data: ForAll([
            {
                label: 2001,
                value: 44
            },
            {
                label: 2002,
                value: 60
            },
            {
                label: 2003,
                value: 28
            },
            {
                label: 2004,
                value: 32
            },
            {
                label: 2005,
                value: 36
            },
            {
                label: 2006,
                value: 43
            },
            {
                label: 2007,
                value: 55
            },
            {
                label: 2008,
                value: 21
            }
        ],{Value: ThisRecord})
    },
    {
        name: "Budgeted",
        data: ForAll([
            {
                label: 2001,
                value: 25
            },
            {
                label: 2002,
                value: 42
            },
            {
                label: 2003,
                value: 50
            },
            {
                label: 2004,
                value: 18
            },
            {
                label: 2005,
                value: 17
            },
            {
                label: 2006,
                value: 19
            },
            {
                label: 2007,
                value: 58
            },
            {
                label: 2008,
                value: 35
            }
        ],{Value: ThisRecord})
    }
)
```

The above code snippet will generate the following line chart.

![](/files/-Mkg-pFWsVhVf27OXySC)
{% endtab %}

{% tab title="Dyamic Collection Example" %}
The below example represents, Dataverse table's data in a dynamic manner. The dataverse table structure looks like below:

![](/files/-MlKMKdWBnSBmzEjZ7So)

The below code snippet will generate dynamic collection to be consumed by component.

```csharp
Table(
    {
        name: "Actual",
        data: ForAll(
            Finances,
            {
                Value: {
                    label: ThisRecord.Year,
                    value: ThisRecord.Actual
                }
            }
        )
    },
    {
        name: "Budgeted",
        data: ForAll(
            Finances,
            {
                Value: {
                    label: ThisRecord.Year,
                    value: ThisRecord.Budget
                }
            }
        )
    }
)
```

{% endtab %}

{% tab title="Property Configuration" %}
All control properties can be left as default
{% endtab %}
{% endtabs %}

## Chart Properties

{% hint style="info" %}
For a full listing of all chart properties see the [**chart components property reference**](/component-properties/chart-components.md)&#x20;
{% endhint %}

The properties below are the main ones which change this components appearance and behaviours.

<table data-header-hidden><thead><tr><th>Control Property</th><th>Description</th><th>Accepted Values</th><th width="150">Required</th></tr></thead><tbody><tr><td><strong>Property</strong></td><td><strong>Description</strong></td><td><strong>Accepted Values</strong></td><td>Required</td></tr><tr><td>LineType</td><td>Property to show different types of lines</td><td><p>Smooth</p><p>Stepline</p><p>Straight</p></td><td>X</td></tr><tr><td>DataLabelSymbol</td><td>Property to add any symbol (eg. currency or any appened words) along with data labels</td><td>Text</td><td>X</td></tr><tr><td>ShowReversed</td><td>Property to represent the Y-Axis from the right side</td><td>Boolean</td><td>X</td></tr><tr><td>FillType</td><td>Property to choose fill type for lines.</td><td><p>Gradient</p><p>Image</p><p>Solid</p></td><td>X</td></tr><tr><td>BackgroundImage</td><td>Property to provide background image URL for lines</td><td>URL</td><td>X</td></tr></tbody></table>

## Examples

### Spline Line Chart

![](/files/-Mkg-ySK7cc66_MD1Lgy)

{% tabs %}
{% tab title="Data Configuration" %}
A single or multiple data series is defined in the collection. You can use the same collection used in [section](/line-chart.md#working-with-data).&#x20;
{% endtab %}

{% tab title="Property Configuration" %}

* [x] `LineType` property is set to **Smooth**
* [x] All other control properties can be left as default
  {% endtab %}
  {% endtabs %}

### Stepline Line Chart

![Stepline line chart](/files/-Mkg08CfMjyMfT94EdXF)

{% tabs %}
{% tab title="Data Configuration" %}
More than one data series is defined in the data collection

```
ClearCollect(
    ColStepline,
    {
        data: ForAll(
            'Malaga Weather',
            {
                Value: {
                    label: ThisRecord.Date,
                    value: ThisRecord.Temperature
                }
            }
        ),
        name: "Malaga"
    }
);

```

{% endtab %}

{% tab title="Property Configuration" %}

* [x] `LineType` property is set to **Stepline**
* [x] &#x20;All other control properties can be left as default
  {% endtab %}
  {% endtabs %}

### Dashed Line Chart

![](/files/-Mkg0F9Be5DnI2ZKzDd6)

{% tabs %}
{% tab title="Data Configuration" %}
More than one data series is defined in the data collection.&#x20;

```csharp
ClearCollect(
    CollDashedLineChart,
    {
        name: "Population",
        dashlength: 7, // Resposible for Dashline
        data: ForAll([
            {
                label: "Cairo",
                value: 115
            },
            {
                label: "Damietta",
                value: 50
            },
            {
                label: "Alex",
                value: 80
            }
        ],{Value: ThisRecord})
    },
    {
        name: "Education",
        dashlength: 9,
        data: [
            {
                label: "Cairo",
                value: 180
            },
            {
                label: "Damietta",
                value: 50
            },
            {
                label: "Alex",
                value: 70
            }
        ]
    },
    {
        name: "Income",
        dashlength: 2,
        data: ForAll([
            {
                label: "Cairo",
                value: 100,
                isnull: false
            },
            {
                label: "Damietta",
                value: 100
            },
            {
                label: "Alex",
                value: 150
            }
        ],{Value: ThisRecord})
    }
);

```

{% endtab %}

{% tab title="Property Configuration" %}

* [x] `LineType` property is set to **Smooth**
* [x] &#x20;All other control properties can be left as default
  {% endtab %}
  {% endtabs %}

### Gradient Line Chart

![](/files/-Mkg0KuTa4dU6s-0AR-x)

{% tabs %}
{% tab title="Data Configuration" %}
More than one data series is defined in the data collection.&#x20;

```csharp
ClearCollect(
    ColGradientLineChart,
    {
        name: "Population",
        
        data: ForAll([
            {
                label: "Cairo",
                value: 115
            },
            {
                label: "Damietta",
                value: 50
            },
            {
                label: "Alex",
                value: 80
            }
        ],{Value: ThisRecord})
    },
    {
        name: "Education",
     
        data: ForAll([
            {
                label: "Cairo",
                value: 180
            },
            {
                label: "Damietta",
                value: 50
            },
            {
                label: "Alex",
                value: 70
            }
        ],{Value: ThisRecord})
    },
    {
        name: "Income",
        dashlength: 2,
        data: ForAll([
            {
                label: "Cairo",
                value: 100,
                isnull: false
            },
            {
                label: "Damietta",
                value: 100
            },
            {
                label: "Alex",
                value: 150
            }
        ],{Value: ThisRecord})
    }
);
```

{% endtab %}

{% tab title="Property Configuration" %}

* [x] `LineType` property is set to **Smooth**
* [x] `FillType` property is set to **Gradient**
* [x] `GradientShadeIntensity` property is set to **3**
* [x] `GradientOpcityFrom` property is set to **5**
* [x] `GradientOpcityTo` property is set to **10**
* [x] `GradientStop` property is set to **3**
* [x] &#x20;All other control properties can be left as default
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lowcodera.com/line-chart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
