Documentation ¶
Index ¶
- func AVIF(opts ...interface{}) canvas.Writer
- func BMP(opts ...interface{}) canvas.Writer
- func EPS(opts ...interface{}) canvas.Writer
- func GIF(opts ...interface{}) canvas.Writer
- func JPEG(opts ...interface{}) canvas.Writer
- func NewGoChart(writer canvas.Writer) func(int, int) (chart.Renderer, error)
- func NewGonumPlot(r canvas.Renderer) draw.Canvas
- func PDF(opts ...interface{}) canvas.Writer
- func PNG(opts ...interface{}) canvas.Writer
- func PS(opts ...interface{}) canvas.Writer
- func SVG(opts ...interface{}) canvas.Writer
- func SVGZ(opts ...interface{}) canvas.Writer
- func TIFF(opts ...interface{}) canvas.Writer
- func TeX(opts ...interface{}) canvas.Writer
- func WebP(opts ...interface{}) canvas.Writer
- func Write(filename string, c *canvas.Canvas, opts ...interface{}) error
- type GoChart
- func (r *GoChart) ArcTo(cx, cy int, rx, ry, startAngle, delta float64)
- func (r *GoChart) Circle(radius float64, x, y int)
- func (r *GoChart) ClearTextRotation()
- func (r *GoChart) Close()
- func (r *GoChart) Fill()
- func (r *GoChart) FillStroke()
- func (r *GoChart) GetDPI() float64
- func (r *GoChart) LineTo(x, y int)
- func (r *GoChart) MeasureText(body string) chart.Box
- func (r *GoChart) MoveTo(x, y int)
- func (r *GoChart) QuadCurveTo(cx, cy, x, y int)
- func (r *GoChart) ResetStyle()
- func (r *GoChart) Save(w io.Writer) error
- func (r *GoChart) SetClassName(name string)
- func (r *GoChart) SetDPI(dpi float64)
- func (r *GoChart) SetFillColor(col drawing.Color)
- func (r *GoChart) SetFont(f *truetype.Font)
- func (r *GoChart) SetFontColor(col drawing.Color)
- func (r *GoChart) SetFontSize(size float64)
- func (r *GoChart) SetStrokeColor(col drawing.Color)
- func (r *GoChart) SetStrokeDashArray(dashArray []float64)
- func (r *GoChart) SetStrokeWidth(width float64)
- func (r *GoChart) SetTextRotation(radian float64)
- func (r *GoChart) Stroke()
- func (r *GoChart) Text(body string, x, y int)
- type GonumPlot
- func (r *GonumPlot) DrawImage(rect vg.Rectangle, img image.Image)
- func (r *GonumPlot) Fill(path vg.Path)
- func (r *GonumPlot) FillString(f gonumFont.Face, pt vg.Point, text string)
- func (r *GonumPlot) Pop()
- func (r *GonumPlot) Push()
- func (r *GonumPlot) Rotate(rad float64)
- func (r *GonumPlot) Scale(x, y float64)
- func (r *GonumPlot) SetColor(col color.Color)
- func (r *GonumPlot) SetLineDash(pattern []vg.Length, offset vg.Length)
- func (r *GonumPlot) SetLineWidth(length vg.Length)
- func (r *GonumPlot) Size() (vg.Length, vg.Length)
- func (r *GonumPlot) Stroke(path vg.Path)
- func (r *GonumPlot) Translate(pt vg.Point)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AVIF ¶
AVIF returns a AVIF writer that uses libaom and accepts the following options: canvas.Resolution, canvas.Colorspace, github.com/Kagami/go-avif.*Options
func BMP ¶
BMP returns a BMP writer and accepts the following options: canvas.Resolution, canvas.Colorspace
func EPS ¶
EPS returns a Encapsulated PostScript writer and accepts the following options: canvas/renderers/ps.*Options
func GIF ¶
GIF returns a GIF writer and accepts the following options: canvas.Resolution, canvas.Colorspace, image/gif.*Options
func JPEG ¶
JPEG returns a JPEG writer and accepts the following options: canvas.Resolution, canvas.Colorspace, image/jpeg.*Options
func NewGoChart ¶
NewGoChart returns a new github.com/wcharczuk/go-chart renderer.
func NewGonumPlot ¶
NewGonumPlot returns a new github.com/gonum/plot/vg renderer.
func PDF ¶
PDF returns a PDF writer and accepts the following options: canvas/renderers/pdf.*Options
func PNG ¶
PNG returns a PNG writer and accepts the following options: canvas.Resolution, canvas.Colorspace, image/png.Encoder
func PS ¶
PS returns a PostScript writer and accepts the following options: canvas/renderers/ps.*Options
func SVG ¶
SVG returns an SVG writer and accepts the following options: canvas/renderers/svg.*Options
func SVGZ ¶
SVGZ returns a GZIP compressed SVG writer and accepts the following options: canvas/renderers/svgsvg.*Options
func TIFF ¶
TIFF returns a TIFF writer and accepts the following options: canvas.Resolution, canvas.Colorspace, golang.org/x/image/tiff.*Options
func WebP ¶
WebP returns a Webp writer that uses libwebp and accepts the following options: canvas.Resolution, canvas.Colorspace, github.com/kolesa-team/go-webp/encoder.*Options
Types ¶
type GoChart ¶
type GoChart struct {
// contains filtered or unexported fields
}
GoChart is a github.com/wcharczuk/go-chart renderer.
func (*GoChart) ArcTo ¶
ArcTo draws an arc with a given center (cx,cy) a given set of radii (rx,ry), a startAngle and delta (in radians).
func (*GoChart) ClearTextRotation ¶
func (r *GoChart) ClearTextRotation()
ClearTextRotation clears rotation.
func (*GoChart) LineTo ¶
LineTo both starts a shape and draws a line to a given point from the previous point.
func (*GoChart) MeasureText ¶
MeasureText measures text.
func (*GoChart) QuadCurveTo ¶
QuadCurveTo draws a quad curve. cx and cy represent the Bézier control points.
func (*GoChart) ResetStyle ¶
func (r *GoChart) ResetStyle()
ResetStyle resets any style related settings of the renderer.
func (*GoChart) SetClassName ¶
SetClassName sets the current class name.
func (*GoChart) SetFillColor ¶
SetFillColor sets the current fill color.
func (*GoChart) SetFontColor ¶
SetFontColor sets a font's color.
func (*GoChart) SetFontSize ¶
SetFontSize sets the font size for a text field.
func (*GoChart) SetStrokeColor ¶
SetStrokeColor sets the current stroke color.
func (*GoChart) SetStrokeDashArray ¶
SetStrokeDashArray sets the stroke dash array.
func (*GoChart) SetStrokeWidth ¶
SetStrokeWidth sets the stroke width.
func (*GoChart) SetTextRotation ¶
SetTextRotation sets a rotation for drawing elements.
type GonumPlot ¶
type GonumPlot struct {
// contains filtered or unexported fields
}
GonumPlot is a github.com/gonum/plot/vg renderer.
func (*GonumPlot) FillString ¶
FillString fills in text at the specified location using the given font. If the font size is zero, the text is not drawn.
func (*GonumPlot) Pop ¶
func (r *GonumPlot) Pop()
Pop restores the context saved by the corresponding call to Push().
func (*GonumPlot) Push ¶
func (r *GonumPlot) Push()
Push saves the current line width, the current dash pattern, the current transforms, and the current color onto a stack so that the state can later be restored by calling Pop().
func (*GonumPlot) Rotate ¶
Rotate applies a rotation transform to the context. The parameter is specified in radians.
func (*GonumPlot) SetColor ¶
SetColor sets the current drawing color. Note that fill color and stroke color are the same, so if you want different fill and stroke colors then you must set a color, draw fills, set a new color and then draw lines.
The initial color is black. If SetColor is called with a nil color then black is used.
func (*GonumPlot) SetLineDash ¶
SetLineDash sets the dash pattern for lines. The pattern slice specifies the lengths of alternating dashes and gaps, and the offset specifies the distance into the dash pattern to start the dash.
The initial dash pattern is a solid line.
func (*GonumPlot) SetLineWidth ¶
SetLineWidth sets the width of stroked paths. If the width is not positive then stroked lines are not drawn.
The initial line width is 1 point.