11 chart.width, chart.height = 320, 200; |
11 chart.width, chart.height = 320, 200; |
12 chart.marker_color = "4D89F9"; |
12 chart.marker_color = "4D89F9"; |
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 = "bvs" }; |
17 |
17 |
18 function new(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 = {}; |