piechart

package
v2.26.4 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PieSliceTextLabel = "label"
)

Variables

This section is empty.

Functions

func PieChartMaterialHTML added in v2.22.1

func PieChartMaterialHTML(chart google.Chart) string

func PieChartMaterialHTMLPage added in v2.22.1

func PieChartMaterialHTMLPage(chart google.Chart) string

func StreamPieChartMaterialHTML added in v2.22.1

func StreamPieChartMaterialHTML(qw422016 *qt422016.Writer, chart google.Chart)

func StreamPieChartMaterialHTMLPage added in v2.22.1

func StreamPieChartMaterialHTMLPage(qw422016 *qt422016.Writer, chart google.Chart)

func WritePieChartMaterialHTML added in v2.22.1

func WritePieChartMaterialHTML(qq422016 qtio422016.Writer, chart google.Chart)

func WritePieChartMaterialHTMLPage added in v2.22.1

func WritePieChartMaterialHTMLPage(qq422016 qtio422016.Writer, chart google.Chart)

Types

type Chart added in v2.20.0

type Chart struct {
	Title               string
	Subtitle            string
	ChartDiv            string
	AddCountToName      bool
	DefaultCategoryName string
	DataTable           *google.DataTable
	Columns             google.Columns
	Data                piechart.PieChartData
	GoogleOptions       *Options
}

Chart 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) *Chart

func (*Chart) BuildDataTable added in v2.20.0

func (chart *Chart) BuildDataTable() google.DataTable

func (*Chart) ChartDivOrDefault added in v2.20.0

func (chart *Chart) ChartDivOrDefault() string

func (*Chart) DataTableJSON added in v2.20.0

func (chart *Chart) DataTableJSON() []byte

func (*Chart) HTML added in v2.22.1

func (chart *Chart) HTML() string

func (*Chart) LoadDataTableHistogram added in v2.20.0

func (chart *Chart) LoadDataTableHistogram(h *histogram.Histogram, cols google.Columns)

func (*Chart) OptionsJSON added in v2.20.0

func (chart *Chart) OptionsJSON() []byte

func (*Chart) PageHTML added in v2.20.0

func (chart *Chart) PageHTML() string

func (*Chart) PageTitle added in v2.20.0

func (chart *Chart) PageTitle() string

func (*Chart) WriteFilePageHTML added in v2.20.2

func (chart *Chart) WriteFilePageHTML(filename string, perm os.FileMode) error

func (*Chart) WritePage added in v2.20.0

func (chart *Chart) WritePage(w io.Writer)

type Options added in v2.20.0

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

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

func (*Options) Inflate added in v2.20.0

func (opts *Options) Inflate()

func (*Options) MustJSON added in v2.20.0

func (opts *Options) 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