Documentation ¶
Index ¶
- Variables
- func ColorImageToDrawing(col color.RGBA) drawing.Color
- func DSSToChart(data statictimeseries.DataSeriesSet, opts ChartOptions) chart.Chart
- func DataSeriesMapToContinuousSeriesMonths(dsm map[string]statictimeseries.DataSeries, order []string) []chart.ContinuousSeries
- func DataSeriesMapToContinuousSeriesQuarters(dsm map[string]statictimeseries.DataSeries, order []string) []chart.ContinuousSeries
- func DataSeriesToContinuousSeries(ds statictimeseries.DataSeries) chart.ContinuousSeries
- func DataSeriesToContinuousSeriesQuarter(ds statictimeseries.DataSeries) chart.ContinuousSeries
- func GridLines(values []float64, style chart.Style) []chart.GridLine
- func MustParseColor(colorName string) drawing.Color
- func ParseColor(colorName string) (drawing.Color, error)
- 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 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 DSSToChart ¶
func DSSToChart(data statictimeseries.DataSeriesSet, opts ChartOptions) chart.Chart
DSSToChart converts a `DataSeriesSet` to a `wcharczuk.Chart`.
func DataSeriesMapToContinuousSeriesMonths ¶
func DataSeriesMapToContinuousSeriesMonths(dsm map[string]statictimeseries.DataSeries, order []string) []chart.ContinuousSeries
func DataSeriesMapToContinuousSeriesQuarters ¶
func DataSeriesMapToContinuousSeriesQuarters(dsm map[string]statictimeseries.DataSeries, order []string) []chart.ContinuousSeries
func DataSeriesToContinuousSeries ¶
func DataSeriesToContinuousSeries(ds statictimeseries.DataSeries) chart.ContinuousSeries
func DataSeriesToContinuousSeriesQuarter ¶
func DataSeriesToContinuousSeriesQuarter(ds statictimeseries.DataSeries) chart.ContinuousSeries
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 Ticks ¶
func Ticks(tickValues []float64, fn strconvutil.Float64ToString) []chart.Tick
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`.
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