-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathline_eList.tcl
More file actions
48 lines (39 loc) · 1.75 KB
/
Copy pathline_eList.tcl
File metadata and controls
48 lines (39 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
lappend auto_path [file dirname [file dirname [file dirname [file dirname [file normalize [info script]]]]]]
# v1.0 : Initial example
# v2.0 : Update example with the new 'Add' method for chart series.
# source all.tcl
if {[catch {package present ticklecharts}]} {package require ticklecharts}
set chart [ticklecharts::chart new]
# Replace Tcl list command by eList class...
# > $chart Xaxis -data [list {Mon Tue Wed Thu Fri Sat Sun}]
$chart Xaxis -data [new elist {Mon Tue Wed Thu Fri Sat Sun}]
# getOptions for Xaxis method :
# > puts [$chart getOptions -axis X]
# Result :
# -axisLine -minversion 5 -validvalue {} -type dict|null
# ...
# symbol -minversion 5 -validvalue formatItemSymbol -type str|list.s|null -default "null"
# symbolSize -minversion 5 -validvalue {} -type list.n|null -default "nothing"
# ...
# Adds 'symbolSyze' property to 'axisLine'.
# 'axisLine.symbolSize' accepts a list of num values (list.n)
# $chart Xaxis -axisLine [list symbolSize [list {10}]]
# You should see this error :
# Error : bad type(set) for this key 'symbolSize'= num should be :list.n|null
# To avoid this error use 'eList class' like this :
$chart Xaxis -axisLine [list symbolSize [new elist {10}]]
# Json result :
# ...
# "axisLine": {
# "show": true,
# "onZero": true,
# "symbol": null,
# // result symbolSize
# "symbolSize": [10]
# },
$chart Yaxis
# we would have also applied this class here...
$chart Add "lineSeries" -data [list {150 230 224 218 135 147 260}]
set fbasename [file rootname [file tail [info script]]]
set dirname [file dirname [info script]]
$chart Render -outfile [file join $dirname $fbasename.html] -title $fbasename