MCPcopy Create free account
hub / github.com/Milkyroad/SCiPNET / configLine

Function configLine

public/src/js/control.js:70–143  ·  view source on GitHub ↗
(title, max, min, show)

Source from the content-addressed store, hash-verified

68
69 //config
70 function configLine(title, max, min, show) {
71 return {
72 type: 'line',
73 data: {
74 datasets: [{
75 backgroundColor: `rgba(${hex2rgb(color)}, 0.2)`,
76 borderColor: `${color}`,
77 cubicInterpolationMode: 'monotone',
78 fill: true,
79 data: []
80 }]
81 },
82 options: {
83 responsive: true,
84 maintainAspectRatio: false,
85 plugins: {
86 title: {
87 display: show,
88 text: title,
89 font: {
90 weight: 'regular'
91 }
92 },
93 legend: {
94 display: false
95 }
96 },
97 elements: {
98 point: {
99 radius: 0
100 },
101 line: {
102 borderWidth: 1
103 }
104 },
105 scales: {
106 x: {
107 type: 'realtime',
108 realtime: {
109 delay: 2000,
110 onRefresh: chart => {
111 chart.data.datasets.forEach(dataset => {
112 dataset.data.push({
113 x: Date.now(),
114 y: valueList[title]
115 });
116 });
117 }
118 },
119 grid: {
120 display: false
121 },
122 ticks: {
123 display: false
124 },
125 },
126 y: {
127 suggestedMin: min,

Callers 1

mainHTMLFunFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected