FAKE(linspace(0,360,100))// | 0
// +-> x
// |
MAPVALUE(1,sin((value(0)/180)*PI))// | 0 1
// +-> x sin(x)
// |
CHART(chartOption({xAxis:{type:"category",data:column(0)},yAxis:{},series:[{type:"line",data:column(1)}]}))
SRC :: SQL()
Prepare data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FAKE(arrange(1,100,1))// | 0
// +-> seq
// |
MAPVALUE(1,sin((2*PI*value(0)/100)))// | 0 1
// +-> seq value
// |
MAPVALUE(0,timeAdd("now-100s",strSprintf("+%.fs",value(0))))// | 0 1
// +-> time value
// |
PUSHVALUE(0,"chart-line")// | 0 1 2
// +-> name time value
// |
APPEND(table("example"))
SQL() to CHART()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
SQL(`select time, value from example where name = 'chart-line'`)CHART(chartOption({xAxis:{type:"time"},yAxis:{},tooltip:{trigger:"axis"},series:[{type:"line",data:column(0).map((v,idx)=>[v,column(1)[idx]])}]}))