绘制螺旋线
<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<title>实验3——螺旋线</title>
<script src = "echarts.js"></script>
<!--导入ECharts-gl包-->
<script src="https://cdn.jsdelivr.net/npm/echarts-gl/dist/echarts-gl.min.js"></script>
</head>
<div id = "main" style = "width:900px;height:600px;"></div>
<script type="text/javascript">
var data = [];
for (var t = 0; t < 1000; t += 0.1) {
let x = (5+5 * Math.cos( Math.PI/24*t));
let y = (5+5 * Math.sin(Math.PI/24*t));
let z = Math.PI/48*t;
data.push([x, y, z]);
}
var myChart = echarts.init(document.getElementById('main'));
var option = {
title:{
text: "螺旋线",
left: 'center',
top: '5%',
textStyle:{
fontFamily: '宋体',
fontSize: 40,
fontWeight: 'bold'
}
},
tooltip: {
},
backgroundColor: '#fff',
visualMap: {
show: false,
dimension: 2,
max:50,
inRange: {
color: [
'#313695',
'#4575b4',