Exemple #1
0
    def create_plot(self, graph_surface):
        y_labels = []
        max_y = self.plugin.max_total_mem
        for x in range(0, int(max_y), int(max_y / 4)):
            y_labels.append("%-4d" % int(float(x) / 1024.0 / 1024.0))
        series_color, fill_color = self.get_colors()

        if self.plugin.screen.driver.get_bpp() == 1:
            alt_series_color = (1.0, 1.0, 1.0, 1.0)
            alt_fill_color = (1.0, 1.0, 1.0, 1.0)
        else:
            alt_series_color = g15convert.get_alt_color(series_color)
            alt_fill_color = g15convert.get_alt_color(fill_color)
        return cairoplot.AreaPlot(
            graph_surface,
            [self.plugin.used_history, self.plugin.cached_history],
            self.view_bounds[2],
            self.view_bounds[3],
            background=None,
            grid=False,
            x_labels=[],
            y_labels=y_labels,
            y_bounds=(0, max_y),
            series_colors=[series_color, alt_series_color],
            fill_colors=[fill_color, alt_fill_color])
Exemple #2
0
 def create_plot(self, graph_surface):
     y_labels = []
     max_y = max(
         max(self.plugin.selected_net.max_send,
             self.plugin.selected_net.max_recv), 102400)
     for x in range(0, int(max_y), int(max_y / 4)):
         y_labels.append("%-3.2f" % (float(x) / 102400.0))
     series_color, fill_color = self.get_colors()
     if self.plugin.screen.driver.get_bpp() == 1:
         alt_series_color = (1.0, 1.0, 1.0, 1.0)
         alt_fill_color = (1.0, 1.0, 1.0, 1.0)
     else:
         alt_series_color = g15convert.get_alt_color(series_color)
         alt_fill_color = g15convert.get_alt_color(fill_color)
     return cairoplot.AreaPlot(
         graph_surface, [
             self.plugin.selected_net.send_history,
             self.plugin.selected_net.recv_history
         ],
         self.view_bounds[2],
         self.view_bounds[3],
         background=None,
         grid=False,
         x_labels=[],
         y_labels=y_labels,
         y_bounds=(0, max_y),
         series_colors=[series_color, alt_series_color],
         fill_colors=[fill_color, alt_fill_color])
Exemple #3
0
 def create_plot(self, graph_surface):
     series_colors, fill_colors = self.get_colors()
     return cairoplot.AreaPlot(
         graph_surface,
         self.plugin.selected_cpu.history,
         self.view_bounds[2],
         self.view_bounds[3],
         background=None,
         grid=False,
         x_labels=[],
         y_labels=["%-6d" % 0, "%-6d" % 50,
                   "%-6d" % 100],
         y_bounds=(0, 100),
         series_colors=[series_colors],
         fill_colors=[fill_colors])