Commit c0e8103f by BellCodeEditor

auto save

parent 89b150ec
Showing with 30 additions and 16 deletions
from pyecharts.charts import Bar import turtle
import random
subjects = ["贞贞","聪聪","小智","波奇"] t=turtle.Turtle()
scores1=[92,95,82,88] t.penup()
scores2=[95,79,93,90] t.goto(-200,0)
bar=Bar() text = "成嘉诺你有什么实力啊"
bar.add_xaxis(subjects) for char in text:
bar.add_yaxis("期中成绩",scores1,bar_width=40) font_size = random.randint(10,30)
bar.add_yaxis("期末成绩",scores2,bar_width=40) t.pendown()
bar.render("dd.html") t.write(char,font=("Arial",font_size,"normal"))
\ No newline at end of file jump_distance=random.randint(10333,30999)
t.penup()
t.forward(jump_distance)
t.hideturtle()
turtle.done()
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<div id="f3ce100515664aa1b3ac10a5a4849615" class="chart-container" style="width:900px; height:500px;"></div> <div id="3c132ef7e51b4d069b7b21a73610dc86" class="chart-container" style="width:900px; height:500px;"></div>
<script> <script>
var chart_f3ce100515664aa1b3ac10a5a4849615 = echarts.init( var chart_3c132ef7e51b4d069b7b21a73610dc86 = echarts.init(
document.getElementById('f3ce100515664aa1b3ac10a5a4849615'), 'white', {renderer: 'canvas'}); document.getElementById('3c132ef7e51b4d069b7b21a73610dc86'), 'white', {renderer: 'canvas'});
var option_f3ce100515664aa1b3ac10a5a4849615 = { var option_3c132ef7e51b4d069b7b21a73610dc86 = {
"animation": true, "animation": true,
"animationThreshold": 2000, "animationThreshold": 2000,
"animationDuration": 1000, "animationDuration": 1000,
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
} }
] ]
}; };
chart_f3ce100515664aa1b3ac10a5a4849615.setOption(option_f3ce100515664aa1b3ac10a5a4849615); chart_3c132ef7e51b4d069b7b21a73610dc86.setOption(option_3c132ef7e51b4d069b7b21a73610dc86);
</script> </script>
</body> </body>
</html> </html>
for char in text:
font_size = random.randint(10,30)
t.pendown()
t.write(char,font("Arial",font_size),"normal"))
jump_distaance=random.randint(10,30)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment