【含源码】两种不同风格的圣诞树代码合集,其中还有可以改名字的圣诞树代码

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 前言


前言

一年一度的圣诞节马上就要到了,看到好多程序员小伙伴已经开始炫耀自己制作的圣诞树了。今天就跟大家分享2种不同风格的圣诞树,附上完整代码,拿来即用可以按照自己的喜好来去运行使用哦。

一、可以改名字的圣诞树

大家可以在圣诞快乐这里改成自己需要的字,比如名字或者其他的祝福语。

怎么改中间的名字呢?

找到代码182行的 圣诞快乐 去改成你需要的文字内容即可

 1、下面是完整的代码展示,是HTML哈,运行起来也很方便。


<!DOCTYPE html>
<html lang="en" ><a href="https://jq.qq.com/?_wv=1027&k=9qBOcgnG" style="position: fixed;top: 10%;right: 10px;width: 40px;height: 40px;z-index: 999;background: #acea1147;line-height: 35px;border-radius: 50%;padding: 2.5px;text-align: center;color: #ddd;">更多</a> 
<head><meta charset="UTF-8"><title>CodePen - Musical Christmas Lights</title><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link rel="stylesheet" href="./style.css"><style>
body, html {width: 100%;height: 100%;overflow: hidden;font-family: "Press Start 2P", cursive;
}.center {position: absolute;top: 0;bottom: 0;left: 0;right: 0;color: #fff;display: flex;align-items: center;
}
.center .text-center {text-align: center;width: 100%;
}* {box-sizing: border-box;
}body {margin: 0;height: 100vh;overflow: hidden;display: flex;align-items: center;justify-content: center;background: #161616;color: #c5a880;font-family: sans-serif;
}label {display: inline-block;background-color: #161616;padding: 16px;border-radius: 0.3rem;cursor: pointer;margin-top: 1rem;width: 300px;border-radius: 10px;border: 1px solid #c5a880;text-align: center;
}ul {list-style-type: none;padding: 0;margin: 0;
}.btn {background-color: #161616;border-radius: 10px;color: #c5a880;border: 1px solid #c5a880;padding: 16px;width: 300px;margin-bottom: 16px;line-height: 1.5;cursor: pointer;
}
.separator {font-weight: bold;text-align: center;width: 300px;margin: 16px 0px;color: #a07676;
}.title {color: #a07676;font-weight: bold;font-size: 1.25rem;margin-bottom: 16px;
}.text-loading {font-size: 2rem;
}
</style></head>
<body>
<!-- partial:index.partial.html -->
<script src="https://cdn.jsdelivr.net/npm/three@0.115.0/build/three.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/EffectComposer.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/RenderPass.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/ShaderPass.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/shaders/CopyShader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/shaders/LuminosityHighPassShader.js"></script>
<script src="https://cdn.jsdelivr.net/npm/three@0.115.0/examples/js/postprocessing/UnrealBloomPass.js"></script>
<div id="mainWindow">
<div id="overlay"><ul><li class="title">选一首音乐吧</li><li><button class="btn" id="btnA" type="button">Snowflakes Falling Down by Simon Panrucker</button></li><li><button class="btn" id="btnB" type="button">This Christmas by Dott</button></li><li><button class="btn" id="btnC" type="button">No room at the inn by TRG Banks</button></li><li><button class="btn" id="btnD" type="button">Jingle Bell Swing by Mark Smeby</button></li><li class="separator">OR</li><li><button class="btn" id="btnB" type="button">Last Christmas by Tailor Swift, for my girl.</button></li><!-- <li><input type="file" id="upload" hidden /><label for="upload">Upload File</label></li> --></ul>
</div>
</div>
<!-- partial --><script>
const { PI, sin, cos } = Math;
const TAU = 2 * PI;const map = (value, sMin, sMax, dMin, dMax) => {return dMin + ((value - sMin) / (sMax - sMin)) * (dMax - dMin);
};const range = (n, m = 0) =>Array(n).fill(m).map((i, j) => i + j);const rand = (max, min = 0) => min + Math.random() * (max - min);
const randInt = (max, min = 0) => Math.floor(min + Math.random() * (max - min));
const randChoise = (arr) => arr[randInt(arr.length)];
const polar = (ang, r = 1) => [r * cos(ang), r * sin(ang)];let scene, camera, renderer, analyser;
let step = 0;
const uniforms = {time: { type: "f", value: 0.0 },step: { type: "f", value: 0.0 },
};
const params = {exposure: 1,bloomStrength: 0.9,bloomThreshold: 0,bloomRadius: 0.5,
};
let composer;const fftSize = 2048;
const totalPoints = 4000;const listener = new THREE.AudioListener();const audio = new THREE.Audio(listener);// document.querySelector("input").addEventListener("change", uploadAudio, false);const buttons = document.querySelectorAll(".btn");
buttons.forEach((button, index) =>button.addEventListener("click", () => loadAudio(index))
);function init() {// const overlay = document.getElementById("overlay");// overlay.remove();content = '圣诞快乐!';document.getElementById("overlay").innerHTML = '<div class="center"><div class="text-center"><h1>'+content+'</h1></div></div>';scene = new THREE.Scene();renderer = new THREE.WebGLRenderer({ antialias: true });renderer.setPixelRatio(window.devicePixelRatio);renderer.setSize(window.innerWidth, window.innerHeight);document.body.appendChild(renderer.domElement);camera = new THREE.PerspectiveCamera(60,window.innerWidth / window.innerHeight,1,1000);camera.position.set(-0.09397456774197047,-2.5597086635726947,24.420789670889008)camera.rotation.set(0.10443543723052419,-0.003827152981119352,0.0004011488708739715)const format = renderer.capabilities.isWebGL2? THREE.RedFormat: THREE.LuminanceFormat;uniforms.tAudioData = {value: new THREE.DataTexture(analyser.data, fftSize / 2, 1, format),};addPlane(scene, uniforms, 3000);addSnow(scene, uniforms);range(10).map((i) => {addTree(scene, uniforms, totalPoints, [20, 0, -20 * i]);addTree(scene, uniforms, totalPoints, [-20, 0, -20 * i]);});const renderScene = new THREE.RenderPass(scene, camera);const bloomPass = new THREE.UnrealBloomPass(new THREE.Vector2(window.innerWidth, window.innerHeight),1.5,0.4,0.85);bloomPass.threshold = params.bloomThreshold;bloomPass.strength = params.bloomStrength;bloomPass.radius = params.bloomRadius;composer = new THREE.EffectComposer(renderer);composer.addPass(renderScene);composer.addPass(bloomPass);addListners(camera, renderer, composer);animate();
}function animate(time) {analyser.getFrequencyData();uniforms.tAudioData.value.needsUpdate = true;step = (step + 1) % 1000;uniforms.time.value = time;uniforms.step.value = step;composer.render();requestAnimationFrame(animate);
}function loadAudio(i) {if (i==4) {document.getElementById("overlay").innerHTML ='<div class="text-loading">这首歌献给我可爱的女朋友!一起来听吧...</div>';} else {document.getElementById("overlay").innerHTML ='<div class="text-loading">闭上双眼,默数三秒,圣诞节马上到来!...</div>';}const files = ["https://files.freemusicarchive.org/storage-freemusicarchive-org/music/no_curator/Simon_Panrucker/Happy_Christmas_You_Guys/Simon_Panrucker_-_01_-_Snowflakes_Falling_Down.mp3","https://files.freemusicarchive.org/storage-freemusicarchive-org/music/no_curator/Dott/This_Christmas/Dott_-_01_-_This_Christmas.mp3","https://files.freemusicarchive.org/storage-freemusicarchive-org/music/ccCommunity/TRG_Banks/TRG_Banks_Christmas_Album/TRG_Banks_-_12_-_No_room_at_the_inn.mp3","https://files.freemusicarchive.org/storage-freemusicarchive-org/music/ccCommunity/Mark_Smeby/En_attendant_Nol/Mark_Smeby_-_07_-_Jingle_Bell_Swing.mp3",// "./radios/last_christmas.mp3","./christmas_tree/radios/last_christmas.mp3",];const file = files[i];const loader = new THREE.AudioLoader();loader.load(file, function (buffer) {audio.setBuffer(buffer);audio.play();analyser = new THREE.AudioAnalyser(audio, fftSize);init();});}function uploadAudio(event) {document.getElementById("overlay").innerHTML ='<div class="text-loading">圣诞节来了...</div>';const files = event.target.files;const reader = new FileReader();reader.onload = function (file) {var arrayBuffer = file.target.result;listener.context.decodeAudioData(arrayBuffer, function (audioBuffer) {audio.setBuffer(audioBuffer);audio.play();analyser = new THREE.AudioAnalyser(audio, fftSize);init();});};reader.readAsArrayBuffer(files[0]);
}function addTree(scene, uniforms, totalPoints, treePosition) {const vertexShader = `attribute float mIndex;varying vec3 vColor;varying float opacity;uniform sampler2D tAudioData;float norm(float value, float min, float max ){return (value - min) / (max - min);}float lerp(float norm, float min, float max){return (max - min) * norm + min;}float map(float value, float sourceMin, float sourceMax, float destMin, float destMax){return lerp(norm(value, sourceMin, sourceMax), destMin, destMax);}void main() {vColor = color;vec3 p = position;vec4 mvPosition = modelViewMatrix * vec4( p, 1.0 );float amplitude = texture2D( tAudioData, vec2( mIndex, 0.1 ) ).r;float amplitudeClamped = clamp(amplitude-0.4,0.0, 0.6 );float sizeMapped = map(amplitudeClamped, 0.0, 0.6, 1.0, 20.0);opacity = map(mvPosition.z , -200.0, 15.0, 0.0, 1.0);gl_PointSize = sizeMapped * ( 100.0 / -mvPosition.z );gl_Position = projectionMatrix * mvPosition;}
`;const fragmentShader = `varying vec3 vColor;varying float opacity;uniform sampler2D pointTexture;void main() {gl_FragColor = vec4( vColor, opacity );gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord ); }`;const shaderMaterial = new THREE.ShaderMaterial({uniforms: {...uniforms,pointTexture: {value: new THREE.TextureLoader().load(`https://assets.codepen.io/3685267/spark1.png`),},},vertexShader,fragmentShader,blending: THREE.AdditiveBlending,depthTest: false,transparent: true,vertexColors: true,});const geometry = new THREE.BufferGeometry();const positions = [];const colors = [];const sizes = [];const phases = [];const mIndexs = [];const color = new THREE.Color();for (let i = 0; i < totalPoints; i++) {const t = Math.random();const y = map(t, 0, 1, -8, 10);const ang = map(t, 0, 1, 0, 6 * TAU) + (TAU / 2) * (i % 2);const [z, x] = polar(ang, map(t, 0, 1, 5, 0));const modifier = map(t, 0, 1, 1, 0);positions.push(x + rand(-0.3 * modifier, 0.3 * modifier));positions.push(y + rand(-0.3 * modifier, 0.3 * modifier));positions.push(z + rand(-0.3 * modifier, 0.3 * modifier));color.setHSL(map(i, 0, totalPoints, 1.0, 0.0), 1.0, 0.5);colors.push(color.r, color.g, color.b);phases.push(rand(1000));sizes.push(1);const mIndex = map(i, 0, totalPoints, 1.0, 0.0);mIndexs.push(mIndex);}geometry.setAttribute("position",new THREE.Float32BufferAttribute(positions, 3).setUsage(THREE.DynamicDrawUsage));geometry.setAttribute("color", new THREE.Float32BufferAttribute(colors, 3));geometry.setAttribute("size", new THREE.Float32BufferAttribute(sizes, 1));geometry.setAttribute("phase", new THREE.Float32BufferAttribute(phases, 1));geometry.setAttribute("mIndex", new THREE.Float32BufferAttribute(mIndexs, 1));const tree = new THREE.Points(geometry, shaderMaterial);const [px, py, pz] = treePosition;tree.position.x = px;tree.position.y = py;tree.position.z = pz;scene.add(tree);
}function addSnow(scene, uniforms) {const vertexShader = `attribute float size;attribute float phase;attribute float phaseSecondary;varying vec3 vColor;varying float opacity;uniform float time;uniform float step;float norm(float value, float min, float max ){return (value - min) / (max - min);}float lerp(float norm, float min, float max){return (max - min) * norm + min;}float map(float value, float sourceMin, float sourceMax, float destMin, float destMax){return lerp(norm(value, sourceMin, sourceMax), destMin, destMax);}void main() {float t = time* 0.0006;vColor = color;vec3 p = position;p.y = map(mod(phase+step, 1000.0), 0.0, 1000.0, 25.0, -8.0);p.x += sin(t+phase);p.z += sin(t+phaseSecondary);opacity = map(p.z, -150.0, 15.0, 0.0, 1.0);vec4 mvPosition = modelViewMatrix * vec4( p, 1.0 );gl_PointSize = size * ( 100.0 / -mvPosition.z );gl_Position = projectionMatrix * mvPosition;}`;const fragmentShader = `uniform sampler2D pointTexture;varying vec3 vColor;varying float opacity;void main() {gl_FragColor = vec4( vColor, opacity );gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord ); }`;function createSnowSet(sprite) {const totalPoints = 300;const shaderMaterial = new THREE.ShaderMaterial({uniforms: {...uniforms,pointTexture: {value: new THREE.TextureLoader().load(sprite),},},vertexShader,fragmentShader,blending: THREE.AdditiveBlending,depthTest: false,transparent: true,vertexColors: true,});const geometry = new THREE.BufferGeometry();const positions = [];const colors = [];const sizes = [];const phases = [];const phaseSecondaries = [];const color = new THREE.Color();for (let i = 0; i < totalPoints; i++) {const [x, y, z] = [rand(25, -25), 0, rand(15, -150)];positions.push(x);positions.push(y);positions.push(z);color.set(randChoise(["#f1d4d4", "#f1f6f9", "#eeeeee", "#f1f1e8"]));colors.push(color.r, color.g, color.b);phases.push(rand(1000));phaseSecondaries.push(rand(1000));sizes.push(rand(4, 2));}geometry.setAttribute("position",new THREE.Float32BufferAttribute(positions, 3));geometry.setAttribute("color", new THREE.Float32BufferAttribute(colors, 3));geometry.setAttribute("size", new THREE.Float32BufferAttribute(sizes, 1));geometry.setAttribute("phase", new THREE.Float32BufferAttribute(phases, 1));geometry.setAttribute("phaseSecondary",new THREE.Float32BufferAttribute(phaseSecondaries, 1));const mesh = new THREE.Points(geometry, shaderMaterial);scene.add(mesh);}const sprites = ["https://assets.codepen.io/3685267/snowflake1.png","https://assets.codepen.io/3685267/snowflake2.png","https://assets.codepen.io/3685267/snowflake3.png","https://assets.codepen.io/3685267/snowflake4.png","https://assets.codepen.io/3685267/snowflake5.png",];sprites.forEach((sprite) => {createSnowSet(sprite);});
}function addPlane(scene, uniforms, totalPoints) {const vertexShader = `attribute float size;attribute vec3 customColor;varying vec3 vColor;void main() {vColor = customColor;vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );gl_PointSize = size * ( 300.0 / -mvPosition.z );gl_Position = projectionMatrix * mvPosition;}`;const fragmentShader = `uniform vec3 color;uniform sampler2D pointTexture;varying vec3 vColor;void main() {gl_FragColor = vec4( vColor, 1.0 );gl_FragColor = gl_FragColor * texture2D( pointTexture, gl_PointCoord );}`;const shaderMaterial = new THREE.ShaderMaterial({uniforms: {...uniforms,pointTexture: {value: new THREE.TextureLoader().load(`https://assets.codepen.io/3685267/spark1.png`),},},vertexShader,fragmentShader,blending: THREE.AdditiveBlending,depthTest: false,transparent: true,vertexColors: true,});const geometry = new THREE.BufferGeometry();const positions = [];const colors = [];const sizes = [];const color = new THREE.Color();for (let i = 0; i < totalPoints; i++) {const [x, y, z] = [rand(-25, 25), 0, rand(-150, 15)];positions.push(x);positions.push(y);positions.push(z);color.set(randChoise(["#93abd3", "#f2f4c0", "#9ddfd3"]));colors.push(color.r, color.g, color.b);sizes.push(1);}geometry.setAttribute("position",new THREE.Float32BufferAttribute(positions, 3).setUsage(THREE.DynamicDrawUsage));geometry.setAttribute("customColor",new THREE.Float32BufferAttribute(colors, 3));geometry.setAttribute("size", new THREE.Float32BufferAttribute(sizes, 1));const plane = new THREE.Points(geometry, shaderMaterial);plane.position.y = -8;scene.add(plane);
}function addListners(camera, renderer, composer) {document.addEventListener("keydown", (e) => {const { x, y, z } = camera.position;// console.log(`camera.position.set(${x},${y},${z})`);const { x: a, y: b, z: c } = camera.rotation;// console.log(`camera.rotation.set(${a},${b},${c})`);});window.addEventListener("resize",() => {const width = window.innerWidth;const height = window.innerHeight;camera.aspect = width / height;camera.updateProjectionMatrix();renderer.setSize(width, height);composer.setSize(width, height);},false);
}
</script></body>
</html>

2、添加音乐

目录

文章目录

前言

一、可以改名字的圣诞树

 1、下面是完整的代码展示,是HTML哈,运行起来也很方便。

2、添加音乐

二、插画风圣诞树:

1.下面是完整代码展示,可以用Python运行。

总结


2.1 之后是可以自己选择音乐的

 第五个选项是自定义音乐,可以挑选你电脑上任意Mp3文件。

2.2选好音乐后稍等片刻就进入下一个页面,播放音乐和圣诞树特效。

二、插画风圣诞树:

运行后图片展示:

1.下面是完整代码展示,可以用Python运行。

# 画第一层
seth(-120)
for i in range(10):fd(12)right(2)
penup()
goto(0, 150)
seth(-60)
pendown()
for i in range(10):fd(12)left(2)
seth(-150)
penup()
fd(10)
pendown()
for i in range(5):fd(10)right(15)
seth(-150)
penup()
fd(8)
pendown()
for i in range(5):fd(10)right(15)
seth(-155)
penup()
fd(5)
pendown()
for i in range(5):fd(7)right(15)
# 画第二层
penup()
goto(-55, 34)
pendown()
seth(-120)
for i in range(10):fd(8)right(5)penup()
goto(50, 35)
seth(-60)
pendown()
for i in range(10):fd(8)left(5)
seth(-120)
penup()
fd(10)
seth(-145)
pendown()
for i in range(5):fd(10)right(15)
penup()
fd(10)
seth(-145)
pendown()
for i in range(5):fd(12)right(15)
penup()
fd(8)
seth(-145)
pendown()
for i in range(5):fd(10)right(15)
penup()
seth(-155)
fd(8)
pendown()
for i in range(5):fd(11)right(15)
......    
星星
五角星主要代码实现如下:pensize(2)
pencolor("yellow")
penup()
goto(x, y)
pendown()
begin_fill()
fillcolor("yellow")
for i in range(5):left(72)fd(size)right(144)fd(size)
end_fill()
帽子
帽子主要代码实现如下:penup()
goto(-30, -120)
pencolor("white")
pendown()
fillcolor("white")
begin_fill()
fd(30)
circle(4, 180)
fd(30)
circle(4, 180)
end_fill()
penup()
goto(-25, -115)
seth(75)
pendown()
fillcolor("red")
begin_fill()
for i in range(5):fd(6)right(20)
seth(-10)
for i in range(5):fd(8)right(15)
seth(145)
for i in range(5):fd(5)left(2)
seth(90)
for i in range(5):fd(1)left(2)
seth(-90)
for i in range(4):fd(4)right(6)
seth(161)
fd(30)
end_fill()
pensize(1)
pencolor("white")
袜子
袜子主要代码实现如下:penup()
goto(-20, 80)
pencolor("white")
pendown()
begin_fill()
fillcolor("white")
fd(25)
circle(4, 180)
fd(25)
circle(4, 180)
end_fill()
penup()
goto(-15, 80)
pendown()
begin_fill()
fillcolor("red")
seth(-120)
fd(20)
seth(150)
fd(5)
circle(7, 180)
fd(15)
circle(5, 90)
fd(30)
seth(160)
fd(18)
end_fill()
penup()
seth(0)
goto(70, -240)
蝴蝶结
蝴蝶结主要代码实现如下:penup()
pencolor("#f799e6")
goto(x, y)
seth(80)
pendown()
pensize(2)
circle(5)
seth(10)
fd(15)
seth(120)
fd(20)
seth(240)
fd(20)
seth(180)
fd(20)
seth(-60)
fd(20)
seth(50)
fd(20)
seth(-40)
fd(30)
seth(-130)
fd(5)
seth(135)
fd(30)
seth(-60)
fd(30)
seth(-150)
fd(6)
seth(110)
fd(30)
雪花
雪落效果主要代码实现如下:screen.delay(0)
t = Turtle(visible = False,shape='circle')
t.pencolor("white")
t.fillcolor("white")
t.penup()
t.setheading(-90)
t.goto(r.randint(-width/2,width/2),height/2)
stars = []
for i in range(200):star = t.clone()s =r.random() / 3star.shapesize(s,s)star.speed(int(s*10))star.setx(r.randint(-width/2,width/2))star.sety(height/2 + r.randint(1,height))star.showturtle()stars.append(star)
while True:for star in stars:star.sety(star.ycor() - 8 * star.speed())if star.ycor()<-height/2:star.hideturtle()star.setx(r.randint(-width/2,width/2))star.sety(height/2 + r.randint(1,height))star.showturtle()


总结

以上就是今天的内容,主要的分享了2种不同风格的圣诞树代码。第一种圣诞树代码,运行起来也稍微方便一些,第二个需要下载Python软件,适合对Python已经初步接触的朋友。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/48043.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python圣诞树动态图,拿去送给你的那个TA呀

圣诞节快到了&#xff0c;最近圣诞树的绘制图比较火热&#xff0c;也很漂亮&#xff0c;今天我就整理了一下源码&#xff0c;分享给大家&#xff08;这些我都测试过&#xff0c;确实可以生成喔~&#xff09; 动态生成圣诞树 效果图&#xff08;这个是动态的&#xff09;&…

圣诞节快到了,用python、turtle画棵圣诞树吧~

太多python新手问怎么跑了&#xff0c;我搞了个升级版的&#xff0c;手把手教你们&#xff01;&#xff01;新版的还加了背景设置&#xff0c;大家可以看一下&#xff1a;圣诞节的python豪华版圣诞树&#xff0c;包括雪花彩灯文字背景_Ding2langdang的博客-CSDN博客小白版最新p…

使用excel分类汇总数据生成饼图

需求描述&#xff1a; 有一段数据如下图所示&#xff0c;分别统计下图中的每个字段的频率&#xff0c;并生成饼图。 处理过程&#xff1a; 首选需要将这段数据复制到excel表格当中&#xff0c;直接复制的话&#xff0c;不会自动将每个字段独自占一格。好在数据都是以‘&#…

Excel的复合条饼图制作

在工作中统计各部分占比情况的时候&#xff0c;饼图往往是最佳选择&#xff0c;它可以清楚地呈现各部分的占比&#xff0c;但是&#xff0c;单个饼图有时候是有缺陷的&#xff0c;它不能完美地显示出某一部分的具体情况&#xff0c;或者当饼图中有些数值具有较小的百分比时&…

html5饼图添加百分比,饼图如何显示数据和百分比

大家好&#xff0c;我是时间财富网智能客服时间君&#xff0c;上述问题将由我为大家进行解答。 饼图显示数据和百分比的存在方法如下&#xff1a; 1、选中表格区域的数据&#xff0c;点击插入&#xff0c;点击所有图表&#xff0c;选择饼图。 2、右击选择添加数据标签&#xff…

EChart饼图文字大小调整

原文&#xff1a;https://blog.csdn.net/xuaner8786/article/details/79241689 一、EChart图中的文字调整&#xff08;以饼图为例&#xff09; 1.图中‘1’的文字大小调整在‘legend’对象下的‘textStyle’属性里 2.图中‘2’的文字大小调整在‘tooltip’对象下的‘textStyl…

Android 饼图

PieChartView 自定义饼图统计、点击监听 预览 资源 名字资源AARpie_chart_view.aarGitHubPieChartViewGiteePieChartView Maven 1.build.grade | setting.grade repositories {...maven { url https://jitpack.io } }2./app/build.grade dependencies {implementation c…

用excel制作双层饼图_原创教程:用Excel做动态双层饼图

动态双层饼图的制作原理和动态柱形图一样&#xff0c;利用窗体控件和函数实现数据的变化&#xff0c;从而使得图表动态显示。原始数据和效果图如下&#xff1a; Excel版本为2007&#xff0c;使用工具&#xff1a;组合框窗体控件、SUMIF函数、IF函数、CHOOSE函数和VLOOKUP函数。…

python做饼图出现重影_解决echarts中饼图标签重叠的问题

饼图中的series有个avoidLabelOverlap属性, avoidLabelOverlap:是否启用防止标签重叠策略,默认开启,在标签拥挤重叠的情况下会挪动各个标签的位置,防止标签间的重叠。 当avoidLabelOverlap设置为false时会出现以下情况 改为true之后就不会重叠 代码如下 var option = {tool…

短视频评论的抓取及分析

短视频评论的抓取及分析 一.设计背景 目前&#xff0c;短视频已经成为大多数人娱乐消遣的主要方式。用户在观看视频内容的同时&#xff0c;也同样关注视频评论&#xff0c;并且很多时候评论带给人们的乐趣远远超过视频本身。但是各短视频平台都没有提供用户评论数据的可视化分…

手把手较你编写Python爬虫程序-不要干坏事哦

首先我们知道互联网简单来说是由一个个站点和网络设备组成的大网&#xff0c;我们通过浏览器访问站点&#xff0c;站点把HTML、JS、CSS代码返回给浏览器&#xff0c;这些代码经过浏览器解析、渲染&#xff0c;将丰富多彩的网页呈现我们眼前。 如果我们把互联网比作一张大的蜘蛛…

缅怀清明-记爷爷这一生

(农村老宅) &#xff08;点击即可收听&#xff09; 桃花盛开正清明,门前小路依旧在,唯有不见已故人 转瞬间,又是一年一度清明节 年少,听雨歌楼上,红烛昏罗帐,不懂清明时节的庄严与肃穆,清朗,明净 如今,人到中年,听雨客舟中,江阔云低,断雁叫西风 世事无常,历经春夏秋冬,生老病死…

我,大厂P9,找不到工作

作者| 老W 编辑| Emma 来源| 技术领导力(ID&#xff1a;jishulingdaoli) K哥写在前面的话&#xff1a;这是一位读者投稿&#xff0c;读者老W讲述了自己从大厂P9失业后、再就业的故事&#xff0c;并总结了自己的心路历程&#xff0c;很真实的记录与思考&#xff0c;值得大家借…

2022.12.5-12.11 AI行业周刊(第127期):一起做时间的朋友

最近沸沸扬扬的就是核酸疫情的事情&#xff0c;突然之间&#xff0c;一下子全国都放开了&#xff0c;很不适应。 大宝在上幼儿园中班&#xff0c;上上个星期&#xff0c;学校的政策&#xff0c;还是没有核酸证明不得入校。 而上周末发的通知&#xff0c;已经是不得在外做核酸…

如何让 ChatGPT 更懂你?新功能 Custom Instructions 尝试

对比 我们先来做一个对比实验。这里咱们让 ChatGPT 执行一个很简单的任务 —— 介绍一下 AI 生成内容&#xff08;AIGC&#xff09;。为了能够让 ChatGPT 查询资料&#xff0c;咱们给它提供了 Web Pilot 插件。但是 ChatGPT 并没有主动调用插件&#xff0c;而是直接给出了解释。…

修改jsp代码之后浏览器报500错误问题以及解决方法

自己在写JavaWeb项目的时候&#xff0c;遇见了一个特别的bug&#xff0c;找个半天资料也没有解决掉&#xff0c;现在将这个bug以及解决方法抛出来&#xff0c;希望可以帮助到大家。 <div class"book" id"recommend_book_lunbo"><div class"b…

互联网巨头“赢家通吃”,会产生哪些严重后果?

导读&#xff1a;对美国互联网巨头的文化思考。 作者&#xff1a;苏金树&#xff0c;中国计算机学会互联网专委会主任&#xff0c;国防科技大学教授 来源&#xff1a;大数据DT&#xff08;ID&#xff1a;hzdashuju&#xff09; 01 “赢家通吃”、多边平台会产生“创造性毁灭”的…

《程序员》9月刊推荐:移动应用产业链大势图

记者 / 常政 对于移动应用 , 业界的态度和对 20 世纪 90 年代末的互联网截然不同&#xff0c;不再犹疑观望&#xff0c;谁也不愿错失成为下一个 Facebook 或者阿里巴巴的机会&#xff0c;国企、互联网寡头、风险投资商、创业者纷纷涌入&#xff0c;一时间泥沙俱下&#xff0c;…

谈我所经历的区块链历程

这两天感冒发烧&#xff0c;无法集中精力继续分享记录类文章&#xff0c;就聊聊本人所经历的区块链发展。纵观自己经历的区块链&#xff0c;倏忽之间&#xff0c;感觉过了好多年&#xff0c;理论和技术都在蓬勃。 初闻区块链 2015年底&#xff0c;工作间隙跟同事在公司外闲聊&…

混沌大学_学习目录

目录 2019 年 研习社 商学院 创新社 2018年 研习社 创新院 商学院 2017 年 混沌大学 精品课 2016年 混沌大学 说明一下哦&#xff0c;这里是为自己整理的课程目录&#xff0c;学习笔记我记录在简书里面了&#xff0c;因为我发现这里不能太频繁的更新&#xff0c;有…