Skip to content

Commit

Permalink
feat: 正态分布演示新增曲线
Browse files Browse the repository at this point in the history
  • Loading branch information
LeafYeeXYZ committed Oct 16, 2024
1 parent 30de0ef commit 45c8aa7
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/tools/NormalDistribution.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,30 @@ export function NormalDistribution() {
const option = {
xAxis: { type: 'category', data: label, axisTick: { alignWithLabel: true } },
yAxis: { type: 'value' },
series: [{ data: count, type: 'bar', barWidth: '101%', label: {
formatter: (params: { value: number }) => {
return `${params.value}\n${(params.value / Math.max(data.length, 1) * 100).toFixed()}%`
}, position: 'top', show: true }
series: [{
data: count,
type: 'bar',
barWidth: '101%',
label: {
formatter: (params: { value: number }) => {
return `${params.value}\n${(params.value / Math.max(data.length, 1) * 100).toFixed()}%\n`
},
position: 'top',
show: true
},
itemStyle: {
color: '#ff68c0',
opacity: 0.5,
},
},{
data: count,
type: 'line',
smooth: true,
showSymbol: false,
lineStyle: {
color: '#ff68c0',
opacity: 0.7,
},
}]
}
chart.setOption(option)
Expand Down

0 comments on commit 45c8aa7

Please sign in to comment.