Skip to content

Commit

Permalink
chore: upgrade go-echarts version (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenjiandongx authored Jul 30, 2024
1 parent 809d88b commit 75fd628
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ module github.com/go-echarts/statsview
go 1.15

require (
github.com/go-echarts/go-echarts/v2 v2.2.3
github.com/rs/cors v1.7.0
github.com/go-echarts/go-echarts/v2 v2.4.1
github.com/rs/cors v1.11.0
)
5 changes: 5 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-echarts/go-echarts/v2 v2.2.3 h1:H8oPdUpzuiV2K8S4xYZa1JRNjP3U0h7HVqvhPrmCk1A=
github.com/go-echarts/go-echarts/v2 v2.2.3/go.mod h1:6TOomEztzGDVDkOSCFBq3ed7xOYfbOqhaBzD0YV771A=
github.com/go-echarts/go-echarts/v2 v2.4.1 h1:imBFGngJ9zv/2zJVjK3k0uLL+LzyPDgzeV7MWzxH0rs=
github.com/go-echarts/go-echarts/v2 v2.4.1/go.mod h1:56YlvzhW/a+du15f3S2qUGNDfKnFOeJSThBIrVFHDtI=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
Expand All @@ -12,6 +14,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po=
github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho=
github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
Expand All @@ -20,3 +24,4 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
1 change: 0 additions & 1 deletion statsview.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type ViewManager struct {
// Register registers views to the ViewManager
func (vm *ViewManager) Register(views ...viewer.Viewer) {
vm.Views = append(vm.Views, views...)

}

// Start runs a http server and begin to collect metrics
Expand Down
2 changes: 2 additions & 0 deletions viewer/heap.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ func NewHeapViewer() Viewer {

return &HeapViewer{graph: graph}
}

func (vr *HeapViewer) SetStatsMgr(smgr *StatsMgr) {
vr.smgr = smgr
}

func (vr *HeapViewer) Name() string {
return VHeap
}
Expand Down
8 changes: 4 additions & 4 deletions viewer/viewer.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func genViewTemplate(vid, route string) string {
panic("statsview: failed to parse template " + err.Error())
}

var c = struct {
c := struct {
Interval int
MaxPoints int
Addr string
Expand Down Expand Up @@ -252,16 +252,16 @@ func fixedPrecision(n float64, p int) float64 {
func newBasicView(route string) *charts.Line {
graph := charts.NewLine()
graph.SetGlobalOptions(
charts.WithLegendOpts(opts.Legend{Show: true}),
charts.WithTooltipOpts(opts.Tooltip{Show: true, Trigger: "axis"}),
charts.WithLegendOpts(opts.Legend{Show: opts.Bool(true)}),
charts.WithTooltipOpts(opts.Tooltip{Show: opts.Bool(true), Trigger: "axis"}),
charts.WithXAxisOpts(opts.XAxis{Name: "Time"}),
charts.WithInitializationOpts(opts.Initialization{
Width: "600px",
Height: "400px",
Theme: string(defaultCfg.Theme),
}),
)
graph.SetXAxis([]string{}).SetSeriesOptions(charts.WithLineChartOpts(opts.LineChart{Smooth: true}))
graph.SetXAxis([]string{}).SetSeriesOptions(charts.WithLineChartOpts(opts.LineChart{Smooth: opts.Bool(true)}))
graph.AddJSFuncs(genViewTemplate(graph.ChartID, route))
return graph
}

0 comments on commit 75fd628

Please sign in to comment.