liquid_feedback_frontend
diff env/ui/bargraph_legend.lua @ 4:80c215dbf076
Version alpha5
Many optical changes and improved usability
Support for different wiki-formatting-engines
Help system
Many optical changes and improved usability
Support for different wiki-formatting-engines
Help system
author | bsw/jbe |
---|---|
date | Thu Dec 10 12:00:00 2009 +0100 (2009-12-10) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/env/ui/bargraph_legend.lua Thu Dec 10 12:00:00 2009 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +function ui.bargraph_legend(attr) 1.5 + local width = assert(attr.width) 1.6 + local bars = assert(attr.bars) 1.7 + 1.8 + ui.container{ 1.9 + attr = { class = "bargraph_legend" }, 1.10 + content = function() 1.11 + ui.container{ 1.12 + attr = { class = "bargraph_legend_label" }, 1.13 + content = _"Legend:" 1.14 + } 1.15 + for i, bar in ipairs(bars) do 1.16 + ui.bargraph{ 1.17 + max_value = 1, 1.18 + width = width, 1.19 + bars = { 1.20 + { 1.21 + color = bar.color, 1.22 + value = 1, 1.23 + } 1.24 + } 1.25 + } 1.26 + ui.container{ 1.27 + attr = { class = "bargraph_legend_label" }, 1.28 + content = bar.label 1.29 + } 1.30 + end 1.31 + end 1.32 + } 1.33 + 1.34 + slot.put('<br style="clear: left;" />') 1.35 +end 1.36 \ No newline at end of file