google

package
v2.19.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TypeNumber = "number"
	TypeString = "string"
)
View Source
const (
	DefaultWidth    = 900
	DefaultHeight   = 500
	DefaultChartDiv = "chart_div"
)

Variables

This section is empty.

Functions

func LineChartMaterialPage

func LineChartMaterialPage(data LineChartMaterial) string

func PieChartMaterialPage added in v2.19.0

func PieChartMaterialPage(data PieChartMaterial) string

func StreamLineChartMaterialPage

func StreamLineChartMaterialPage(qw422016 *qt422016.Writer, data LineChartMaterial)

func StreamPieChartMaterialPage added in v2.19.0

func StreamPieChartMaterialPage(qw422016 *qt422016.Writer, data PieChartMaterial)

func WriteLineChartMaterialPage

func WriteLineChartMaterialPage(qq422016 qtio422016.Writer, data LineChartMaterial)

func WritePieChartMaterialPage added in v2.19.0

func WritePieChartMaterialPage(qq422016 qtio422016.Writer, data PieChartMaterial)

Types

type Column

type Column struct {
	Type string
	Name string
}

func TimeSeriesSetToLineChartMaterial added in v2.19.0

func TimeSeriesSetToLineChartMaterial(tss *timeseries.TimeSeriesSet, fn func(t time.Time) string) ([]Column, [][]any, error)

type Columns added in v2.19.0

type Columns []Column

func (Columns) Names added in v2.19.0

func (cols Columns) Names() []string

func (Columns) NamesAny added in v2.19.0

func (cols Columns) NamesAny() []any

type LineChartMaterial

type LineChartMaterial struct {
	Title    string
	Subtitle string
	ChartDiv string
	Width    int
	Height   int
	Columns  []Column
	Data     [][]any
}

LineChartMaterial provides data for Google Material Line Charts described here: https://developers.google.com/chart/interactive/docs/gallery/linechart#examples

func LineChartMaterialFromTimeSeriesSet added in v2.7.1

func LineChartMaterialFromTimeSeriesSet(tss timeseries.TimeSeriesSet, yearLabel string) (LineChartMaterial, error)

func NewLineChartMaterial added in v2.19.0

func NewLineChartMaterial() LineChartMaterial

func (*LineChartMaterial) ChartDivOrDefault

func (lcm *LineChartMaterial) ChartDivOrDefault() string

func (*LineChartMaterial) DataMatrixJSON

func (lcm *LineChartMaterial) DataMatrixJSON() []byte

func (*LineChartMaterial) HeightOrDefault

func (lcm *LineChartMaterial) HeightOrDefault() int

func (*LineChartMaterial) LoadTimeSeriesSetMonth added in v2.19.0

func (lcm *LineChartMaterial) LoadTimeSeriesSetMonth(tss *timeseries.TimeSeriesSet, fn func(t time.Time) string) error

func (*LineChartMaterial) PageHTML added in v2.19.0

func (lcm *LineChartMaterial) PageHTML() string

func (*LineChartMaterial) WidthOrDefault

func (lcm *LineChartMaterial) WidthOrDefault() int

func (*LineChartMaterial) WriteFilePage added in v2.19.0

func (lcm *LineChartMaterial) WriteFilePage(filename string, perm os.FileMode) error

type PieChartMaterial added in v2.19.0

type PieChartMaterial struct {
	Title               string
	Subtitle            string
	ChartDiv            string
	Width               int
	Height              int
	AddCountToName      bool
	DefaultCategoryName string
	Columns             Columns
	Data                piechart.PieChartData
	GoogleOptions       PieChartOptionsGoogle
}

PieChartMaterial provides data for Google Material Pie Charts described here: https://developers.google.com/chart/interactive/docs/gallery/piechart

func NewPieChartMaterialInts added in v2.19.0

func NewPieChartMaterialInts(chartName, sliceName, sliceValueName string, vals map[string]int) PieChartMaterial

func (*PieChartMaterial) ChartDivOrDefault added in v2.19.0

func (cm *PieChartMaterial) ChartDivOrDefault() string

func (*PieChartMaterial) DataMatrix added in v2.19.0

func (cm *PieChartMaterial) DataMatrix() [][]any

func (*PieChartMaterial) DataMatrixJSON added in v2.19.0

func (cm *PieChartMaterial) DataMatrixJSON() []byte

func (*PieChartMaterial) HeightOrDefault added in v2.19.0

func (cm *PieChartMaterial) HeightOrDefault() int

func (*PieChartMaterial) PageHTML added in v2.19.0

func (cm *PieChartMaterial) PageHTML() string

func (*PieChartMaterial) WidthOrDefault added in v2.19.0

func (cm *PieChartMaterial) WidthOrDefault() int

func (*PieChartMaterial) WriteFilePage added in v2.19.0

func (cm *PieChartMaterial) WriteFilePage(filename string, perm os.FileMode) error

func (*PieChartMaterial) WritePage added in v2.19.0

func (cm *PieChartMaterial) WritePage(w io.Writer)

type PieChartOptionsGoogle added in v2.19.0

type PieChartOptionsGoogle struct {
	Title             string    `json:"title,omitempty"`
	Legend            string    `json:"legend,omitempty"`
	Height            string    `json:"height,omitempty"`
	Width             string    `json:"width,omitempty"`
	PieHole           float64   `json:"pieHole,omitempty"`
	PieSliceText      string    `json:"pieSliceText,omitempty"`
	PieSliceTextStyle TextStyle `json:"pieSliceTextStyle,omitempty"`
	PieStartAngle     float64   `json:"pieStartAngle,omitempty"`
}

PieChartOptionsGoogle represents the Google Charts JSON options map as defined here: https://developers.google.com/chart/interactive/docs/gallery/piechart .

func (PieChartOptionsGoogle) MustJSON added in v2.19.0

func (opts PieChartOptionsGoogle) MustJSON() []byte

MustJSON represents the Google Charts JSON options map as defined here: https://developers.google.com/chart/interactive/docs/gallery/piechart . The output is intended to be used directly with the client-side JS library call.

type TextStyle added in v2.19.0

type TextStyle struct {
	// https://developers.google.com/chart/interactive/docs/gallery/piechart
	Color    string  `json:"color,omitempty"`
	FontName string  `json:"fontName,omitempty"`
	FontSize float64 `json:"fontSize,omitempty"`
	Bold     bool    `json:"bold,omitempty"`
	Italic   bool    `json:"italic,omitempty"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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