liquid_feedback_frontend

view env/ui/bargraph.lua @ 0:3bfb2fcf7ab9

Version alpha1
author bsw/jbe
date Wed Nov 18 12:00:00 2009 +0100 (2009-11-18)
parents
children 5c601807d397
line source
1 function ui.bargraph(args)
2 ui.container{
3 attr = {
4 class = "bargraph",
5 },
6 content = function()
7 for i, bar in ipairs(args.bars) do
8 local value = bar.value * args.width / args.max_value / 2
9 ui.container{
10 attr = {
11 style = "width: " .. tostring(value) .. "px; background-color: " .. bar.color .. ";",
12 title = tostring(bar.value)
13 },
14 content = function() slot.put(" ") end
15 }
16 end
17 end
18 }
19 end

Impressum / About Us