cartoon

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar func(title string, o ...func(request *BarRequest)) func(w http.ResponseWriter, r *http.Request)

func (*Bar) WithDataDataSets

func (b *Bar) WithDataDataSets(label string, data []interface{}) func(request *BarRequest)

func (*Bar) WithDataLabels

func (b *Bar) WithDataLabels(value []interface{}) func(request *BarRequest)

func (*Bar) WithOptions

func (b *Bar) WithOptions(key string, value interface{}) func(request *BarRequest)

func (*Bar) WithTitle

func (b *Bar) WithTitle(title string) func(request *BarRequest)

func (*Bar) WithXLabel

func (b *Bar) WithXLabel(xLabel string) func(request *BarRequest)

func (*Bar) WithYLabel

func (b *Bar) WithYLabel(yLabel string) func(request *BarRequest)

type BarRequest

func (BarRequest) Plot

func (bar BarRequest) Plot(t Transport) func(w http.ResponseWriter, r *http.Request)

type Charts

type Charts struct {
	Line       Line
	Bar        Bar
	Pie        Pie
	Radar      Radar
	StackedBar StackedBar
	XY         XY
}

func NewCharts

func NewCharts(t Transport) *Charts

type ChartsInterface

type ChartsInterface interface {
	Plot(t Transport) func(w http.ResponseWriter, r *http.Request)
	Save(string, Transport) bool
	Render(t Transport) func(w http.ResponseWriter, r *http.Request)
}

type Line

type Line func(title string, o ...func(request *LineRequest)) func(w http.ResponseWriter, r *http.Request)

func (*Line) WithDataDataSets

func (L *Line) WithDataDataSets(label string, data []interface{}) func(request *LineRequest)

func (*Line) WithDataLabels

func (L *Line) WithDataLabels(value []interface{}) func(request *LineRequest)

func (*Line) WithOptions

func (L *Line) WithOptions(key string, value interface{}) func(request *LineRequest)

func (*Line) WithTitle

func (L *Line) WithTitle(title string) func(request *LineRequest)

func (*Line) WithXLabel

func (L *Line) WithXLabel(xLabel string) func(request *LineRequest)

func (*Line) WithYLabel

func (L *Line) WithYLabel(yLabel string) func(request *LineRequest)

type LineRequest

func (LineRequest) Plot

func (L LineRequest) Plot(t Transport) func(w http.ResponseWriter, r *http.Request)

func (LineRequest) Render

func (L LineRequest) Render(t Transport) func(w http.ResponseWriter, r *http.Request)

func (LineRequest) Save

func (L LineRequest) Save(name string, transport Transport) bool

type Pie

type Pie func(title string, o ...func(request *PieRequest)) func(w http.ResponseWriter, r *http.Request)

func (*Pie) WithDataDataSets

func (p *Pie) WithDataDataSets(label string, data []interface{}) func(request *PieRequest)

func (*Pie) WithDataLabels

func (p *Pie) WithDataLabels(value []interface{}) func(request *PieRequest)

func (*Pie) WithOptions

func (p *Pie) WithOptions(key string, value interface{}) func(request *PieRequest)

func (*Pie) WithTitle

func (p *Pie) WithTitle(title string) func(request *PieRequest)

func (*Pie) WithXLabel

func (p *Pie) WithXLabel(xLabel string) func(request *PieRequest)

func (*Pie) WithYLabel

func (p *Pie) WithYLabel(yLabel string) func(request *PieRequest)

type PieRequest

func (PieRequest) Plot

func (bar PieRequest) Plot(t Transport) func(w http.ResponseWriter, r *http.Request)

type Radar

type Radar func(title string, o ...func(request *RadarRequest)) func(w http.ResponseWriter, r *http.Request)

func (*Radar) WithDataDataSets

func (r *Radar) WithDataDataSets(label string, data []interface{}) func(request *RadarRequest)

func (*Radar) WithDataLabels

func (r *Radar) WithDataLabels(value []interface{}) func(request *RadarRequest)

