Highcharts Combinations Scatter
# Highcharts Scatter Plot with Regression Line
[Highcharts Combination Charts](#)
The following example demonstrates adding a regression line to a scatter plot.
We have already learned the basic configuration syntax of Highcharts in previous chapters. Next, let's look at other configurations.
* * *
## Configuration
### series Configuration
Set the type property of series to line/scatter. series.type describes the data series type. The default value is "line".
var series = { type: 'scatter'};
### Example
File name: highcharts_combinations_scatter.htm
$(document).ready(function() { var title = { text: 'Adding Regression Line to Scatter Plot' }; 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: 'Observation Points', data: [1, 1.5, 2.8, 3.5, 3.9, 4.2], marker: { radius: 4 } } ]; var json = {}; json.title = title; json.xAxis = xAxis; json.yAxis = yAxis; json.series = series; $('#container').highcharts(json); });
[Try it Β»](#)
The output of the above example is:
[Highcharts Combination Charts](#)
YouTip