// Render renders the chart with the given renderer to the given io.Writer.
553916
func (pc DonutChart) Render(rp RendererProvider, w io.Writer) error {
	if len(pc.Values) == 0 {
		return errors.New("please provide at least one value")
	}

	r, err := rp(pc.GetWidth(), pc.GetHeight())
	if err != nil {
		return err
	}

	if pc.Font == nil {
		defaultFont, err := GetDefaultFont()
		if err != nil {
			return err
		}
		pc.defaultFont = defaultFont
	}
	r.SetDPI(pc.GetDPI(DefaultDPI))

	canvasBox := pc.getDefaultCanvasBox()
	canvasBox = pc.getCircleAdjustedCanvasBox(canvasBox)

	pc.drawBackground(r)
	pc.drawCanvas(r, canvasBox)


	finalValues, err := pc.finalizeValues(pc.Values)
	if err != nil {
		return err
	}
	pc.drawSlices(r, canvasBox, finalValues)
	pc.drawTitle(r)
	for _, a := range pc.Elements {
		a(r, canvasBox, pc.styleDefaultsElements())
	}

	return r.Save(w)
}
757587
func (OCIRenderer) Render(cfg cloudinit.CloudConfig, os jujuos.OSType) ([]byte, error) {
	var renderedUdata []byte
	var err error
	switch os {
	case jujuos.Ubuntu, jujuos.CentOS:
		renderedUdata, err = renderers.RenderYAML(cfg)
	default:
		return nil, errors.Errorf("Cannot encode userdata for OS: %s", os.String())
	}

	if err != nil {
		return nil, err
	}
	ret := b64.StdEncoding.EncodeToString(renderedUdata)
	return []byte(ret), nil
}
798725
func (g *Group) Render(writer io.Writer) error {
	return g.RenderWithFile(writer, NewFile(""))
}
710321
func Render(node Node) string {
	buf := bytes.NewBuffer(nil)
	node.write(buf, 0, 0)
	return buf.String()
}
690736
func Render(c Compo) {
	WhenDebug(func() {
		Logf("rendering %T")
	})

	if err := render(c); err != nil {
		Log(err)
	}
}
1022789
func (ts TimeSeries) Render(r Renderer, canvasBox Box, xrange, yrange Range, defaults Style) {
	style := ts.Style.InheritFrom(defaults)
	Draw.LineSeries(r, canvasBox, xrange, yrange, style, ts)
}
486913
func render() error {
	tmpl, err := template.New("watch").Parse(source)
	if err != nil {
		return err
	}
	if err := tmpl.Execute(os.Stdout, make([]struct{}, aFew)); err != nil {
		return err
	}
	return nil
}
1296685
func (x XML) Render(w io.Writer, v interface{}) error {
	var result []byte
	var err error

	if x.Indent {
		result, err = xml.MarshalIndent(v, "", "  ")
		result = append(result, '\n')
	} else {
		result, err = xml.Marshal(v)
	}
	if err != nil {
		return err
	}

	// XML marshaled fine, write out the result.
	if hw, ok := w.(http.ResponseWriter); ok {
		x.Head.Write(hw)
	}
	if len(x.Prefix) > 0 {
		w.Write(x.Prefix)
	}
	w.Write(result)
	return nil
}
105553
func (t *TemplateManager) Render(w io.Writer, name string, data interface{}) error {
	stack := []*Template{}
	tplSrc, err := t.getSrc(name)
	if err != nil {
		return err
	}
	err = t.push(&stack, tplSrc, name)
	if err != nil {
		return err
	}
	tpl, err := t.assemble(stack)
	if err != nil {
		return err
	}
	if err != nil {
		return err
	}

	if tpl == nil {
		return Errorf("Nil template named %s", name)
	}

	err = tpl.Execute(w, data)
	if err != nil {
		return err
	}

	return nil
}
117855
func (mr *MockJobRendererMockRecorder) Render(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Render", reflect.TypeOf((*MockJobRenderer)(nil).Render), arg0, arg1, arg2, arg3, arg4, arg5)
}
1012267
func (this *Server) Render(view string, i ...interface{}) (string, error) {

	ext := filepath.Ext(view)

	if _, ok := this.engines[ext]; ok == false {
		return "", errors.New("Engine not found.")
	}

	file := filepath.Join(this.Get("views"), view)

	if _, err := os.Stat(file); err != nil || os.IsNotExist(err) {
		return "", errors.New("Failed to lookup view '" + file + "'")
	}

	i = append(i, this.Locals)

	t, err := this.engines[ext].Render(file, i...)

	if err != nil {
		return "", errors.New("Problem rendering view.")
	}

	return t, nil
}
413645
func (r XML) Render(w http.ResponseWriter) error {
	r.WriteContentType(w)
	return xml.NewEncoder(w).Encode(r.Data)
}
366733
func Render(w http.ResponseWriter, data interface{}, rCode int, tpl *template.Template) {
	// In case of HTML response, setting appropriate header type for text/HTML response
	w.Header().Set(HeaderContentType, HTMLContentType)
	w.WriteHeader(rCode)

	// Rendering an HTML template with appropriate data
	err := tpl.Execute(w, data)
	if err != nil {
		LOGHANDLER.Error(err.Error())
	}
}
1132391
func (gotmpl GoTemplate) Render(wr io.Writer, arg interface{}) error {
	return gotmpl.Execute(wr, arg)
}
574394
func (r ProtoBuf) Render(w http.ResponseWriter) error {
	r.WriteContentType(w)

	bytes, err := proto.Marshal(r.Data.(proto.Message))
	if err != nil {
		return err
	}

	_, err = w.Write(bytes)
	return err
}
772040
func (ui *webInterface) render(w http.ResponseWriter, tmpl string,
	rpt *report.Report, errList, legend []string, data webArgs) {
	file := getFromLegend(legend, "File: ", "unknown")
	profile := getFromLegend(legend, "Type: ", "unknown")
	data.Title = file + " " + profile
	data.Errors = errList
	data.Total = rpt.Total()
	data.SampleTypes = sampleTypes(ui.prof)
	data.Legend = legend
	data.Help = ui.help
	html := &bytes.Buffer{}
	if err := ui.templates.ExecuteTemplate(html, tmpl, data); err != nil {
		http.Error(w, "internal template error", http.StatusInternalServerError)
		ui.options.UI.PrintErr(err)
		return
	}
	w.Header().Set("Content-Type", "text/html")
	w.Write(html.Bytes())
}
659187
func (c *Context) Render(code int, viewName string, data interface{}) error {
	c.Writer.Header().Set("Content-Type", "text/html; charset=utf-8")
	c.Writer.WriteHeader(code)

	t, err := c.NapNap.template.Clone()
	if err != nil {
		return err
	}

	viewPath := path.Join(c.NapNap.templateRootPath, "views", viewName)
	t, err = t.ParseFiles(viewPath)
	if err != nil {
		return err
	}

	t.ExecuteTemplate(c.Writer, viewName, data)
	return nil
}