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

# Line Chart

<Frame caption="Temperature in Madrid 1920–2022 • Multiple Line Charts • Google Charts theme">
  <iframe src="https://public.graphext.com/fdf884641db200c2/chart.html" title="Maximum Temperature in Madrid over time" scrolling="no" frameborder="0" width="800" height="649" />
</Frame>

***

Line charts are the most popular type of chart for visualizing change over time and detecting temporal
patterns. While not exlusively used for that, it's where they really shine.

In Graphext, you have 4 subtypes of line charts to choose from:

* Simple Line Charts
* Multiple Line Charts
* Segmented Line Charts
* Seasonal Decompositions

## Simple Line Charts

The simplest form of a line chart. Shows the progression of one variable over the other.

<Frame>
  <iframe src="https://public.graphext.com/361386e766488ac6/chart.html" title="Maximum Temperature in Madrid over time" scrolling="no" frameborder="0" width="800" height="577" />
</Frame>

## Multiple Line Charts

Multiple Line charts allow to see how different variabes change over time, offering a broader
perspective. Again, these are usually used to show how multiple trends change over time.

They take one more variable, which would be mapped to a new line with a new color.

<Frame>
  <iframe src="https://public.graphext.com/c5ef0498256bd675/chart.html" title="Maximum Temperature in Madrid over time" scrolling="no" frameborder="0" width="800" height="577" />
</Frame>

## Segmented Line Charts

Segmented Line charts also show multiple variables but do so in separate charts. These are also known as
**faceted line charts**, or **faceted charts**, in general.

These are useful when you want to measure change on different variables but each variable doesn't necessarily
respond to the same Y scale. Think a computer resources dashboard, displaying CPU usage, RAM and Network.

<Frame>
  <iframe src="https://public.graphext.com/eb91dafb6b3d89ea/chart.html" title="Maximum Temperature in Madrid over time" scrolling="no" frameborder="0" width="800" height="577" />
</Frame>

## Seasonal Decompositions

Seasonal Decomposition charts are a type of Segmented chart that displays the different temporal components your
data presents, such as trend and seasonality.

We can see in this example from measurements of the temperature of Madrid from 1920 to 2022, how the original data
can be decomposed into its trend and seasonality components. The trend has been rising steadily, but we can see a
particular bump around 1975 and onwards.

Seasonality is also quite descriptive of the 4 seasons that occur, even when considering a 10 year window.

<Frame>
  <iframe src="https://public.graphext.com/7b0b629a87d046df/chart.html" title="Trend and Seasonality" scrolling="no" frameborder="0" width="800" height="577" />
</Frame>

### Expanding charts

In the Seasonal Decomposition Charts you can expand each of the individual plots to a full-scale
version of it, for increased clarity.

<Frame>
  <video autoPlay playsInline loop muted src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/expand-seasonal-chart.mp4?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=0810044f904e9a41ee2b323f10b178d4" data-path="images/data-visualization/expand-seasonal-chart.mp4" />
</Frame>

## Customizing a line chart

<Frame>
  <img src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/customize-line-chart.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=86bf8deb41ea182c8d67b0a036047547" alt="Customize Line Chart" width="1059" height="1165" data-path="images/data-visualization/customize-line-chart.webp" />
</Frame>

### Color

