Documentation ¶
Index ¶
- Constants
- func LineChartMaterialPage(data LineChartMaterial) string
- func PieChartMaterialPage(data PieChartMaterial) string
- func StreamLineChartMaterialPage(qw422016 *qt422016.Writer, data LineChartMaterial)
- func StreamPieChartMaterialPage(qw422016 *qt422016.Writer, data PieChartMaterial)
- func WriteLineChartMaterialPage(qq422016 qtio422016.Writer, data LineChartMaterial)
- func WritePieChartMaterialPage(qq422016 qtio422016.Writer, data PieChartMaterial)
- type Column
- type Columns
- type LineChartMaterial
- func (lcm *LineChartMaterial) ChartDivOrDefault() string
- func (lcm *LineChartMaterial) DataMatrixJSON() []byte
- func (lcm *LineChartMaterial) HeightOrDefault() int
- func (lcm *LineChartMaterial) LoadTimeSeriesSetMonth(tss *timeseries.TimeSeriesSet, fn func(t time.Time) string) error
- func (lcm *LineChartMaterial) PageHTML() string
- func (lcm *LineChartMaterial) WidthOrDefault() int
- func (lcm *LineChartMaterial) WriteFilePage(filename string, perm os.FileMode) error
- type PieChartMaterial
- func (cm *PieChartMaterial) ChartDivOrDefault() string
- func (cm *PieChartMaterial) DataMatrix() [][]any
- func (cm *PieChartMaterial) DataMatrixJSON() []byte
- func (cm *PieChartMaterial) HeightOrDefault() int
- func (cm *PieChartMaterial) PageHTML() string
- func (cm *PieChartMaterial) WidthOrDefault() int
- func (cm *PieChartMaterial) WriteFilePage(filename string, perm os.FileMode) error
- func (cm *PieChartMaterial) WritePage(w io.Writer)
- type PieChartOptionsGoogle
- type TextStyle
Constants ¶
const ( TypeNumber = "number" TypeString = "string" )
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 ¶
func TimeSeriesSetToLineChartMaterial ¶ added in v2.19.0
func TimeSeriesSetToLineChartMaterial(tss *timeseries.TimeSeriesSet, fn func(t time.Time) string) ([]Column, [][]any, error)
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.