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

# LinePlot

> Create native line chart visualizations

The LinePlot component creates interactive line charts from pandas DataFrames.

## Basic usage

```python theme={null}
import gradio as gr
import pandas as pd

df = pd.DataFrame({
    "time": [1, 2, 3, 4, 5],
    "value": [10, 20, 15, 25, 30]
})

gr.LinePlot(
    value=df,
    x="time",
    y="value"
)
```

## Constructor

<ParamField path="value" type="pd.DataFrame | Callable | None" default="None">
  Pandas DataFrame containing the data
</ParamField>

<ParamField path="x" type="str | None" default="None">
  Column name for x-axis
</ParamField>

<ParamField path="y" type="str | None" default="None">
  Column name for y-axis (must be numeric)
</ParamField>

<ParamField path="color" type="str | None" default="None">
  Column name for color grouping
</ParamField>

<ParamField path="title" type="str | None" default="None">
  Chart title
</ParamField>

<ParamField path="x_title" type="str | None" default="None">
  X-axis title
</ParamField>

<ParamField path="y_title" type="str | None" default="None">
  Y-axis title
</ParamField>

<ParamField path="color_map" type="dict[str, str] | None" default="None">
  Mapping of series to colors
</ParamField>

<ParamField path="height" type="int | None" default="None">
  Plot height in pixels
</ParamField>

## Events

* **select** - Triggered when point is selected
* **double\_click** - Triggered on double click

## Example

```python theme={null}
import gradio as gr
import pandas as pd
import numpy as np

def create_timeseries():
    dates = pd.date_range('2024-01-01', periods=30)
    df = pd.DataFrame({
        "date": dates,
        "value": np.cumsum(np.random.randn(30)),
        "series": ["A"] * 15 + ["B"] * 15
    })
    return df

gr.LinePlot(
    value=create_timeseries(),
    x="date",
    y="value",
    color="series",
    title="Time Series Data"
)
```


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