sts2wchart

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 17 Imported by: 3

Documentation

Index

Constants

View Source
const RatioTwoCol = ratio.RatioAcademy

Variables

This section is empty.

Functions

func FormatXTickTimeFunc

func FormatXTickTimeFunc(interval timeutil.Interval) func(time.Time) string

func FormatYTickFunc

func FormatYTickFunc(seriesName string) func(float64) string

func MsiToValues

func MsiToValues(msi maputil.MapStringInt, inclValueInKey bool) []chart.Value

func TimeSeriesMonthToAnnotations

func TimeSeriesMonthToAnnotations(ts timeseries.TimeSeries, opts LineChartOpts) (chart.AnnotationSeries, error)

func TimeSeriesSetToLineChart

func TimeSeriesSetToLineChart(tset timeseries.TimeSeriesSet, opts *LineChartOpts) (chart.Chart, error)

func TimeSeriesToBarChart

func TimeSeriesToBarChart(ds timeseries.TimeSeries) chart.BarChart

func TimeSeriesToLineChart

func TimeSeriesToLineChart(ds timeseries.TimeSeries, opts *LineChartOpts) (chart.Chart, error)

func WriteLineChartTimeSeries

func WriteLineChartTimeSeries(filename string, ts timeseries.TimeSeries, opts *LineChartOpts) error

func WriteLineChartTimeSeriesSet

func WriteLineChartTimeSeriesSet(filename string, tset timeseries.TimeSeriesSet, opts *LineChartOpts) error

func YAxisTickFormatDollars

func YAxisTickFormatDollars(raw float64) string

func YAxisTickFormatPercent

func YAxisTickFormatPercent(raw float64) string

func YAxisTickFormatSimple

func YAxisTickFormatSimple(raw float64) string

Types

type AxesCreator

type AxesCreator struct {
	GridMajorStyle             chart.Style
	GridMinorStyle             chart.Style
	PaddingTop                 int
	YNumTicks                  int
	XAxisTickInterval          timeutil.Interval // year, quarter, month
	XAxisGridInterval          timeutil.Interval
	XAxisTickFormatFunc        func(time.Time) string
	YAxisTickFormatFuncFloat64 func(float64) string
}

func (*AxesCreator) AddBackground

func (ac *AxesCreator) AddBackground(graph chart.Chart) chart.Chart

func (*AxesCreator) AddXAxis

func (ac *AxesCreator) AddXAxis(graph chart.Chart, interval timeutil.Interval, minTime, maxTime time.Time) chart.Chart

func (*AxesCreator) AddYAxis

func (ac *AxesCreator) AddYAxis(graph chart.Chart, minValue, maxValue int64) chart.Chart

func (*AxesCreator) AddYAxisPercent

func (ac *AxesCreator) AddYAxisPercent(graph chart.Chart, minValue, maxValue float64) chart.Chart

func (*AxesCreator) ChartAddAxesDataSeries

func (ac *AxesCreator) ChartAddAxesDataSeries(graph chart.Chart, interval timeutil.Interval, minTime, maxTime time.Time, minValue, maxValue int64) chart.Chart

type LineChartOpts

type LineChartOpts struct {
	TitleSuffixCurrentValue     bool
	TitleSuffixCurrentValueFunc func(int64) string
	TitleSuffixCurrentDateFunc  func(time.Time) string
	Legend                      bool
	RegressionDegree            int
	NowAnnotation               bool
	MAgoAnnotation              bool
	QAgoAnnotation              bool
	YAgoAnnotation              bool
	AgoAnnotationPct            bool
	YAxisLeft                   bool
	YAxisMin                    float64
	YAxisMinEnable              bool
	XAxisGridInterval           timeutil.Interval
	XAxisTickFunc               func(time.Time) string
	XAxisTickInterval           timeutil.Interval // year, quarter, month
	YAxisTickFunc               func(float64) string
	Width                       uint64
	Height                      uint64
	AspectRatio                 float64
	Interval                    timeutil.Interval
}

LineChartOpts is used for month and quarter interval charts.

func DefaultLineChartOpts

func DefaultLineChartOpts() *LineChartOpts

func (*LineChartOpts) WantAnnotations

func (opts *LineChartOpts) WantAnnotations() bool

func (*LineChartOpts) WantTitleSuffix

func (opts *LineChartOpts) WantTitleSuffix() bool

Jump to

Keyboard shortcuts

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