svgchart

package module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2020 License: MIT Imports: 6 Imported by: 1

README

svg-charts

Documentation

Index

Constants

View Source
const (
	AlignmentLeft   = core.AlignmentLeft
	AlignmentRight  = core.AlignmentRight
	AlignmentCenter = core.AlignmentCenter
)

Variables

This section is empty.

Functions

func SeriesData

func SeriesData(data ...interface{}) []interface{}

Types

type AxisOptions

type AxisOptions struct {
	Title string
}

AxisOptions for chart

type ChartOptions

type ChartOptions struct {
	Type       string
	Height     int
	Width      int
	BackGround string
}

ChartOptions for specified type

func (*ChartOptions) ChartType

func (option *ChartOptions) ChartType() (core.ChartType, error)

type LabelOptions

type LabelOptions struct {
	FontSize int
	Color    string
}

type LegendOptions

type LegendOptions struct {
	Position core.Position
	Hide     bool
}

LegendOptions for series

type Options

type Options struct {
	// Series of data
	Series      []*SeriesOption
	Labels      []string
	LabelOption *LabelOptions
	// Series color
	Colors []string
	Chart  *ChartOptions
	Title  *TitleOptions
	Legend *LegendOptions
	XAxis  *AxisOptions
	YAxis  *AxisOptions
}

Options of the chart

type SVGChart

type SVGChart struct {
	// contains filtered or unexported fields
}

func NewSVGChart

func NewSVGChart(options Options) (*SVGChart, error)

func (*SVGChart) Render

func (svg *SVGChart) Render(w io.Writer) error

type SeriesOption

type SeriesOption struct {
	Name   string
	Data   []interface{}
	Colors []string
}

type TitleOptions

type TitleOptions struct {
	Text      string
	Alignment core.Alignment
	FontSize  int
	Hide      bool
}

Directories

Path Synopsis
_examples
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
modules

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL