It may be an idea for solar logger or battery control, I find it very cumbersome. Maybe someone has a better idea.
The .js project no longer exists, but it helps without pictures and the PDF. https://web.archive.org/web/20200917120 ... der9/xy.js
I hope it helps someone, have fun ...
Code: [Local Link Removed for Guests]
cls
jsexternal "/xy.min.js"
a$ = ""
a$ = a$ + |<p>Data writer </p><canvas id="canvas1" width="1000" height="300"></canvas>|
html a$
pause 1000
A$ = ""
A$ = A$ + |var datasets = [|
A$ = A$ + | {|
A$ = A$ + | lineColor : 'rgba(220,220,220,1)',|
A$ = A$ + | pointColor : 'rgba(220,220,220,1)',|
A$ = A$ + | pointStrokeColor : '#fff',|
'A$ = A$ + | data : [[0, 0], [1, 10], [2, 30], [3, 75], [4,100], [5, 120], [6,150], [7, 75], [8, 10], [9, 30], [10, 75], [11,100], [12, 120], [13,150], [14, 75],[15,100]]|
A$ = A$ + | data : [[0,0]]|
A$ = A$ + | },|
A$ = A$ + | {|
A$ = A$ + | lineColor : 'rgba(151,187,205,1)',|
A$ = A$ + | pointColor : 'rgba(151,187,205,1)',|
A$ = A$ + | pointStrokeColor : '#fff',|
A$ = A$ + | data : [[0, 100], [16, 80], [24, 20], [30, 90], [50, 0]]|
A$ = A$ + | }|
A$ = A$ + |];|
A$ = A$ + |datasets[0].lineColor = 'rgba(220,0,0,1)';xy.draw(datasets);|
A$ = A$ + |datasets[0].data[1] = [1,4]; xy.draw(datasets);|
jscript a$
A$ = ""
A$ = A$ + |var ctx = document.getElementById('canvas1').getContext('2d');|
A$ = A$ + ||
'A$ = A$ + |var xy = new Xy(ctx);|
'A$ = A$ + |var xy = new Xy(ctx,{point: false});|
A$ = A$ + |var xy = new Xy(ctx,{smooth: false,point: false});|
A$ = A$ + ||
A$ = A$ + |xy.draw(datasets);|
jscript a$
anf:
z=z+1
A$ = ""
A$ = A$ + |datasets[0].data[|
A$ = A$ + str$(z)
A$ = A$ + |] = [|
A$ = A$ + str$(z)
A$ = A$ + |,|
A$ = A$ + str$(RND(100))
A$ = A$ + |];|
A$ = A$ + | xy.draw(datasets); |
jscall A$
wlog A$
pause 100
if z>49 then Z=0
goto anf