趋势线
我们可以在散点图中实现趋势线。
如下的散点图:
学习视频:
使用
添加模拟数据
添加一个数据集,并设置其sql为:
select 1 as p1, 4862.4 as p2 union
select 2 as p1, 5294.7 as p2 union
select 3 as p1, 5934.5 as p2 union
select 4 as p1, 7171.0 as p2 union
select 5 as p1, 8964.4 as p2 union
select 6 as p1, 10202.2 as p2 union
select 7 as p1, 11962.5 as p2 union
select 8 as p1, 14928.3 as p2 union
select 9 as p1, 16909.2 as p2 union
select 10 as p1, 18547.9 as p2 union
select 11 as p1, 21617.8 as p2 union
select 12 as p1, 26638.1 as p2 union
select 13 as p1, 34634.4 as p2 union
select 14 as p1, 46759.4 as p2 union
select 15 as p1, 58478.1 as p2 union
select 16 as p1, 67884.6 as p2 union
select 17 as p1, 74462.6 as p2 union
select 18 as p1, 79395.7 as p2;
添加散点图
添加一个基础散点图,并设置X轴的值为p1,y轴的值为p2
在系列的趋势线设置中:
设置线形为实线,并设置回归类型:
回归类型一共支持四种类型:
- 线性回归
- 指数回归
- 多项式回归
- 对数回归
可以根据需要设置。