# How to Add Statistical Lines to a Chart

## What is a Statistical Line

Several types of statistical formulas can be added to a Scatter chart, immediately after each Scatter selection:

1. Trend Line – exponential (by default), logarithmic, power or linear.
2. Median Line – with median Y values automatically calculated.
3. Mean Line – with mean Y values automatically calculated.

## Steps to Add a Statistical Line to a Chart

Start Visual Xtractor or Data Xtractor. Connect to a database. Create or design a SQL query. Run the query and check the results.

1. Display and enable the Chart query builder.
2. Add selections for a Cartesian chart, such as a single or multi-series Scatter chart.
3. After a Scatter series, add a Helper ChartsTrend Line, Median Line or Mean Line.
4. Select your Trend Line as either exponential (by default), power, logarithmic or linear.

## Add a Trendline to a Scatter Chart

Look for the Scatter Chart with Trendline ready-to-use demo query under the Cartesian Charts folder.  Or build one typical Scatter chart from scratch, with one Scatter and one Label selection.

Immediately after the Scatter column, add an empty column and set it as Trend Line. A specific exponential line will be drawn between the points. Select this series from the toolbar, and change eventually the way it’s calculated:

1. Exponential (by default)
2. Power
3. Logarithmic
4. Linear

## Add Median and Mean Lines to a Grouped Scatter Chart

Create one typical multi-series Grouped Scatter chart from scratch, with two or more Scatter chart selections and one optional Label.

After the first Scatter column, add and empty column and set it as Mean Line. After the second Scatter column, add another empty column and set it as Median Line.

## Conclusion

• Adding Statistical Formula Lines to a Scatter chart in Data Xtractor or Visual Xtractor is fast and intuitive: just add an empty column with a Trend/Median/Mean Line selection after a Scatter column.
• Configure your Trend Line as either exponential (by default), power, logarithmic or linear.