cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncTest Manager Web-UI - Graph Helpers - Simple/Stub Implementation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCopyright (C) 2012-2014 Oracle Corporation
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThis file is part of VirtualBox Open Source Edition (OSE), as
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncavailable from http://www.virtualbox.org. This file is free software;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncyou can redistribute it and/or modify it under the terms of the GNU
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncGeneral Public License (GPL) as published by the Free Software
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncFoundation, in version 2 as it comes in the "COPYING" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution. VirtualBox OSE is distributed in the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsynchope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncThe contents of this file may alternatively be used under the terms
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncof the Common Development and Distribution License Version 1.0
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync(CDDL) only, as it comes in the "COPYING.CDDL" file of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncVirtualBox OSE distribution, in which case the provisions of the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncCDDL are applicable instead of those of the GPL.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncYou may elect to license modified versions of this file under the
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncterms and conditions of either the GPL or the CDDL or both.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Validation Kit imports.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncfrom testmanager.webui.wuihlpgraphbase import WuiHlpGraphBase;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """ Sets the max range."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync return None;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Figure the range.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync # Format the data.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sReport += '<table class="tmbargraphl1" border="1" id="%s">\n' % (escapeAttr(self._sId),);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td>%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td height="100%%" width="%spx">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <table class="tmbargraphl2" height="100%%" width="100%%" ' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync 'border="0" cellspacing="0" cellpadding="0">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync % (escapeElem(oRow.sName), escapeAttr(str(self.cxMaxBar + 2)));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync cxBar = int(float(oValue) * self.cxMaxBar / fpMax);
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <table class="tmbargraphl3" height="100%%" border="0" cellspacing="0" cellpadding="0">\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sReport += ' <td width="%spx" nowrap bgcolor="%s" align="right">%s </td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sReport += ' <td width="%spx" nowrap style="color:%s;">%s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sReport += ' <td width="%spx" nowrap bgcolor="%s" align="right">%s </td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td width="%spx" nowrap><div> </div></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sReport += ' <td width="%spx" nowrap bgcolor="%s"></td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <td width="%spx" nowrap> %s</td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </table>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </td></tr>\n'
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </td>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' </tr>\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync if i + 1 < len(aoTable) and len(oRow.aoValues) > 1:
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync ' <p>Legend:\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync sReport += ' <font color="%s">■ %s</font>\n' \
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync '</div>\n';
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Line graph.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Line graph with an errorbar for the Y axis.