plot

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DotWidth = 3  // 点的宽度
	XTickMax = 50 // X轴刻度多个不会重叠
)
View Source
const (
	YAxisPrimary   = chart.YAxisPrimary   // 主要坐标
	YAxisSecondary = chart.YAxisSecondary // 次要坐标
)
View Source
const (
	// TickPositionUnset 表示使用默认的刻度位置
	TickPositionUnset = chart.TickPositionUnset
	// TickPositionBetweenTicks 上一个刻度和当前刻度之间的刻度绘制标签.
	TickPositionBetweenTicks = chart.TickPositionBetweenTicks
	// TickPositionUnderTick 在记号下方绘制记号.
	TickPositionUnderTick = chart.TickPositionUnderTick
)
View Source
const (
	// ResourcesPath 资源路径
	ResourcesPath = "fonts"
)

Variables

View Source
var (
	ColorRed   = drawing.Color{R: 0xFF, G: 0x00, B: 0x00, A: 0xFF} // 红色
	ColorGreen = drawing.Color{R: 0x00, G: 0xFF, B: 0x00, A: 0xFF} // 绿色
	ColorBlue  = drawing.Color{R: 0x00, G: 0x00, B: 0xFF, A: 0xFF} // 蓝色
	ColorBlack = drawing.Color{R: 51, G: 51, B: 51, A: 255}        // 黑色

	// ColorWhite is white.
	ColorWhite = drawing.Color{R: 255, G: 255, B: 255, A: 255}
	// ColorBlue is the basic theme blue color.
	//ColorBlue = drawing.Color{R: 0, G: 116, B: 217, A: 255}
	// ColorCyan is the basic theme cyan color.
	ColorCyan = drawing.Color{R: 0, G: 217, B: 210, A: 255}
	// ColorGreen is the basic theme green color.
	//ColorGreen = drawing.Color{R: 0, G: 217, B: 101, A: 255}
	// ColorRed is the basic theme red color.
	//ColorRed = drawing.Color{R: 217, G: 0, B: 116, A: 255}
	// ColorOrange is the basic theme orange color.
	ColorOrange = drawing.Color{R: 217, G: 101, B: 0, A: 255}
	// ColorYellow is the basic theme yellow color.
	ColorYellow = drawing.Color{R: 217, G: 210, B: 0, A: 255}
	// ColorBlack is the basic theme black color.
	//ColorBlack = drawing.Color{R: 51, G: 51, B: 51, A: 255}
	// ColorLightGray is the basic theme light gray color.
	ColorLightGray = drawing.Color{R: 239, G: 239, B: 239, A: 255}

	// ColorAlternateBlue is a alternate theme color.
	ColorAlternateBlue = drawing.Color{R: 106, G: 195, B: 203, A: 255}
	// ColorAlternateGreen is a alternate theme color.
	ColorAlternateGreen = drawing.Color{R: 42, G: 190, B: 137, A: 255}
	// ColorAlternateGray is a alternate theme color.
	ColorAlternateGray = drawing.Color{R: 110, G: 128, B: 139, A: 255}
	// ColorAlternateYellow is a alternate theme color.
	ColorAlternateYellow = drawing.Color{R: 240, G: 174, B: 90, A: 255}
	// ColorAlternateLightGray is a alternate theme color.
	ColorAlternateLightGray = drawing.Color{R: 187, G: 190, B: 191, A: 255}
	// ColorTransparent is a transparent (alpha zero) color.
	ColorTransparent = drawing.Color{R: 1, G: 1, B: 1, A: 0}
)
View Source
var (
	DashedLine = []float64{5.0, 5.0} // 虚线
)

Functions

func AddSeries added in v0.4.2

func AddSeries(graph chart.Chart, series ...chart.Series) chart.Chart

func CreateChart added in v0.4.2

func CreateChart() chart.Chart

CreateChart 创建一个默认的图标

func DefaultFont added in v0.4.3

func DefaultFont() *truetype.Font

DefaultFont 默认字体

func GetDefaultFont

func GetDefaultFont() (*truetype.Font, error)

GetDefaultFont returns the default font (Roboto-Medium).

func ImageContent added in v0.4.0

func ImageContent(c chart.Chart) (string, error)

func LastValueAnnotationSeries added in v0.6.6

func LastValueAnnotationSeries(innerSeries chart.ValuesProvider, vfs ...chart.ValueFormatter) chart.AnnotationSeries

func OpenImage added in v0.4.0

func OpenImage(c chart.Chart) error

OpenImage TODO: 打开chart有点问题, 原因可能是生成的URL过长

func OpenURL added in v0.4.0

func OpenURL(url string) error

OpenURL 用系统默认的浏览器打开一个url

func Render added in v0.4.2

func Render(graph chart.Chart, code string)

func SeriesIndex

func SeriesIndex(s pandas.Series) []float64

Types

type AnnotationSeries added in v0.6.6

type AnnotationSeries = chart.AnnotationSeries

type Chart added in v0.6.6

type Chart struct {
	chart.Chart
}

Chart 图表

func NewChart added in v0.6.6

func NewChart() *Chart

NewChart 创建默认的图表

func (*Chart) AddSeries added in v0.6.6

func (this *Chart) AddSeries(series ...chart.Series)

AddSeries 添加图表序列

func (*Chart) Output added in v0.6.6

func (this *Chart) Output(name string) error

Output 输出图表

type ContinuousSeries added in v0.6.6

type ContinuousSeries = chart.ContinuousSeries

type Renderable added in v0.6.6

type Renderable = chart.Renderable

type Series added in v0.6.6

type Series = chart.Series

type Style added in v0.6.6

type Style = chart.Style

type Tick added in v0.6.6

type Tick = chart.Tick

type Value2 added in v0.6.6

type Value2 = chart.Value2

type XAxis added in v0.6.6

type XAxis = chart.XAxis

type YAxis added in v0.6.6

type YAxis = chart.YAxis

Jump to

Keyboard shortcuts

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