Merge branch 'master' into legend-improvements

This commit is contained in:
Rico 2022-08-28 02:00:22 +02:00
commit defb14e443
No known key found for this signature in database
GPG key ID: 91F477359C5B7AD3
164 changed files with 106 additions and 136 deletions

3
.gitignore vendored
View file

@ -16,4 +16,5 @@
# Other # Other
.vscode .vscode
.DS_Store .DS_Store
coverage.html coverage.html
.idea/

View file

@ -1,10 +1,9 @@
package main package main
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -1,10 +1,9 @@
package main package main
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -3,11 +3,10 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"io/ioutil" "io/ioutil"
"os" "os"
"strings" "strings"
"github.com/wcharczuk/go-chart/v2"
) )
var ( var (

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,10 +3,9 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -4,11 +4,10 @@ package main
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"math/rand" "math/rand"
"os" "os"
"time" "time"
"github.com/wcharczuk/go-chart/v2"
) )
func random(min, max float64) float64 { func random(min, max float64) float64 {

View file

@ -2,10 +2,9 @@ package main
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"log" "log"
"net/http" "net/http"
"github.com/wcharczuk/go-chart/v2"
) )
// Note: Additional examples on how to add Stylesheets are in the custom_stylesheets example // Note: Additional examples on how to add Stylesheets are in the custom_stylesheets example

View file

@ -4,9 +4,8 @@ package main
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,10 +3,9 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,10 +3,9 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -2,10 +2,9 @@ package main
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"log" "log"
"net/http" "net/http"
"github.com/wcharczuk/go-chart/v2"
) )
const style = "svg .background { fill: white; }" + const style = "svg .background { fill: white; }" +

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -2,9 +2,8 @@ package main
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"log" "log"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -4,12 +4,11 @@ package main
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"net/http" "net/http"
"os" "os"
"strconv" "strconv"
"time" "time"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -1,12 +1,11 @@
package main package main
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"log" "log"
"net/http" "net/http"
"sync" "sync"
"time" "time"
"github.com/wcharczuk/go-chart/v2"
) )
var lock sync.Mutex var lock sync.Mutex

View file

@ -1,13 +1,12 @@
package main package main
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"log" "log"
"net/http" "net/http"
_ "net/http/pprof" _ "net/http/pprof"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func drawChart(res http.ResponseWriter, req *http.Request) { func drawChart(res http.ResponseWriter, req *http.Request) {

View file

@ -3,9 +3,8 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -1,9 +1,8 @@
package main package main
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,11 +3,10 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"os" "os"
"time" "time"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -3,10 +3,9 @@ package main
//go:generate go run main.go //go:generate go run main.go
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -1,10 +1,9 @@
package main package main
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"net/http" "net/http"
"time" "time"
chart "github.com/wcharczuk/go-chart/v2"
) )
func drawChart(res http.ResponseWriter, req *http.Request) { func drawChart(res http.ResponseWriter, req *http.Request) {

View file

@ -4,9 +4,8 @@ package main
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -4,10 +4,9 @@ package main
import ( import (
"bytes" "bytes"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/chart"
"log" "log"
"os" "os"
"github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

2
go.mod
View file

@ -1,4 +1,4 @@
module github.com/wcharczuk/go-chart/v2 module github.com/d-Rickyy-b/go-chart-x/v2
go 1.15 go 1.15

View file

@ -1,11 +1,11 @@
package chart package chart
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"image/color" "image/color"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/drawing" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
"github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestAnnotationSeriesMeasure(t *testing.T) { func TestAnnotationSeriesMeasure(t *testing.T) {

View file

@ -5,7 +5,7 @@ import (
"math" "math"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestBarChartRender(t *testing.T) { func TestBarChartRender(t *testing.T) {

View file

@ -5,7 +5,7 @@ import (
"math" "math"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestBollingerBandSeries(t *testing.T) { func TestBollingerBandSeries(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"math" "math"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestBoxClone(t *testing.T) { func TestBoxClone(t *testing.T) {

View file

@ -2,14 +2,14 @@ package chart
import ( import (
"bytes" "bytes"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"image" "image"
"image/png" "image/png"
"math" "math"
"testing" "testing"
"time" "time"
"github.com/wcharczuk/go-chart/v2/drawing" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
"github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestChartGetDPI(t *testing.T) { func TestChartGetDPI(t *testing.T) {

View file

@ -1,6 +1,8 @@
package chart package chart
import "github.com/wcharczuk/go-chart/v2/drawing" import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
)
var ( var (
// ColorWhite is white. // ColorWhite is white.

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestConcatSeries(t *testing.T) { func TestConcatSeries(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestRangeTranslate(t *testing.T) { func TestRangeTranslate(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestContinuousSeries(t *testing.T) { func TestContinuousSeries(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestDonutChart(t *testing.T) { func TestDonutChart(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
var ( var (

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestFirstValueAnnotation(t *testing.T) { func TestFirstValueAnnotation(t *testing.T) {

View file

@ -1,10 +1,10 @@
package chart package chart
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/roboto"
"sync" "sync"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/roboto"
) )
var ( var (

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestGenerateGridLines(t *testing.T) { func TestGenerateGridLines(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestHistogramSeries(t *testing.T) { func TestHistogramSeries(t *testing.T) {

View file

@ -1,6 +1,8 @@
package chart package chart
import "github.com/wcharczuk/go-chart/v2/drawing" import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
)
// Jet is a color map provider based on matlab's jet color map. // Jet is a color map provider based on matlab's jet color map.
func Jet(v, vmin, vmax float64) drawing.Color { func Jet(v, vmin, vmax float64) drawing.Color {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestLastValueAnnotationSeries(t *testing.T) { func TestLastValueAnnotationSeries(t *testing.T) {

View file

@ -1,7 +1,7 @@
package chart package chart
import ( import (
"github.com/wcharczuk/go-chart/v2/drawing" "github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
) )
// Legend returns a legend renderable function. // Legend returns a legend renderable function.

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestLegend(t *testing.T) { func TestLegend(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestLinearRegressionSeries(t *testing.T) { func TestLinearRegressionSeries(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
var ( var (

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestPercentageDifferenceSeries(t *testing.T) { func TestPercentageDifferenceSeries(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/testutil" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
) )
func TestPieChart(t *testing.T) { func TestPieChart(t *testing.T) {

View file

@ -2,9 +2,8 @@ package chart
import ( import (
"fmt" "fmt"
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/matrix"
"math" "math"
"github.com/wcharczuk/go-chart/v2/matrix"
) )
// Interface Assertions. // Interface Assertions.

View file

@ -1,10 +1,10 @@
package chart package chart
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/matrix"
"testing" "testing"
"github.com/wcharczuk/go-chart/v2/matrix" "github.com/d-Rickyy-b/go-chart-x/v2/testutil"
"github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestPolynomialRegression(t *testing.T) { func TestPolynomialRegression(t *testing.T) {

View file

@ -1,13 +1,13 @@
package chart package chart
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"image" "image"
"image/png" "image/png"
"io" "io"
"math" "math"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
// PNG returns a new png/raster renderer. // PNG returns a new png/raster renderer.

View file

@ -1,10 +1,10 @@
package chart package chart
import ( import (
"github.com/d-Rickyy-b/go-chart-x/v2/pkg/drawing"
"io" "io"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
// Renderer represents the basic methods required to draw a chart. // Renderer represents the basic methods required to draw a chart.

Some files were not shown because too many files have changed in this diff Show more