func (*Radar) WithOptions

func (r *Radar) WithOptions(key string, value interface{}) func(request *RadarRequest)

func (*Radar) WithTitle

func (r *Radar) WithTitle(title string) func(request *RadarRequest)

func (*Radar) WithXLabel

func (r *Radar) WithXLabel(xLabel string) func(request *RadarRequest)

func (*Radar) WithYLabel

func (r *Radar) WithYLabel(yLabel string) func(request *RadarRequest)

type RadarRequest

func (RadarRequest) Plot

func (radar RadarRequest) Plot(t Transport) func(w http.ResponseWriter, r *http.Request)

type StackedBar

type StackedBar func(title string, o ...func(request *StackedBarRequest)) func(w http.ResponseWriter, r *http.Request)

func (*StackedBar) WithDataDataSets

func (s *StackedBar) WithDataDataSets(label string, data []interface{}) func(request *StackedBarRequest)

func (*StackedBar) WithDataLabels

func (s *StackedBar) WithDataLabels(value []interface{}) func(request *StackedBarRequest)

func (*StackedBar) WithOptions

func (s *StackedBar) WithOptions(key string, value interface{}) func(request *StackedBarRequest)

func (*StackedBar) WithTitle

func (s *StackedBar) WithTitle(title string) func(request *StackedBarRequest)

func (*StackedBar) WithXLabel

func (s *StackedBar) WithXLabel(xLabel string) func(request *StackedBarRequest)

func (*StackedBar) WithYLabel

func (s *StackedBar) WithYLabel(yLabel string) func(request *StackedBarRequest)

type StackedBarRequest

type StackedBarRequest struct {
	WithTitle
	WithXLabel
	WithYLabel
	WithDataCollection
	WithOption
}

func (StackedBarRequest) Plot

func (sta StackedBarRequest) Plot(t Transport) func(w http.ResponseWriter, r *http.Request)

type Transport

type Transport interface {
	Execute(w http.ResponseWriter, r *http.Request, v interface{})
	Read(name string) ([]byte, error)
}

type WithData

type WithData struct {
	Labels   []interface{}      `json:"labels"`
	DataSets []WithDataDataSets `json:"datasets"`
}

type WithDataCollection

type WithDataCollection struct {
	Data WithData `json:"data"`
}

type WithDataDataSets

type WithDataDataSets struct {
	Label string        `json:"label"`
	Data  []interface{} `json:"data"`
}

type WithOption

type WithOption struct {
	Options map[string]interface{} `json:"options,omitempty"`
}

func (WithOption) Del

func (W WithOption) Del(key string)

func (WithOption) Get

func (W WithOption) Get(key string) interface{}

func (WithOption) Set

func (W WithOption) Set(key string, value interface{})

type WithTitle

type WithTitle struct {
	Title string `json:"title"`
}

type WithXLabel

type WithXLabel struct {
	XLabel string `json:"xLabel,omitempty"`
}

type WithYLabel

type WithYLabel struct {
	YLabel string `json:"yLabel,omitempty"`
}

type XY

type XY func(title string, o ...func(request *XYRequest)) func(w http.ResponseWriter, r *http.Request)

func (*XY) WithDataDataSets

func (XY *XY) WithDataDataSets(label string, data []interface{}) func(request *XYRequest)

func (*XY) WithDataLabels

func (XY *XY) WithDataLabels(value []interface{}) func(request *XYRequest)

func (XY) WithOptions

func (XY XY) WithOptions(key string, value interface{}) func(request *XYRequest)

func (XY) WithTitle

func (XY XY) WithTitle(title string) func(request *XYRequest)

func (XY) WithXLabel

func (XY XY) WithXLabel(xLabel string) func(request *XYRequest)

func (XY) WithYLabel

func (XY XY) WithYLabel(yLabel string) func(request *XYRequest)

type XYRequest

func (XYRequest) Plot

func (XY XYRequest) Plot(t Transport) func(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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