Documentation ¶
Index ¶
- Constants
- func FormatXTickTimeFunc(interval timeutil.Interval) func(time.Time) string
- func FormatYTickFunc(seriesName string) func(float64) string
- func MsiToValues(msi maputil.MapStringInt, inclValueInKey bool) []chart.Value
- func TimeSeriesMonthToAnnotations(ts timeseries.TimeSeries, opts LineChartOpts) (chart.AnnotationSeries, error)
- func TimeSeriesSetToLineChart(tset timeseries.TimeSeriesSet, opts *LineChartOpts) (chart.Chart, error)
- func TimeSeriesToBarChart(ds timeseries.TimeSeries) chart.BarChart
- func TimeSeriesToLineChart(ds timeseries.TimeSeries, opts *LineChartOpts) (chart.Chart, error)
- func WriteLineChartTimeSeries(filename string, ts timeseries.TimeSeries, opts *LineChartOpts) error
- func WriteLineChartTimeSeriesSet(filename string, tset timeseries.TimeSeriesSet, opts *LineChartOpts) error
- func YAxisTickFormatDollars(raw float64) string
- func YAxisTickFormatPercent(raw float64) string
- func YAxisTickFormatSimple(raw float64) string
- type AxesCreator
- func (ac *AxesCreator) AddBackground(graph chart.Chart) chart.Chart
- func (ac *AxesCreator) AddXAxis(graph chart.Chart, interval timeutil.Interval, minTime, maxTime time.Time) chart.Chart
- func (ac *AxesCreator) AddYAxis(graph chart.Chart, minValue, maxValue int64) chart.Chart
- func (ac *AxesCreator) AddYAxisPercent(graph chart.Chart, minValue, maxValue float64) chart.Chart
- func (ac *AxesCreator) ChartAddAxesDataSeries(graph chart.Chart, interval timeutil.Interval, minTime, maxTime time.Time, ...) chart.Chart
- type LineChartOpts
Constants ¶
View Source
const RatioTwoCol = ratio.RatioAcademy
Variables ¶
This section is empty.
Functions ¶
func FormatXTickTimeFunc ¶
func FormatYTickFunc ¶
func MsiToValues ¶
func MsiToValues(msi maputil.MapStringInt, inclValueInKey bool) []chart.Value
func TimeSeriesMonthToAnnotations ¶ added in v1.18.0
func TimeSeriesMonthToAnnotations(ts timeseries.TimeSeries, opts LineChartOpts) (chart.AnnotationSeries, error)
func TimeSeriesSetToLineChart ¶ added in v1.7.0
func TimeSeriesSetToLineChart(tset timeseries.TimeSeriesSet, opts *LineChartOpts) (chart.Chart, error)
func TimeSeriesToBarChart ¶ added in v1.7.0
func TimeSeriesToBarChart(ds timeseries.TimeSeries) chart.BarChart
func TimeSeriesToLineChart ¶ added in v1.7.0
func TimeSeriesToLineChart(ds timeseries.TimeSeries, opts *LineChartOpts) (chart.Chart, error)
func WriteLineChartTimeSeries ¶ added in v1.15.2
func WriteLineChartTimeSeries(filename string, ts timeseries.TimeSeries, opts *LineChartOpts) error
func WriteLineChartTimeSeriesSet ¶ added in v1.7.0
func WriteLineChartTimeSeriesSet(filename string, tset timeseries.TimeSeriesSet, opts *LineChartOpts) error
func YAxisTickFormatDollars ¶
func YAxisTickFormatPercent ¶
func YAxisTickFormatSimple ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.