piechart

package
v2.19.8 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PieChartMaterialPage

func PieChartMaterialPage(data PieChartMaterial) string

func StreamPieChartMaterialPage

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

func WritePieChartMaterialPage

func WritePieChartMaterialPage(qq422016 qtio422016.Writer, data PieChartMaterial)

Types

type PieChartMaterial

type PieChartMaterial struct {
	Title               string
	Subtitle            string
	ChartDiv            string
	Width               int
	Height              int
	AddCountToName      bool
	DefaultCategoryName string
	Columns             google.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

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

func (*PieChartMaterial) ChartDivOrDefault

func (cm *PieChartMaterial) ChartDivOrDefault() string

func (*PieChartMaterial) DataTable

func (cm *PieChartMaterial) DataTable() google.DataTable

func (*PieChartMaterial) DataTableJSON

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

func (*PieChartMaterial) HeightOrDefault

func (cm *PieChartMaterial) HeightOrDefault() int

func (*PieChartMaterial) OptionsJSON

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

func (*PieChartMaterial) PageHTML

func (cm *PieChartMaterial) PageHTML() string

func (*PieChartMaterial) WidthOrDefault

func (cm *PieChartMaterial) WidthOrDefault() int

func (*PieChartMaterial) WriteFilePage

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

func (*PieChartMaterial) WritePage

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

type PieChartOptionsGoogle

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

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

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"`
}

Jump to

Keyboard shortcuts

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