src/reportlab/graphics/charts/textlabels.py
branchpy33
changeset 3723 99aa837b6703
parent 3721 0c93dd8ff567
child 4056 be1be82d76fa
equal deleted inserted replaced
3722:29c11b905751 3723:99aa837b6703
   342         )
   342         )
   343 
   343 
   344     def __init__(self):
   344     def __init__(self):
   345         self.textAnchor = 'start'
   345         self.textAnchor = 'start'
   346         self.boxAnchor = 'w'
   346         self.boxAnchor = 'w'
   347         for a in list(self._attrMap.keys()):
   347         for a in self._attrMap.keys():
   348             if not hasattr(self,a): setattr(self,a,None)
   348             if not hasattr(self,a): setattr(self,a,None)
   349 
   349 
   350     def decorate(self,l,L):
   350     def decorate(self,l,L):
   351         chart,g,rowNo,colNo,x,y,width,height,x00,y00,x0,y0 = l._callOutInfo
   351         chart,g,rowNo,colNo,x,y,width,height,x00,y00,x0,y0 = l._callOutInfo
   352         L.setText(chart.categoryAxis.categoryNames[colNo])
   352         L.setText(chart.categoryAxis.categoryNames[colNo])
   353         g.add(L)
   353         g.add(L)
   354 
   354 
   355     def __call__(self,l):
   355     def __call__(self,l):
   356         from copy import deepcopy
   356         from copy import deepcopy
   357         L = Label()
   357         L = Label()
   358         for a,v in list(self.__dict__.items()):
   358         for a,v in self.__dict__.items():
   359             if v is None: v = getattr(l,a,None)
   359             if v is None: v = getattr(l,a,None)
   360             setattr(L,a,v)
   360             setattr(L,a,v)
   361         self.decorate(l,L)
   361         self.decorate(l,L)
   362 
   362 
   363 isOffsetMode=OneOf('high','low','bar','axis')
   363 isOffsetMode=OneOf('high','low','bar','axis')