13 |
13 |
14 -- Helpers |
14 -- Helpers |
15 local function urlencode(s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end |
15 local function urlencode(s) return s and (s:gsub("%W", function (c) return string.format("%%%02x", c:byte()); end)); end |
16 local typemap = { line = "lc", sparkline = "ls", plot = "lxy", bar = "bhs" }; |
16 local typemap = { line = "lc", sparkline = "ls", plot = "lxy", bar = "bhs" }; |
17 |
17 |
18 function new_chart(type) |
18 function new(type) |
19 local chart_obj = { |
19 local chart_obj = { |
20 type = typemap[type] or type or "lc"; |
20 type = typemap[type] or type or "lc"; |
21 series = {}; |
21 series = {}; |
22 axes = {}; |
22 axes = {}; |
23 markers = {}; |
23 markers = {}; |