gochart

package module
v0.0.0-...-a0d1b57 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2018 License: BSD-2-Clause Imports: 12 Imported by: 1

README

gochart

中文说明

改进点
  • 将gochart改成库形式提供

  • 不依赖外网

  • 定时刷新

  • 提供X轴为时间轴的图表类型

  • 保存图表数据

  • 回放图表数据

使用说明

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TemplateTimeHtml = `` /* 4887-byte string literal not displayed */

spline,line,column,area,bar

View Source
var TemplateTimeHtml_ScrollBars = `` /* 4901-byte string literal not displayed */

spline,line,column,area,bar

Functions

func SetLogger

func SetLogger(log ILogger)

Types

type ChartBase

type ChartBase struct {
	ChartType    string
	Title        string
	SubTitle     string
	YAxisText    string
	XAxisNumbers string
	ValueSuffix  string
	YMax         string
	RefreshTime  int
	SampleNum    int
	// contains filtered or unexported fields
}

func (*ChartBase) Build

func (this *ChartBase) Build(dataArray string)

func (*ChartBase) Data

func (this *ChartBase) Data() map[string]string

func (*ChartBase) GoSaveData

func (this *ChartBase) GoSaveData(filename string)

func (*ChartBase) InitBase

func (this *ChartBase) InitBase()

func (*ChartBase) IsEnableSaveData

func (this *ChartBase) IsEnableSaveData() bool

func (*ChartBase) SaveData

func (this *ChartBase) SaveData(datas map[string][]interface{})

type ChartClassType

type ChartClassType int
const (
	CCT_UNKNOW ChartClassType = iota
	CCT_TIME
)

type ChartServer

type ChartServer struct {
	// contains filtered or unexported fields
}

func (*ChartServer) AddChart

func (this *ChartServer) AddChart(chartname string, chart IChartInner, savedata bool)

func (*ChartServer) ListenAndServe

func (this *ChartServer) ListenAndServe(addr string) error

type ChartTime

type ChartTime struct {
	ChartBase
	TickInterval  string
	TickLabelStep string
	PlotLinesY    string
	TickUnit      int
}

func (*ChartTime) AddData

func (this *ChartTime) AddData(newDatas map[string][]interface{}, UTCTime int64) []interface{}

func (*ChartTime) Init

func (this *ChartTime) Init()

func (*ChartTime) Load

func (this *ChartTime) Load(filename string) (bool, []interface{})

func (*ChartTime) LoadBase

func (this *ChartTime) LoadBase(filename string) (bool, *simplejson.Json)

func (*ChartTime) Template

func (this *ChartTime) Template() string

func (*ChartTime) TemplateScrollBars

func (this *ChartTime) TemplateScrollBars() string

type DefaultLogger

type DefaultLogger struct {
}

func NewDefaultLogger

func NewDefaultLogger() *DefaultLogger

func (*DefaultLogger) Error

func (this *DefaultLogger) Error(args ...interface{})

func (*DefaultLogger) Errorf

func (this *DefaultLogger) Errorf(format string, args ...interface{})

func (*DefaultLogger) Errorln

func (this *DefaultLogger) Errorln(args ...interface{})

func (*DefaultLogger) Info

func (this *DefaultLogger) Info(args ...interface{})

func (*DefaultLogger) Infof

func (this *DefaultLogger) Infof(format string, args ...interface{})

func (*DefaultLogger) Infoln

func (this *DefaultLogger) Infoln(args ...interface{})

type ICharNormal

type ICharNormal interface {
	Init()
	Template() string
	Build(dataArray string)
	Data() map[string]string
	AddData(map[string][]interface{}, int64) []interface{}
}

type IChart

type IChart interface {
	Update(now int64) map[string][]interface{}
}

type IChartFile

type IChartFile interface {
	ICharNormal
	Load(filename string) (bool, []interface{})
	TemplateScrollBars() string
}

type IChartInner

type IChartInner interface {
	IChart
	IChartSave
	ICharNormal
}

type IChartSave

type IChartSave interface {
	GoSaveData(filename string)
	IsEnableSaveData() bool
	SaveData(datas map[string][]interface{})
}

type ILogger

type ILogger interface {
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Errorln(args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Infoln(args ...interface{})
}

Jump to

Keyboard shortcuts

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