c3

package
v2.18.7 Latest Latest
Warning

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

Go to latest
Published: May 11, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ChartTypeBar = "bar"
)

Variables

This section is empty.

Functions

func C3BarChartJS

func C3BarChartJS(chart C3Chart) string

func C3ChartHTMLSimple

func C3ChartHTMLSimple(id string, chart C3Chart) string

func C3DonutChartPage

func C3DonutChartPage(data TemplateData) string

func StreamC3BarChartJS

func StreamC3BarChartJS(qw422016 *qt422016.Writer, chart C3Chart)

func StreamC3ChartHTMLSimple

func StreamC3ChartHTMLSimple(qw422016 *qt422016.Writer, id string, chart C3Chart)

func StreamC3DonutChartPage

func StreamC3DonutChartPage(qw422016 *qt422016.Writer, data TemplateData)

func StreamTimeseriesHTML

func StreamTimeseriesHTML(qw422016 *qt422016.Writer, data TimeseriesData)

func StreamTimeseriesPage

func StreamTimeseriesPage(qw422016 *qt422016.Writer, pageData TimeseriesPageData)

func TimeseriesHTML

func TimeseriesHTML(data TimeseriesData) string

func TimeseriesPage

func TimeseriesPage(pageData TimeseriesPageData) string

func WriteC3BarChartJS

func WriteC3BarChartJS(qq422016 qtio422016.Writer, chart C3Chart)

func WriteC3ChartHTMLSimple

func WriteC3ChartHTMLSimple(qq422016 qtio422016.Writer, id string, chart C3Chart)

func WriteC3DonutChartPage

func WriteC3DonutChartPage(qq422016 qtio422016.Writer, data TemplateData)

func WriteTimeseriesHTML

func WriteTimeseriesHTML(qq422016 qtio422016.Writer, data TimeseriesData)

func WriteTimeseriesPage

func WriteTimeseriesPage(qq422016 qtio422016.Writer, pageData TimeseriesPageData)

Types

type C3Axis

type C3Axis struct {
	X C3AxisX `json:"x,omitempty"`
}

type C3AxisX

type C3AxisX struct {
	Type       string   `json:"type,omitempty"` // "Category"
	Categories []string `json:"categories,omitempty"`
}

type C3Bar

type C3Bar struct {
	WidthRatio float64
	Width      int
}

type C3Chart

type C3Chart struct {
	Bindto string      `json:"bindto,omitempty"`
	Data   C3ChartData `json:"data,omitempty"`
	Axis   C3Axis      `json:"axis,omitempty"`
	Grid   C3Grid      `json:"grid,omitempty"`
	Donut  C3Donut     `json:"donut,omitempty"`
	Bar    C3Bar       `json:"bar,omitempty"`
}

func SlotDataSeriesSetSimpleToC3ChartBar

func SlotDataSeriesSetSimpleToC3ChartBar(input slot.SlotDataSeriesSetSimple, c3BarInfo C3Bar, hardMax int64) (C3Chart, error)

func TimeSeriesSetSimpleToC3ChartBar

func TimeSeriesSetSimpleToC3ChartBar(data []timeseries.RowInt64, c3BarInfo C3Bar) C3Chart

func (*C3Chart) MustJSON

func (data *C3Chart) MustJSON() []byte

type C3ChartData

type C3ChartData struct {
	X       string  `json:"x,omitempty"`
	Columns [][]any `json:"columns,omitempty"`
	Type    string  `json:"type,omitempty"`
}

func (*C3ChartData) MustJSON

func (data *C3ChartData) MustJSON() []byte

type C3ColumnInt

type C3ColumnInt struct {
	Name   string
	Values []int
}

type C3ColumnsInt

type C3ColumnsInt struct {
	Columns []C3ColumnInt
}

func (*C3ColumnsInt) ToC3ChartData

func (cols *C3ColumnsInt) ToC3ChartData(chartType string) C3ChartData

type C3Donut

type C3Donut struct {
	Title string `json:"title,omitempty"`
}

type C3Grid

type C3Grid struct {
	X C3GridLines `json:"x,omitempty"`
	Y C3GridLines `json:"y,omitempty"`
}

type C3GridLine

type C3GridLine struct {
	Value    any    `json:"value,omitempty"`
	Text     string `json:"text,omitempty"`
	Class    string `json:"class,omitempty"`
	Position string `json:"position,omitempty"`
}

type C3GridLines

type C3GridLines struct {
	Show  bool       `json:"show,omitempty"`
	Lines C3GridLine `json:"lines,omitempty"`
}

type TemplateData

type TemplateData struct {
	HeaderHTML             string
	ReportName             string
	ReportLink             string
	IncludeDataTable       bool
	IncludeDataTableTotals bool
	C3Chart                C3Chart
	FooterHTML             string
}

func (*TemplateData) FormattedDataJSON

func (td *TemplateData) FormattedDataJSON() []byte

type TimeseriesData

type TimeseriesData struct {
	IncludeTitle  bool
	Title         string
	TitleLevel    string
	DivID         string
	JSDataVar     string
	JSChartVar    string
	TimeSeriesSet *interval.TimeSeriesSet
	JSONData      TimeseriesDataJSON
}

func (*TimeseriesData) AddTimeSeriesSet

func (data *TimeseriesData) AddTimeSeriesSet(set *interval.TimeSeriesSet, interval timeutil.Interval, seriesType interval.SeriesType) error

func (*TimeseriesData) DataJSON

func (data *TimeseriesData) DataJSON() []byte

func (*TimeseriesData) FormattedDataJSON

func (data *TimeseriesData) FormattedDataJSON() []byte

type TimeseriesDataJSON

type TimeseriesDataJSON struct {
	Columns   [][]any          `json:"columns"`
	Totals    []int64          `json:"totals"`
	TotalsMap map[string]int64 `json:"totalsMap"`
}

func (*TimeseriesDataJSON) JSON

func (tdj *TimeseriesDataJSON) JSON() []byte

type TimeseriesPageData

type TimeseriesPageData struct {
	Title     string
	URL       string
	Charts    []TimeseriesData
	Xox       interval.YoYQoQGrowth
	XoxPoints []interval.XoxPoint
}

Directories

Path Synopsis
c3sts is a package for creating C3 charts from statictimeseries data.
c3sts is a package for creating C3 charts from statictimeseries data.
examples

Jump to

Keyboard shortcuts

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