Ticket #6: pie-v2.diff

File pie-v2.diff, 0.9 kB (added by jae@…, 4 years ago)

pie.py patch (version 2)

  • pie.py

     
    7575 
    7676    def _renderBackground(self, cx): 
    7777        """Renders the background of the chart""" 
     78 
    7879        if self.options.background.hide: 
    7980            return 
    80          
     81 
    8182        cx.save() 
    82         cx.set_source_rgb(*hex2rgb(self.options.background.color)) 
    83         cx.rectangle(self.area.x, self.area.y, self.area.w, self.area.h) 
    84         cx.fill() 
     83 
     84        if self.options.background.baseColor: 
     85            cx.set_source_rgb(*hex2rgb(self.options.background.baseColor)) 
     86            x, y, w, h = 0, 0, self.area.w, self.area.h 
     87            w += self.options.padding.left + self.options.padding.right 
     88            h += self.options.padding.top + self.options.padding.bottom 
     89            cx.rectangle(x, y, w, h) 
     90            cx.fill() 
     91 
    8592        cx.restore() 
    8693 
    8794    def _renderChart(self, cx):