rickshaw

package
v2.19.4 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2024 License: MIT Imports: 12 Imported by: 0

README

Rickshaw Example

This example creates a Rickshaw report using static, monthly data.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RickshawExtensionsReport

func RickshawExtensionsReport(data TemplateData) string

func StreamRickshawExtensionsReport

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

func WriteRickshawExtensionsReport

func WriteRickshawExtensionsReport(qq422016 qtio422016.Writer, data TemplateData)

Types

type DataInfoJs

type DataInfoJs struct {
	Color string `json:"color,omitempty"`
	Data  []Item `json:"data"`
	Name  string `json:"name"`
}

DataInfoJS is the series item to be sent to the Rickshaw extensions JS code.

type Item

type Item struct {
	SeriesName string    `json:"-"`
	Time       time.Time `json:"-"`
	ValueX     int64     `json:"x"`
	ValueY     int64     `json:"y"`
}

type MonthData

type MonthData struct {
	SeriesName string
	MonthS     string
	YearS      string
	Dt6        int32
	Value      int64
	ValueS     string
}

MonthData is the input value to be converted into Rickshaw items

func (*MonthData) Inflate

func (am *MonthData) Inflate() error

func (*MonthData) RickshawItem

func (am *MonthData) RickshawItem() (Item, error)

type RickshawData

type RickshawData struct {
	SeriesMap map[string]Series
	MinX      int64
	MaxX      int64
}

func NewMonthlyRickshawDataFromSlotSeriesSet

func NewMonthlyRickshawDataFromSlotSeriesSet(set slot.SlotDataSeriesSet) RickshawData

func NewRickshawData

func NewRickshawData() RickshawData

func (*RickshawData) AddItem

func (rd *RickshawData) AddItem(item Item)

AddItem adds an item to the report

func (*RickshawData) Formatted

func (rd *RickshawData) Formatted() (RickshawDataFormatted, error)

Formatted returns formatted information ready for Rickshaw

func (*RickshawData) Inflate

func (rd *RickshawData) Inflate()

type RickshawDataFormatted

type RickshawDataFormatted struct {
	SeriesNames   []string
	SeriesData    [][]Item
	FormattedData []DataInfoJs
}

func NewRickshawDataFormattedFromDateHistogram

func NewRickshawDataFormattedFromDateHistogram(timeset interval.TimeSeriesSet) RickshawDataFormatted

type Series

type Series struct {
	ItemsMapX map[int64]Item
	MinX      int64
	MaxX      int64
}

func (*Series) Inflate

func (s *Series) Inflate()

type TemplateData

type TemplateData struct {
	HeaderHTML             string
	ReportName             string
	ReportLink             string
	RickshawURL            string
	RickshawDataFormatted  RickshawDataFormatted
	ItemType               string
	IncludeDataTable       bool
	IncludeDataTableTotals bool
}

func (*TemplateData) FormattedDataJSON

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

func (*TemplateData) TableData

func (td *TemplateData) TableData() ([]string, [][]string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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