Color customization for line charts works in the same way as with any chart.
You can learn more here: [Customizing colors in a chart](/documentation/data-visualization/customizing-charts#colors).

You can change the color of each line by either selecting a color palette for all
lines, or changing a specific category for a more semantically accurate color.

For example, in here we can have a yellow summer and a brownish
autumn, which makes it that much easier to identify at a glance.

You can change a specific color by clicking on the colored circle next to the desired
category.

<Note>
  When selecting a specific color for a category, this decision will take over
  any color palette/theme choice. That is: the colors you set manually will
  prevail over any other way of changing colors.
</Note>

### Line thickness

<Frame>
  <iframe src="https://dev-embeds.graphext.com/acd8afcf21ce802e/chart.html" title="Gen Z seems to spend more on average" scrolling="no" frameborder="0" width="800" height="500" />
</Frame>

You can change the line thickness and style of one or more lines, in the need to create a bit of emphasis
in a specific segment.

If you are dealing with a [simple line chart](#simple-line-charts), options to change the thickness and dash pattern will appear under
the interpolation section.

<Frame>
  <img src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/line-thickness-simple.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=525699bf8ba662cf1a890ff591be7293" alt="Simple line chart thickness controls" width="879" height="919" data-path="images/data-visualization/line-thickness-simple.webp" />
</Frame>

If you are working witha a [multiple line chart](#multiple-line-charts) though, more options are available to you.

<Frame>
  <img src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/line-thickness-multiple.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=378b2e36e8b25b05f4d4eda451a65d8b" alt="Multiple line chart thickness controls" width="894" height="1473" data-path="images/data-visualization/line-thickness-multiple.webp" />
</Frame>

The first section of the controls remain the same: you can change the width and dash pattern and this will apply
to **every line in your chart**.

When toggling "Manage line properties", you can select a subset of segments within the category mapped to color,
that will respond to the controls underneath. This way, you can select the segments you are most interested in and
give them a different styling.

### Interpolation

Interpolation on all Line Charts can be changed between these modes:

#### Linear Interpolation

Classic straight-line interpolation between any pair of points.

<Frame caption="Linear Interpolation">
  <img src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/linear.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=70d922bea2281517d4bc8df917286940" alt="Linear Interpolation" width="1114" height="1114" data-path="images/data-visualization/linear.webp" />
</Frame>

#### Curve Interpolation

Defines a curve between any pair of points, making the overall result look smoother.

You can choose between Monotone, Cardinal and Natural interpolation.

<Warning>
  While these can yield pleasing curves, they may not represent your data
  faithfully. Monotone interpolation is the one that best fits the data points
  while making a smooth curve.
</Warning>

<Tabs>
  <Tab title="Monotone Interpolation">
    <Frame>
      <img src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/monotone.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=0008d8f1213428d1d695ff336f273bf8" alt="Monotone Interpolation" width="1114" height="1114" data-path="images/data-visualization/monotone.webp" />
    </Frame>
  </Tab>

  <Tab title="Cardinal Interpolation">
    <Frame>
      <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-visualization/cardinal.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=acb2c1fe5b2bc9c661db08bd4422eceb" alt="Cardinal Interpolation" width="1114" height="1114" data-path="images/data-visualization/cardinal.webp" />
    </Frame>
  </Tab>

  <Tab title="Natural Interpolation">
    <Frame>
      <img src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/natural.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=5205fdac403098820f58dd8ec7a729ee" alt="Natural Interpolation" width="1114" height="1114" data-path="images/data-visualization/natural.webp" />
    </Frame>
  </Tab>
</Tabs>

#### Step Interpolation

Step interpolation is, basically, no interpolation. It creates sharp corners
and straight vertical lines between the points. These are useful when it makes
no sense to interpolate between two points, but just want to see the difference
between them.

Step has three modes: Before, Middle and After, which define the anchor point with
respect the actual data point.

<Tabs>
  <Tab title="Step Before">
    <Frame>
      <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-visualization/before.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=6b43354e4ee0c1f4ad29d12d131b12e8" alt="Step Before" width="1114" height="1114" data-path="images/data-visualization/before.webp" />
    </Frame>
  </Tab>

  <Tab title="Step Middle">
    <Frame>
      <img src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/middle.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=f8492303bc422bf3f38a13a4a72462c0" alt="Step Middle" width="1114" height="1114" data-path="images/data-visualization/middle.webp" />
    </Frame>
  </Tab>

  <Tab title="Step After">
    <Frame>
      <img src="https://mintcdn.com/graphext/agfECH-oCIK1Rorn/images/data-visualization/after.webp?fit=max&auto=format&n=agfECH-oCIK1Rorn&q=85&s=b1423704a71690d27b262c4366d60ff1" alt="Step After" width="1114" height="1114" data-path="images/data-visualization/after.webp" />
    </Frame>
  </Tab>
</Tabs>

### Seasonality Decomposition: Common Scale

In Seasonality Decomposition Charts you can enable a little check box at the very bottom that
toggles between the season and the residue charts having a common scale.

<Frame>
  <img
    src="https://mintcdn.com/graphext/TIxsUCdXOafrcQUZ/images/data-visualization/seasonal-common-scale.webp?fit=max&auto=format&n=TIxsUCdXOafrcQUZ&q=85&s=54048470b2ce71bba06078e829251ed4"
    alt="Common Scale in Seasonality
Decomposition"
    width="1467"
    height="1747"
    data-path="images/data-visualization/seasonal-common-scale.webp"
  />
</Frame>
