gchart.lua

changeset 2
107b9d00e4d4
parent 1
f930ba6a8923
child 3
49a62f0f4a96
equal deleted inserted replaced
1:f930ba6a8923 2:107b9d00e4d4
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 = {};

mercurial