func NewRenderer(cc *contentstream.ContentCreator, res *model.PdfPageResources) func(int, int) (render.Renderer, error)
NewRenderer returns a new unichart renderer instance creation function.
Renderer is a unichart renderer, used to draw chart components.
type Renderer struct {
// contains filtered or unexported fields
}
func (r *Renderer) ArcTo(cx, cy int, rx, ry, startAngle, deltaAngle float64)
ArcTo draws an arc with a given center (`cx`, `cy`), a given set of radii (`rx`, `ry`), a `startAngle` and `deltaAngle` (in radians).
func (r *Renderer) Circle(radius float64, x, y int)
Circle draws a circle at the given coordinates, with a given radius.
func (r *Renderer) ClearTextRotation()
ClearTextRotation clears rotation of the text.
func (r *Renderer) Close()
Close finalizes a shape, closing the path.
func (r *Renderer) Fill()
Fill fills the current path.
func (r *Renderer) FillStroke()
FillStroke fills and strokes the current path.
func (r *Renderer) GetDPI() float64
GetDPI gets the DPI for the renderer.
func (r *Renderer) LineTo(x, y int)
LineTo draws a line to the specified point, starting from the previous one.
func (r *Renderer) MeasureText(text string) render.Box
MeasureText measures the specified text.
func (r *Renderer) MoveTo(x, y int)
MoveTo moves the cursor to the specified point.
func (r *Renderer) QuadCurveTo(cx, cy, x, y int)
QuadCurveTo draws a quad curve. `cx` and `cy` are the Bézier control points.
func (r *Renderer) ResetStyle()
ResetStyle resets all the style related settings of the renderer.
func (r *Renderer) Save(w io.Writer) error
Save saves the rendered data to the given writer.
func (r *Renderer) SetClassName(name string)
SetClassName sets the current class name.
func (r *Renderer) SetDPI(dpi float64)
SetDPI sets the DPI for the renderer.
func (r *Renderer) SetFillColor(color color.Color)
SetFillColor sets the current fill color.
func (r *Renderer) SetFont(font render.Font)
SetFont sets the current font.
func (r *Renderer) SetFontColor(color color.Color)
SetFontColor sets the current font color.
func (r *Renderer) SetFontSize(size float64)
SetFontSize sets the current font size.
func (r *Renderer) SetStrokeColor(color color.Color)
SetStrokeColor sets the current stroke color.
func (r *Renderer) SetStrokeDashArray(dashArray []float64)
SetStrokeDashArray sets the stroke dash array.
func (r *Renderer) SetStrokeWidth(width float64)
SetStrokeWidth sets the stroke width.
func (r *Renderer) SetTextRotation(radians float64)
SetTextRotation sets the rotation of the text.
func (r *Renderer) Stroke()
Stroke strokes the current path.
func (r *Renderer) Text(text string, x, y int)
Text draws a text chunk.