← Back to team overview

graphite-dev team mailing list archive

Re: [Question #166950]: Creating a template

 

Question #166950 on Graphite changed:
https://answers.launchpad.net/graphite/+question/166950

    Status: Open => Answered

Nicholas Leskiw proposed the following answer:
edit /opt/graphite/webapp/graphite/render/graphTemplates.conf

There should be some examples in there.

Here's the code that loads the template, so if you don't see the option
you're trying to set in this block, it won't get set...

 335   def loadTemplate(self,template):
 336     conf = SafeConfigParser()
 337     if conf.read(settings.GRAPHTEMPLATES_CONF):
 338       defaults = dict( conf.items('default') )
 339       if template in conf.sections():
 340         opts = dict( conf.items(template) )
 341       else:
 342         opts = defaults
 343     else:
 344       opts = defaults = defaultGraphOptions
 345
 346     self.defaultBackground = opts.get('background',
defaults['background'])
 347     self.defaultForeground = opts.get('foreground',
defaults['foreground'])
 348     self.defaultMajorGridLineColor = opts.get('majorline',
defaults['majorline'])
 349     self.defaultMinorGridLineColor = opts.get('minorline',
defaults['minorline'])
 350     self.defaultColorList = [c.strip() for c in opts.get('linecolors',
defaults['linecolors']).split(',')]
 351     fontName = opts.get('fontname', defaults['fontname'])
 352     fontSize = float( opts.get('fontsize', defaults['fontsize']) )
 353     fontBold = opts.get('fontbold', defaults['fontbold']).lower() ==
'true'
 354     fontItalic = opts.get('fontitalic', defaults['fontitalic']).lower()
== 'true'
 355     self.defaultFontParams = {
 356       'name' : self.params.get('fontName',fontName),
 357       'size' : int( self.params.get('fontSize',fontSize) ),
 358       'bold' : self.params.get('fontBold',fontBold),
 359       'italic' : self.params.get('fontItalic',fontItalic),
 360     }



On Thu, Aug 4, 2011 at 10:51 AM, Micah Whitacre <
question166950@xxxxxxxxxxxxxxxxxxxxx> wrote:

> New question #166950 on Graphite:
> https://answers.launchpad.net/graphite/+question/166950
>
> In the CLI documentation[1], it mentions applying templates to graphs.
>  However I have yet to find documentation on how to actually create a
> template.  Can someone point to documentation on how to do it or give
> instructions on doing so?
>
> [1] - http://graphite.wikidot.com/cli-reference
>
> --
> You received this question notification because you are a member of
> graphite-dev, which is an answer contact for Graphite.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~graphite-dev
> Post to     : graphite-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~graphite-dev
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.