Ai
1 Star 0 Fork 0

rain/go-chart

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
renderer.go 1.52 KB
一键复制 编辑 原始数据 按行查看 历史
Will Charczuk 提交于 2016-07-12 09:48 +08:00 . ???
package chart
import (
"io"
"github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/drawing"
)
// Renderer represents the basic methods required to draw a chart.
type Renderer interface {
// GetDPI gets the DPI for the renderer.
GetDPI() float64
// SetDPI sets the DPI for the renderer.
SetDPI(dpi float64)
// SetStrokeColor sets the current stroke color.
SetStrokeColor(drawing.Color)
// SetFillColor sets the current fill color.
SetFillColor(drawing.Color)
// SetStrokeWidth sets the stroke width.
SetStrokeWidth(width float64)
// SetStrokeDashArray sets the stroke dash array.
SetStrokeDashArray(dashArray []float64)
// MoveTo moves the cursor to a given point.
MoveTo(x, y int)
// LineTo both starts a shape and draws a line to a given point
// from the previous point.
LineTo(x, y int)
// Close finalizes a shape as drawn by LineTo.
Close()
// Stroke strokes the path.
Stroke()
// Fill fills the path, but does not stroke.
Fill()
// FillStroke fills and strokes a path.
FillStroke()
// Circle draws a circle at the given coords with a given radius.
Circle(radius float64, x, y int)
// SetFont sets a font for a text field.
SetFont(*truetype.Font)
// SetFontColor sets a font's color
SetFontColor(drawing.Color)
// SetFontSize sets the font size for a text field.
SetFontSize(size float64)
// Text draws a text blob.
Text(body string, x, y int)
// MeasureText measures text.
MeasureText(body string) Box
// Save writes the image to the given writer.
Save(w io.Writer) error
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/rainfly123/go-chart.git
git@gitee.com:rainfly123/go-chart.git
rainfly123
go-chart
go-chart
v1.1.0

搜索帮助