# Scatter Chart with Regression Line

#### Complete Python Prime Pack

9 Courses     2 eBooks

#### Artificial Intelligence & Machine Learning Prime Pack

6 Courses     1 eBooks

#### Java Prime Pack

9 Courses     2 eBooks

We have already seen the configuration used to draw a chart in Highcharts Configuration Syntax chapter.

An example of a combination chart having Scatter Chart with regression line is given below.

## Configurations

Let us now see the additional configurations/steps taken.

## series.type

Configure the series type to be line/scatter based. series.type decides the series type for the chart. Here, the default value is "line".

```var series = {
type: 'scatter'
};
```

## Example

highcharts_combinations_scatter.htm

```<html>
<title>Highcharts Tutorial</title>
</script>
<script src = "https://code.highcharts.com/highcharts.js"></script>

<body>
<div id = "container" style = "width: 550px; height: 400px; margin: 0 auto"></div>
<script language = "JavaScript">
var title = {
text: 'Scatter plot with regression line'
};
var xAxis = {
min: -0.5,
max: 5.5
};
var yAxis = {
min: 0
};
var series = [
{
type: 'line',
name: 'Regression Line',
data: [[0, 1.11], [5, 4.51]],
marker: {
enabled: false
},
states: {
hover: {
lineWidth: 0
}
},
enableMouseTracking: false
},
{
type: 'scatter',
name: 'Observations',
data: [1, 1.5, 2.8, 3.5, 3.9, 4.2],
marker: {
}
}
];
var json = {};
json.title = title;
json.xAxis = xAxis;
json.yAxis = yAxis;
json.series = series;
\$('#container').highcharts(json);
});
</script>
</body>

</html>
```

## Result

Verify the result.

highcharts_combinations.htm