histogram

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddData

func AddData(histList []*HistData, dt values.Date, cases, deaths json.Number)

AddData adds data into HistData list.

func ExportCSV

func ExportCSV(data []*HistData) ([]byte, error)

ExportHistCSV exports CSV string from list of HistData.

func ExportJSON

func ExportJSON(data []*HistData) ([]byte, error)

ExportJSON function returns JSON string from list of HistData.

Types

type HistData

type HistData struct {
	Period values.Period
	Cases  float64
	Deaths float64
}

HistData is class of cases data record for histgram.

func New

func New(period values.Period, cases, deaths float64) *HistData

New function creates a new HistData instance.

func NewList

func NewList(p values.Period, step int) ([]*HistData, values.Period)

NewList creates list of HistData.

func (*HistData) AddCases

func (h *HistData) AddCases(cases float64) *HistData

AddCases method adds cases count in HistData

func (*HistData) AddDeaths

func (h *HistData) AddDeaths(deaths float64) *HistData

AddDeaths method adds deaths count in HistData

func (*HistData) Contains

func (h *HistData) Contains(dt values.Date) bool

Contains method returns true if scape of this contains date of parameter.

Jump to

Keyboard shortcuts

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