wuihlpgraphsimple.py revision 2b114c590cf5a19f8047cd7bde9c7e5ae00aa22b
# -*- coding: utf-8 -*-
# $Id$
"""
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
General Public License (GPL) as published by the Free Software
Foundation, in version 2 as it comes in the "COPYING" file of the
VirtualBox OSE distribution. VirtualBox OSE is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
The contents of this file may alternatively be used under the terms
of the Common Development and Distribution License Version 1.0
(CDDL) only, as it comes in the "COPYING.CDDL" file of the
VirtualBox OSE distribution, in which case the provisions of the
CDDL are applicable instead of those of the GPL.
You may elect to license modified versions of this file under the
terms and conditions of either the GPL or the CDDL or both.
"""
__version__ = "$Revision$"
# Validation Kit imports.
class WuiHlpBarGraph(WuiHlpGraphBase):
"""
Bar graph.
"""
""" Sets the max range."""
return None;
def renderGraph(self):
sReport = '<div class="tmbargraph">\n';
# Figure the range.
assert fpMin >= 0;
# Format the data.
sReport += ' <tr>\n' \
' <td>%s</td>\n' \
' <td height="100%%" width="%spx">\n' \
' <table class="tmbargraphl2" height="100%%" width="100%%" ' \
'border="0" cellspacing="0" cellpadding="0">\n' \
sReport += ' <tr><td>\n' \
' <table class="tmbargraphl3" height="100%%" border="0" cellspacing="0" cellpadding="0">\n' \
' <tr>\n';
if cPct >= 99:
sReport += ' <td width="%spx" nowrap bgcolor="%s" align="right">%s </td>\n' \
elif cPct < 1:
sReport += ' <td width="%spx" nowrap style="color:%s;">%s</td>\n' \
elif cPct >= 50:
sReport += ' <td width="%spx" nowrap bgcolor="%s" align="right">%s </td>\n' \
' <td width="%spx" nowrap><div> </div></td>\n' \
else:
sReport += ' <td width="%spx" nowrap bgcolor="%s"></td>\n' \
' <td width="%spx" nowrap> %s</td>\n' \
sReport += ' </tr>\n' \
' </table>\n' \
' </td></tr>\n'
sReport += ' </table>\n' \
' </td>\n' \
' </tr>\n';
sReport += ' <tr></tr>\n'
sReport += '</table>\n';
sReport += '<div class="tmgraphlegend">\n' \
' <p>Legend:\n';
sReport += ' <font color="%s">■ %s</font>\n' \
sReport += ' </p>\n' \
'</div>\n';
sReport += '</div>\n';
return sReport;
class WuiHlpLineGraph(WuiHlpGraphBase):
"""
Line graph.
"""
"""
Line graph with an errorbar for the Y axis.
"""
pass;