Exemplo n.º 1
0
    def plotProductSeverityDistribution(self, dist, product):
        severity_list = ['enhancement', 'trivial', 'minor', 'normal',
                         'major', 'critical', 'blocker']
        values_list = []

        for severity in severity_list:
            values_list.append(dist[severity])

        maxbugs = "%d bugs" % max(values_list)
        vlabels = ['zarro boogs', maxbugs]

        CairoPlot.bar_plot(str(product), values_list, 500, 400,
                           border=20, grid=True,
                           h_labels=severity_list, v_labels=vlabels)
Exemplo n.º 2
0
    def __generate_charts(self, results):

        for test, test_data in results.items():
            mem_data = list()
            time_data = list()

            h_labels = list()

            for key, value in test_data.items():
                # print key, value
                time_data.append(value[0])
                mem_data.append(value[1])
                h_labels.append(key.replace("test_", "").replace("_", " ").capitalize())

            # data = [[3,4], [4,8], [5,3], [9,1]]
            # v_labels = ["line1", "line2", "line3", "line4", "line5", "line6"]
            # h_labels = ["group1", "group2", "group3", "group4"]

            CairoPlot.bar_plot("charts/time_%s.png" % key, time_data, 900, 300, border=20, grid=True, h_labels=h_labels)
            CairoPlot.bar_plot("charts/mem_%s.png" % key, mem_data, 900, 300, border=20, grid=True, h_labels=h_labels)
Exemplo n.º 3
0
    def plotProductSeverityDistribution(self, dist, product):
        severity_list = [
            'enhancement', 'trivial', 'minor', 'normal', 'major', 'critical',
            'blocker'
        ]
        values_list = []

        for severity in severity_list:
            values_list.append(dist[severity])

        maxbugs = "%d bugs" % max(values_list)
        vlabels = ['zarro boogs', maxbugs]

        CairoPlot.bar_plot(str(product),
                           values_list,
                           500,
                           400,
                           border=20,
                           grid=True,
                           h_labels=severity_list,
                           v_labels=vlabels)
Exemplo n.º 4
0
CairoPlot.function_plot('function1', data, 800, 300, grid = True, dots = True, h_bounds=(0,80), step = 0.9, discrete = True)

#test2
CairoPlot.function_plot('function2', data, 800, 300, grid = True, h_bounds=(0,80), step = 0.9)

#test3
CairoPlot.function_plot('function3', data, 800, 300, grid = True, h_bounds=(0,80), step = 0.1)

#test4
data = lambda x : x**2
CairoPlot.function_plot('function4', data, 400, 300, grid = True, h_bounds=(-10,10), step = 0.1)

#Bar Plot
#test1
data = {'teste00' : [27], 'teste01' : [10], 'teste02' : [18], 'teste03' : [5], 'teste04' : [1], 'teste05' : [22], 'teste06' : [31], 'teste07' : [8]}
CairoPlot.bar_plot ('bar1', data, 400, 300, border = 20, grid = True, rounded_corners = False)

#test2
data = [3,1,10,2]
CairoPlot.bar_plot ('bar2.png', data, 300, 300, border = 20, grid = True, rounded_corners = True)

#test3
data = [[1.4, 3, 11], [8, 9, 21], [13, 10, 9], [2, 30, 8]]
h_labels = ["group1", "group2", "group3", "group4"]
colors = [(1,0.2,0), (1,0.7,0), (1,1,0)]
CairoPlot.bar_plot ('bar3', data, 500, 350, border = 20, grid = True, rounded_corners = False, h_labels = h_labels,colors = colors)
CairoPlot.bar_plot ('bar_rounded.png', data, 400, 300, border = 20, grid = True, rounded_corners = True, h_labels = h_labels, colors = colors)
CairoPlot.bar_plot ('bar_3D.png', data, 400, 300, border = 20, grid = True, three_dimension = True, colors = colors)

#test4
data = [[3,4], [4,8], [5,3], [9,1]]
Exemplo n.º 5
0
chart_type = args[0]
variable_x = args[1]
variable_y = args[2]
file_name = args[3]

pipein = sys.stdin.read().splitlines()
lines = oosh.get_from_pipe(pipein)

if chart_type == 'pie':
    pie_data = {}
    for line in lines:
        name = line[variable_x]
        value = int(float(line[variable_y]))
        if value > 0:
            pie_data[name] = value
    CairoPlot.pie_plot(file_name, pie_data, 800, 600, shadow=True)

elif chart_type == 'bar':
    bar_data = {}
    data = []
    labels = []
    for line in lines:
        name = line[variable_x]
        value = float(line[variable_y])
        if value > 0:
            labels.append(name)
            data.append(value)
    CairoPlot.bar_plot (file_name, data, 800, 600, border=20, grid=True,
                        rounded_corners=True, h_labels=labels) 

Exemplo n.º 6
0
#Bar Plot
#test1
data = {
    'teste00': [27],
    'teste01': [10],
    'teste02': [18],
    'teste03': [5],
    'teste04': [1],
    'teste05': [22],
    'teste06': [31],
    'teste07': [8]
}
CairoPlot.bar_plot('bar1',
                   data,
                   400,
                   300,
                   border=20,
                   grid=True,
                   rounded_corners=False)

#test2
data = [3, 1, 10, 2]
CairoPlot.bar_plot('bar2.png',
                   data,
                   300,
                   300,
                   border=20,
                   grid=True,
                   rounded_corners=True)

#test3