Exemple #1
0
    def get_x_axis(self, duration, end_secs, tick_height=0):
        x_intervals = 8
        x_steps = 2
        if duration == 600:
            x_intervals = 10

        x_axis = Element()
        x_axis.colour = "#CCCCCC"
        x_axis.grid_colour = "#DDDDDD"
        x_axis.stroke = 1
        x_axis.tick_height = tick_height

        xlbls = Element()
        xlbls.size = 12
        xlbls.colour = "#999999"
        xlbls.align = "auto"
        xlbls.rotate = 0.0001

        lbls = self.get_x_labels(duration, x_intervals, x_steps, end_secs)
        xlbls.labels = lbls
        x_axis.labels = xlbls
        return x_axis
Exemple #2
0
    def make_chart_lines(self, session, chart, line_type, stats, dot_size, halo_size, line_width, samples, duration, end_secs, mode):
        chart.elements = list()
        for stat, color in reversed(zip(stats, self.colors)):
            line = Element()
            line.type = line_type
            line.fill = color
            line.fill_alpha = self.alpha
            line.on_show.type = "No"

            line.dot_style = {"type": "solid-dot",
                              "dot-size": dot_size,
                              "halo-size": halo_size}
            line.colour = color
            line.width = line_width
            tip_title = stat.title.split(" ")[-1]
            line.text = mode == "rate" and "%s / sec" % tip_title or self.get_line_title(stat)

            vals = self.get_vals(session, samples, stat, line.text, duration, end_secs)
            line.values = vals
            chart.elements.append(line)