Package Products :: Package ZenModel :: Module AreaGraphPoint
[hide private]
[frames] | no frames]

Source Code for Module Products.ZenModel.AreaGraphPoint

 1  ############################################################################## 
 2  #  
 3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved. 
 4  #  
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  #  
 8  ############################################################################## 
 9   
10   
11  __doc__="""AreaGraphPoint 
12   
13  Handles GraphPoints that define an rrd AREA 
14  """ 
15   
16  from GraphPoint import GraphPoint 
17  from Globals import InitializeClass 
18  from Products.ZenUtils.deprecated import deprecated 
19  from Products.ZenUtils.Utils import unused 
20 21 @deprecated 22 -def manage_addAreaGraphPoint(context, id, REQUEST = None):
23 ''' This is here so than zope will let us copy/paste/rename 24 graphpoints. 25 ''' 26 gp = AreaGraphPoint(id) 27 context._setObject(gp.id, gp) 28 if REQUEST: 29 return context.callZenScreen(REQUEST)
30
31 32 -class AreaGraphPoint(GraphPoint):
33 34 meta_type = 'AreaGraphPoint' 35 36 value = '' 37 color = '' 38 legend = GraphPoint.DEFAULT_LEGEND 39 stacked = False 40 41 _properties = GraphPoint._properties + ( 42 {'id':'value', 'type':'string', 'mode':'w'}, 43 {'id':'color', 'type':'string', 'mode':'w'}, 44 {'id':'legend', 'type':'string', 'mode':'w'}, 45 {'id':'stacked', 'type':'boolean', 'mode':'w'}, 46 ) 47 48
49 - def getDescription(self):
50 return '%s %s' % (self.value, self.legend)
51 52
53 - def getType(self):
54 return 'AREA'
55 56
57 - def getGraphCmds(self, cmds, context, rrdDir, addSummary, idx, 58 multiid=-1, prefix=''):
59 ''' Build the graphing commands for this graphpoint 60 ''' 61 unused(multiid, rrdDir) 62 gopts = 'AREA:%s%s' % ( 63 self.addPrefix(prefix, self.value), self.getColor(idx)) 64 65 if self.legend or self.stacked: 66 legend = self.talesEval(self.legend, context) 67 legend = self.escapeForRRD(legend) 68 gopts += ':%s' % legend 69 if self.stacked: 70 gopts += ':STACK' 71 return cmds + [gopts]
72 73 74 InitializeClass(AreaGraphPoint) 75