diff options
Diffstat (limited to 'webstats/stats.paren')
-rw-r--r-- | webstats/stats.paren | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/webstats/stats.paren b/webstats/stats.paren index 43c1be4..ca61938 100644 --- a/webstats/stats.paren +++ b/webstats/stats.paren @@ -44,8 +44,8 @@ (chain response (json)) (throw (new (-error "not 2XX resp"))))) -(defun spaced-color (idx) - (concatenate 'string "hsl(" (* 137.506 idx) ",70%,55%)")) +(defun spaced-color (idx &optional (opacity 1)) + (concatenate 'string "hsl(" (* 137.506 idx) ",70%,55%," opacity ")")) (defun plot (data) (new @@ -61,19 +61,27 @@ (chain document (get-element-by-id "graph"))))) (defun plot-site (data) - (new - (u-plot - (create - :title "Individual Site activity visits" - :width 450 - :height 400 - :cursor (create sync (create key "moo")) - :series (list (create label "Time") - (create label "stats" stroke (spaced-color 0)) - (create label "proxy" stroke (spaced-color 1)) - (create label "blog" stroke (spaced-color 2)))) - data - (chain document (get-element-by-id "graph"))))) + (let ((bars ((@ u-plot paths bars) + (create align 1 gap 0 size (list 0.8 -infinity))))) + (new + (u-plot + (create + :title "Individual Site activity visits" + :width 450 + :height 400 + :cursor (create sync (create key "moo")) + :series (list (create label "Time") + (create label "stats" stroke (spaced-color 0) + fill (spaced-color 0 0.2) + paths bars) + (create label "proxy" stroke (spaced-color 1) + fill (spaced-color 1 0.2) + paths bars) + (create label "blog" stroke (spaced-color 2) + fill (spaced-color 2 0.2) + paths bars))) + data + (chain document (get-element-by-id "graph")))))) (add-event-listener "load" |