piechart

package
v2.20.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PieSliceTextLabel = "label"
)

Variables

This section is empty.

Functions

func PieChartMaterialPage

func PieChartMaterialPage(chart google.Chart) string

func StreamPieChartMaterialPage

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

func WritePieChartMaterialPage

func WritePieChartMaterialPage(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) 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) WriteFilePage added in v2.20.0

func (chart *Chart) WriteFilePage(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