Skip to content

Instantly share code, notes, and snippets.

@buddalee
Created September 16, 2018 15:27
Show Gist options
  • Save buddalee/e8af062b15fe42eb94e1adecebb01cc1 to your computer and use it in GitHub Desktop.
Save buddalee/e8af062b15fe42eb94e1adecebb01cc1 to your computer and use it in GitHub Desktop.
for Eric Echart gl line style
var series = [];
for (var y = -1; y < 1; y += 0.4) {
var data = [];
// Parametric curve
for (var x = -1; x < 1; x += 0.1) {
data.push([+x.toFixed(5), +y.toFixed(5), +(Math.sin(x * Math.PI + 0.22) * Math.sin(y * Math.PI + 0.22)).toFixed(5)]);
}
series.push({
type: 'line3D',
lineStyle: {
width: 20
},
silent: true,
data: data,
debug: {
wireframe: {
show: true,
lineStyle: {
color: '#fff'
}
}
}
});
}
option = {
// backgroundColor: '#fff',
xAxis3D: {
type: 'value'
},
yAxis3D: {
type: 'value'
},
zAxis3D: {
type: 'value'
},
grid3D: {
axisLine: {
lineStyle: {
color: '#108bcd'
}
},
axisPointer: {
show: false
},
viewControl: {}
},
series: series
};
@buddalee
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment