start migration to our packages
Some checks are pending
Test / Build (push) Waiting to run

This commit is contained in:
Zeni Kim 2025-05-13 21:46:02 -05:00
parent d25a827706
commit 0eacc8e394
31 changed files with 51 additions and 49 deletions

View file

@ -1,5 +1,7 @@
# go-charts # go-charts
Clone from https://github.com/vicanso/go-charts
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vicanso/go-charts/blob/master/LICENSE) [![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vicanso/go-charts/blob/master/LICENSE)
[![Build Status](https://github.com/vicanso/go-charts/workflows/Test/badge.svg)](https://github.com/vicanso/go-charts/actions) [![Build Status](https://github.com/vicanso/go-charts/workflows/Test/badge.svg)](https://github.com/vicanso/go-charts/actions)

View file

@ -23,8 +23,8 @@
package charts package charts
import ( import (
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
type Box = chart.Box type Box = chart.Box

View file

@ -26,7 +26,7 @@ import (
"strings" "strings"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
type axisPainter struct { type axisPainter struct {

View file

@ -26,7 +26,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestAxis(t *testing.T) { func TestAxis(t *testing.T) {

View file

@ -26,7 +26,7 @@ import (
"math" "math"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
type barChart struct { type barChart struct {

View file

@ -26,7 +26,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestChartOption(t *testing.T) { func TestChartOption(t *testing.T) {

View file

@ -27,7 +27,7 @@ import (
"math" "math"
"sort" "sort"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
const labelFontSize = 10 const labelFontSize = 10

View file

@ -26,7 +26,7 @@ import (
"errors" "errors"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
func BenchmarkMultiChartPNGRender(b *testing.B) { func BenchmarkMultiChartPNGRender(b *testing.B) {

View file

@ -29,7 +29,7 @@ import (
"regexp" "regexp"
"strconv" "strconv"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
func convertToArray(data []byte) []byte { func convertToArray(data []byte) []byte {

View file

@ -27,7 +27,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestConvertToArray(t *testing.T) { func TestConvertToArray(t *testing.T) {

View file

@ -5,7 +5,7 @@ import (
"path/filepath" "path/filepath"
charts "github.com/vicanso/go-charts/v2" charts "github.com/vicanso/go-charts/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func writeFile(buf []byte) error { func writeFile(buf []byte) error {

View file

@ -7,7 +7,7 @@ import (
"strings" "strings"
"github.com/vicanso/go-charts/v2" "github.com/vicanso/go-charts/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func writeFile(buf []byte, filename string) error { func writeFile(buf []byte, filename string) error {

View file

@ -27,7 +27,7 @@ import (
"sync" "sync"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/roboto" "git.smarteching.com/zeni/go-chart/v2/roboto"
) )
var fonts = sync.Map{} var fonts = sync.Map{}

View file

@ -26,7 +26,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2/roboto" "git.smarteching.com/zeni/go-chart/v2/roboto"
) )
func TestInstallFont(t *testing.T) { func TestInstallFont(t *testing.T) {

12
go.mod
View file

@ -1,17 +1,19 @@
module github.com/vicanso/go-charts/v2 module git.smarteching.com/zeni/go-charts/v2
go 1.17 go 1.24.1
require ( require (
git.smarteching.com/zeni/go-chart/v2 v2.1.4
github.com/dustin/go-humanize v1.0.1 github.com/dustin/go-humanize v1.0.1
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
github.com/stretchr/testify v1.8.2 github.com/stretchr/testify v1.10.0
github.com/wcharczuk/go-chart/v2 v2.1.0 github.com/vicanso/go-charts/v2 v2.6.10
) )
require ( require (
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 // indirect github.com/wcharczuk/go-chart/v2 v2.1.0 // indirect
golang.org/x/image v0.21.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect
) )

18
go.sum
View file

@ -1,4 +1,5 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= git.smarteching.com/zeni/go-chart/v2 v2.1.4 h1:pF06+F6eqJLIG8uMiTVPR5TygPGMjM/FHMzTxmu5V/Q=
git.smarteching.com/zeni/go-chart/v2 v2.1.4/go.mod h1:b3ueW9h3pGGXyhkormZAvilHaG4+mQti+bMNPdQBeOQ=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 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/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
@ -7,20 +8,17 @@ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF0
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/vicanso/go-charts/v2 v2.6.10 h1:Nb2YBekEbUBPbvohnUO1oYMy31v75brUPk6n/fq+JXw=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/vicanso/go-charts/v2 v2.6.10/go.mod h1:Ii2KDI3udTG1wPtiTnntzjlUBJVJTqNscMzh3oYHzUk=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/wcharczuk/go-chart/v2 v2.1.0 h1:tY2slqVQ6bN+yHSnDYwZebLQFkphK4WNrVwnt7CJZ2I= github.com/wcharczuk/go-chart/v2 v2.1.0 h1:tY2slqVQ6bN+yHSnDYwZebLQFkphK4WNrVwnt7CJZ2I=
github.com/wcharczuk/go-chart/v2 v2.1.0/go.mod h1:yx7MvAVNcP/kN9lKXM/NTce4au4DFN99j6i1OwDclNA= github.com/wcharczuk/go-chart/v2 v2.1.0/go.mod h1:yx7MvAVNcP/kN9lKXM/NTce4au4DFN99j6i1OwDclNA=
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5 h1:QelT11PB4FXiDEXucrfNckHoFxwt8USGY1ajP1ZF5lM=
golang.org/x/image v0.0.0-20200927104501-e162460cd6b5/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200927104501-e162460cd6b5/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s=
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View file

@ -26,7 +26,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestGrid(t *testing.T) { func TestGrid(t *testing.T) {

View file

@ -24,7 +24,7 @@ package charts
import ( import (
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
type horizontalBarChart struct { type horizontalBarChart struct {

View file

@ -26,7 +26,7 @@ import (
"math" "math"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
type lineChart struct { type lineChart struct {

View file

@ -26,7 +26,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestMarkLine(t *testing.T) { func TestMarkLine(t *testing.T) {

View file

@ -26,7 +26,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestMarkPoint(t *testing.T) { func TestMarkPoint(t *testing.T) {

View file

@ -28,7 +28,7 @@ import (
"math" "math"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
type ValueFormatter func(float64) string type ValueFormatter func(float64) string

View file

@ -28,8 +28,8 @@ import (
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestPainterOption(t *testing.T) { func TestPainterOption(t *testing.T) {

View file

@ -27,7 +27,7 @@ import (
"math" "math"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
type pieChart struct { type pieChart struct {

View file

@ -27,8 +27,8 @@ import (
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
type radarChart struct { type radarChart struct {

View file

@ -26,7 +26,7 @@ import (
"strings" "strings"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
type SeriesData struct { type SeriesData struct {

View file

@ -24,7 +24,7 @@ package charts
import ( import (
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
) )
type labelRenderValue struct { type labelRenderValue struct {

View file

@ -26,8 +26,8 @@ import (
"errors" "errors"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
type tableChart struct { type tableChart struct {

View file

@ -24,7 +24,7 @@ package charts
import ( import (
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
const ThemeDark = "dark" const ThemeDark = "dark"

View file

@ -29,8 +29,8 @@ import (
"strings" "strings"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TrueFlag() *bool { func TrueFlag() *bool {

View file

@ -26,8 +26,8 @@ import (
"testing" "testing"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/wcharczuk/go-chart/v2" "git.smarteching.com/zeni/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing" "git.smarteching.com/zeni/go-chart/v2/drawing"
) )
func TestGetDefaultInt(t *testing.T) { func TestGetDefaultInt(t *testing.T) {