|
|
@ -132,7 +132,7 @@ const getYArr = async (maxX,xMax , xMin , mean , stdev,pingjun,max:number) => { |
|
|
|
} |
|
|
|
let beishu =Math.floor((max+25)/(Number(pingjun)));//为了更好看把曲线出现频率与范围内有多少数的柱状图强行绑定在一起,(最大柱状图数+42)/平均值时的正态分布频率 当做每个正态分布的倍数,这样能保证曲线总是在柱状图的最上面 |
|
|
|
var distance = xMax - xMin //为了更好看,设置正态曲线起止位置 |
|
|
|
for (var j = xMin + distance / 4; j < maxX-distance / 4; j += jj) { |
|
|
|
for (var j = xMin + distance / 4; j < maxX; j += jj) { |
|
|
|
//for (var j = xMin + distance / 4; j < xMax-distance / 4; j += 0.01) { |
|
|
|
var xy = [j, func(j, mean, stdev)*beishu] |
|
|
|
//var xy = [j, pdf(j, mean, stdev)] |
|
|
@ -209,7 +209,7 @@ function setEchartData(xMin , xMax , yArr , fArr , threeSigLow , threeSigUp,thre |
|
|
|
yAxis: [ |
|
|
|
{ |
|
|
|
type: "value", //数值轴 |
|
|
|
name: "正态分布", |
|
|
|
// name: "正态分布", |
|
|
|
position: "right", |
|
|
|
axisTick: { show: true }, |
|
|
|
axisLine: { |
|
|
@ -231,7 +231,7 @@ function setEchartData(xMin , xMax , yArr , fArr , threeSigLow , threeSigUp,thre |
|
|
|
}, |
|
|
|
{ |
|
|
|
type: "value", |
|
|
|
name: "频数", |
|
|
|
// name: "频数", |
|
|
|
position: "left", |
|
|
|
axisLabel: { |
|
|
|
//formatter: '{value} %' |
|
|
@ -354,7 +354,11 @@ function setEchartData(xMin , xMax , yArr , fArr , threeSigLow , threeSigUp,thre |
|
|
|
xAxis: avgXs, |
|
|
|
label: { |
|
|
|
show: true, |
|
|
|
formatter: "平均:"+avgXs |
|
|
|
color:'green', |
|
|
|
formatter: "均值:"+avgXs |
|
|
|
}, |
|
|
|
lineStyle:{ |
|
|
|
color:'green' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|