gchart.lua

changeset 4
e17867506327
parent 3
49a62f0f4a96
child 5
b4983e638117
equal deleted inserted replaced
3:49a62f0f4a96 4:e17867506327
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 = {};

mercurial