cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# -*- coding: utf-8 -*-
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncTest Manager Web-UI - Graph Helpers.
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.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncclass WuiHlpGraphDataTable(object): # pylint: disable=R0903
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Data table container.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """A row."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, sGroup, aoValues, asValues = None):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.aoTable = [ WuiHlpGraphDataTable.Row(sGroupLable, asMemberLabels), ];
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def addRow(self, sGroup, aoValues, asValues = None):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Adds a row to the data table."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.aoTable.append(WuiHlpGraphDataTable.Row(sGroup, aoValues, asValues));
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Gets the number of data groups (rows)."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncclass WuiHlpGraphDataTableEx(object): # pylint: disable=R0903
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync Data container for an table/graph with optional error bars on the Y values.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync A data series.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync The aoXValues, aoYValues and aoYErrorBars are parallel arrays, making a
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync series of (X,Y,Y-err-above-delta,Y-err-below-delta) points.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync The error bars are optional.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def __init__(self, sName, aoXValues, aoYValues, asHtmlTooltips = None, aoYErrorBarBelow = None, aoYErrorBarAbove = None):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync def addDataSeries(self, sName, aoXValues, aoYValues, asHtmlTooltips = None, aoYErrorBarBelow = None, aoYErrorBarAbove = None):
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Adds an data series to the table."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync self.aoSeries.append(WuiHlpGraphDataTableEx.DataSeries(sName, aoXValues, aoYValues, asHtmlTooltips,
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync """Gets the number of data series."""
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# Dynamically choose implementation.
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync from testmanager.webui import wuihlpgraphgooglechart as GraphImplementation;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync from testmanager.webui import wuihlpgraphmatplotlib as GraphImplementation;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync from testmanager.webui import wuihlpgraphsimple as GraphImplementation;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsync# pylint: disable=C0103
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncWuiHlpBarGraph = GraphImplementation.WuiHlpBarGraph;
cf22150eaeeb72431bf1cf65c309a431454fb22bvboxsyncWuiHlpLineGraph = GraphImplementation.WuiHlpLineGraph;