Subversion Repositories basico

Rev

Rev 4 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 74
Line 25... Line 25...
25
25
26
    def get_services(self):
26
    def get_services(self):
27
        self.sap = self.app.get_service('SAP')
27
        self.sap = self.app.get_service('SAP')
28
28
29
    def build_pie_maincomp(self):
29
    def build_pie_maincomp(self):
30
        stats  = self.sap.get_stats()
-
 
-
 
30
        db = self.get_service('DB')
-
 
31
        stats  = db.get_stats()
31
        CHART_FILE = self.app.get_var('TMP', 'local') + 'chart.svg'
32
        CHART_FILE = self.app.get_var('TMP', 'local') + 'chart.svg'
32
        config = Config()
33
        config = Config()
33
        config.show_legend = True
34
        config.show_legend = True
-
 
35
        config.legend_at_bottom = True
34
        config.print_values = True
36
        config.print_values = True
35
        config.print_values_position = 'top'
37
        config.print_values_position = 'top'
36
        config.print_labels = True
38
        config.print_labels = True
37
        #~ config.dynamic_print_values = True
39
        #~ config.dynamic_print_values = True
38
        config.human_readable = True
40
        config.human_readable = True
Line 48... Line 50...
48
50
49
        return self.get_html(CHART_FILE)
51
        return self.get_html(CHART_FILE)
50
52
51
53
52
    def build_pie_categories(self):
54
    def build_pie_categories(self):
53
        stats  = self.sap.get_stats()
-
 
-
 
55
        db = self.get_service('DB')
-
 
56
        stats  = db.get_stats()
54
        CHART_FILE = self.app.get_var('TMP', 'local') + 'chart.svg'
57
        CHART_FILE = self.app.get_var('TMP', 'local') + 'chart.svg'
55
        config = Config()
58
        config = Config()
56
        config.show_legend = True
59
        config.show_legend = True
-
 
60
        config.legend_at_bottom = True
57
        config.print_values = True
61
        config.print_values = True
58
        config.print_values_position = 'top'
62
        config.print_values_position = 'top'
59
        config.print_labels = True
63
        config.print_labels = True
-
 
64
        #~ config.rounded_bars=20
60
        #~ config.dynamic_print_values = True
65
        #~ config.dynamic_print_values = True
61
        config.human_readable = True
66
        config.human_readable = True
62
        config.fill = True
67
        config.fill = True
63
        #~ chart = pygal.XY(config)
68
        #~ chart = pygal.XY(config)
64
        pie_chart = pygal.HorizontalBar(config)
69
        pie_chart = pygal.HorizontalBar(config)