Nicer colours on the 3D histo

This commit is contained in:
Herbert Wolverson 2024-06-28 14:09:41 -05:00
parent f425a0523b
commit 8e8f9ebef0

View File

@ -10,24 +10,16 @@ export class RttHistogram3D extends DashboardGraph {
for (let i=0; i<300; i++) timeAxis.push(i.toString()); for (let i=0; i<300; i++) timeAxis.push(i.toString());
let catAxis = []; let catAxis = [];
for (let i=0; i<20; i++) catAxis.push(i.toString()); for (let i=0; i<20; i++) catAxis.push({
value: i.toString(),
itemStyle: {color: lerpGreenToRedViaOrange(20-i, 20)},
}
);
/*let data = [];
for (let z=0; z<300; z++) {
for (let x=0; x<20; x++) {
data.push([ x, z, 1 ]);
}
}*/
let data = this.ring.series(); let data = this.ring.series();
this.option = { this.option = {
tooltip: {}, tooltip: {},
visualMap: {
max: 20,
inRange: {
color: ['#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf', '#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
}
},
xAxis3D: { xAxis3D: {
type: 'category', type: 'category',
data: catAxis data: catAxis
@ -54,7 +46,7 @@ export class RttHistogram3D extends DashboardGraph {
series: [{ series: [{
type: 'bar3D', type: 'bar3D',
data: data, data: data,
shading: 'color', shading: 'lambert',
label: { label: {
show: false show: false
}, },
@ -98,14 +90,22 @@ class RingBuffer {
for (let i=0; i<this.head; i++) { for (let i=0; i<this.head; i++) {
for (let j=0; j<20; j++) { for (let j=0; j<20; j++) {
let val = this.data[i][j]; let val = this.data[i][j];
data.push([j, counter, val]); let toPush = {
value: [j, counter, val],
itemStyle: {color: lerpGreenToRedViaOrange(20-j, 20)},
};
data.push(toPush);
} }
counter++; counter++;
} }
for (let i=this.head; i<this.size; i++) { for (let i=this.head; i<this.size; i++) {
for (let j=0; j<20; j++) { for (let j=0; j<20; j++) {
let val = this.data[i][j]; let val = this.data[i][j];
data.push([j, counter, val]); let toPush = {
value: [j, counter, val],
itemStyle: {color: lerpGreenToRedViaOrange(20-j, 20)},
};
data.push(toPush);
} }
counter++; counter++;
} }