Stronę tą wyświetlono już: 493 razy
Prosty komponent wykresu 3W:
<obl-svg-diagram-3d z-values="[[100, 200, 300, 50], [50, 60, 80, 50], [100, 200, 30, 50]]"></obl-svg-diagram-3d>
<script>
const zValues = new Array();
for (let x = 0; x < 20; x++) {
const v = [];
for (let y = 0; y < 20; y++) {
v.push((Math.sin(x / 4) + Math.cos(y / 4)) * 50 - (x * x) / 10);
}
zValues.push(v);
}
const diagram = document.querySelector('obl-svg-diagram-3d');
diagram.zValues = zValues;
</script>