Documentation ¶
Index ¶
- Variables
- func ColorImageToDrawing(col color.RGBA) drawing.Color
- func GridLines(values []float64, style chart.Style) []chart.GridLine
- func MustParseColor(colorName string) drawing.Color
- func ParseColor(colorName string) (drawing.Color, error)
- func TSSToChart(data timeseries.TimeSeriesSet, opts ChartOptions) chart.Chart
- func Ticks(tickValues []float64, fn strconvutil.Float64ToString) []chart.Tick
- func TicksAndGridlinesTime(interval timeutil.Interval, timeBegin, timeEnd time.Time, ...) ([]chart.Tick, []chart.GridLine)
- func TicksInt64(tickValues []int64, fn strconvutil.Int64ToString) []chart.Tick
- func TimeSeriesMapToContinuousSeriesMonths(dsm map[string]timeseries.TimeSeries, order []string) []chart.ContinuousSeries
- func TimeSeriesMapToContinuousSeriesQuarters(dsm map[string]timeseries.TimeSeries, order []string) []chart.ContinuousSeries
- func TimeSeriesToContinuousSeries(ds timeseries.TimeSeries) chart.ContinuousSeries
- func TimeSeriesToContinuousSeriesQuarter(ds timeseries.TimeSeries) chart.ContinuousSeries
- func WritePNG(filename string, thisChart ChartType) error
- type ChartOptions
- type ChartType
- type Colors
- func (c Colors) AxisStrokeColor() drawing.Color
- func (c Colors) BackgroundColor() drawing.Color
- func (c Colors) BackgroundStrokeColor() drawing.Color
- func (c Colors) CanvasColor() drawing.Color
- func (c Colors) CanvasStrokeColor() drawing.Color
- func (c Colors) GetSeriesColor(index int) drawing.Color
- func (c Colors) TextColor() drawing.Color
- type TimeFormatter
Constants ¶
This section is empty.
Variables ¶
var ( // ColorOrange is orange. ColorOrange = drawing.Color{R: 255, G: 165, B: 0, A: 255} // ColorGreen is green. ColorGreen = drawing.Color{R: 0, G: 255, B: 0, A: 255} )
Functions ¶
func ColorImageToDrawing ¶
ColorImageToDrawing converts a `color.RGBA` value to a `drawing.Color` value.
func GridLines ¶
func GridLines(values []float64, style chart.Style) []chart.GridLine
GridLines creates a `[]chart.GridLine` from a slice of `int64` and a style.
func MustParseColor ¶
MustParseColor returns a `drawing.Color` for the SVG color name. If the color name is not found, black is returned.
func ParseColor ¶
ParseColor returns a `drawing.Color` for the SVG color name. If the color name is not found, an error is returned.
func TSSToChart ¶ added in v1.7.0
func TSSToChart(data timeseries.TimeSeriesSet, opts ChartOptions) chart.Chart
TSSToChart converts a `TimeSeriesSet` to a `wcharczuk.Chart`.
func Ticks ¶
func Ticks(tickValues []float64, fn strconvutil.Float64ToString) []chart.Tick
Ticks converts a slice of `float64` to a slice of `chart.Tick`. Common formatting functions include `strconvutil.Commify` and `strconvutil.Int64Abbreviation`.
func TicksAndGridlinesTime ¶
func TicksAndGridlinesTime(interval timeutil.Interval, timeBegin, timeEnd time.Time, styleMajor, styleMinor chart.Style, timeFormat func(time.Time) string, tickInterval, gridInterval timeutil.Interval) ([]chart.Tick, []chart.GridLine)
TicksAndGridlinesTime takes a begin and end time and converts it to `[]chart.Tick` and `[]chart.GridLine.`.
func TicksInt64 ¶
func TicksInt64(tickValues []int64, fn strconvutil.Int64ToString) []chart.Tick
TicksInt64 converts a slice of `int64` to a slice of `chart.Tick`. Common formatting functions include `strconvutil.Commify` and `strconvutil.Int64Abbreviation`.
func TimeSeriesMapToContinuousSeriesMonths ¶ added in v1.7.0
func TimeSeriesMapToContinuousSeriesMonths(dsm map[string]timeseries.TimeSeries, order []string) []chart.ContinuousSeries
func TimeSeriesMapToContinuousSeriesQuarters ¶ added in v1.7.0
func TimeSeriesMapToContinuousSeriesQuarters(dsm map[string]timeseries.TimeSeries, order []string) []chart.ContinuousSeries
func TimeSeriesToContinuousSeries ¶ added in v1.7.0
func TimeSeriesToContinuousSeries(ds timeseries.TimeSeries) chart.ContinuousSeries
func TimeSeriesToContinuousSeriesQuarter ¶ added in v1.7.0
func TimeSeriesToContinuousSeriesQuarter(ds timeseries.TimeSeries) chart.ContinuousSeries
Types ¶
type ChartOptions ¶
type Colors ¶
type Colors struct { BackgroundColorVal drawing.Color BackgroundStrokeColorVal drawing.Color CanvasColorVal drawing.Color CanvasStrokeColorVal drawing.Color AxisStrokeColorVal drawing.Color TextColorVal drawing.Color SeriesColorVal drawing.Color }
func ColorsDefault ¶
func ColorsDefault() Colors
func (Colors) AxisStrokeColor ¶
func (Colors) BackgroundColor ¶
func (Colors) BackgroundStrokeColor ¶
func (Colors) CanvasColor ¶
func (Colors) CanvasStrokeColor ¶
type TimeFormatter ¶
type TimeFormatter struct {
Layout string // time format string
}
TimeFormatter provides a struct that satisifies the `github.com/wcharczuk/go-chart.ValueFormatter` interface using a given time layout string.
func (*TimeFormatter) FormatTime ¶
func (tvf *TimeFormatter) FormatTime(v interface{}) string