Documentation ¶
Index ¶
- Constants
- Variables
- func AddSeries(graph chart.Chart, series ...chart.Series) chart.Chart
- func CreateChart() chart.Chart
- func DefaultFont() *truetype.Font
- func GetDefaultFont() (*truetype.Font, error)
- func ImageContent(c chart.Chart) (string, error)
- func LastValueAnnotationSeries(innerSeries chart.ValuesProvider, vfs ...chart.ValueFormatter) chart.AnnotationSeries
- func OpenImage(c chart.Chart) error
- func OpenURL(url string) error
- func Render(graph chart.Chart, code string)
- func SeriesIndex(s pandas.Series) []float64
- type AnnotationSeries
- type Chart
- type ContinuousSeries
- type Renderable
- type Series
- type Style
- type Tick
- type Value2
- type XAxis
- type YAxis
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 GetDefaultFont ¶
GetDefaultFont returns the default font (Roboto-Medium).
func ImageContent ¶ added in v0.4.0
func LastValueAnnotationSeries ¶ added in v0.6.0
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 SeriesIndex ¶
Types ¶
type AnnotationSeries ¶ added in v0.6.1
type AnnotationSeries = chart.AnnotationSeries
type Chart ¶ added in v0.5.9
type Chart struct {
chart.Chart
}
Chart 图表
type ContinuousSeries ¶ added in v0.5.9
type ContinuousSeries = chart.ContinuousSeries
type Renderable ¶ added in v0.5.9
type Renderable = chart.Renderable
Click to show internal directories.
Click to hide internal directories.