mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
code cleanup
This commit is contained in:
parent
897d271692
commit
7eee14d328
1 changed files with 32 additions and 23 deletions
|
@ -295,11 +295,41 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => {
|
||||||
|
|
||||||
//console.log(arg.scatter.length)
|
//console.log(arg.scatter.length)
|
||||||
|
|
||||||
|
const config = {
|
||||||
|
plugins: {
|
||||||
|
legend: {
|
||||||
|
display: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
animations: false,
|
||||||
|
tooltips: {
|
||||||
|
enabled: false,
|
||||||
|
},
|
||||||
|
scales: {
|
||||||
|
display: false,
|
||||||
|
grid: {
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
x: {
|
||||||
|
type: 'linear',
|
||||||
|
position: 'bottom',
|
||||||
|
display: false
|
||||||
|
},
|
||||||
|
y: {
|
||||||
|
display: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var data = arg.scatter
|
var data = arg.scatter
|
||||||
var newdata = {
|
var newdata = {
|
||||||
datasets: [{
|
datasets: [{
|
||||||
label: 'constellation diagram',
|
label: 'constellation diagram',
|
||||||
data: data,
|
data: data,
|
||||||
|
options: config,
|
||||||
backgroundColor: 'rgb(255, 99, 132)'
|
backgroundColor: 'rgb(255, 99, 132)'
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
|
@ -318,33 +348,12 @@ ipcRenderer.on('action-update-tnc-state', (event, arg) => {
|
||||||
|
|
||||||
global.data = newdata
|
global.data = newdata
|
||||||
|
|
||||||
|
|
||||||
var ctx = document.getElementById('scatter').getContext('2d');
|
var ctx = document.getElementById('scatter').getContext('2d');
|
||||||
global.myChart = new Chart(ctx, {
|
global.myChart = new Chart(ctx, {
|
||||||
type: 'scatter',
|
type: 'scatter',
|
||||||
data: global.data,
|
data: global.data,
|
||||||
options: {
|
options: config
|
||||||
animation: false,
|
|
||||||
legend: {
|
|
||||||
display: false,
|
|
||||||
tooltips: {
|
|
||||||
enabled: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
scales: {
|
|
||||||
display: false,
|
|
||||||
grid: {
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
x: {
|
|
||||||
type: 'linear',
|
|
||||||
position: 'bottom',
|
|
||||||
display: false
|
|
||||||
},
|
|
||||||
y: {
|
|
||||||
display: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue