Compare commits

..

1 commit

Author SHA1 Message Date
Will Charczuk
1ed581160b
Update README.md 2024-08-23 08:50:05 -07:00
93 changed files with 169 additions and 306 deletions

View file

@ -1,7 +1,6 @@
MIT License MIT License
Copyright (c) 2016 William Charczuk. Copyright (c) 2016 William Charczuk.
Copyright (c) 2024 Zeni Kim.
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -1,98 +1,12 @@
go-chart go-chart
======== ========
This project starts from a full copy from [https://git.smarteching.com/zeni/go-chart](https://git.smarteching.com/zeni/go-chart). 28 Oct 2024. This project is archived!
- I originally released this as a way to publish stock charts in slack bots. It was kind of fun at the time! I never anticipated that it would become heavily used, and as often happens with open source, I have a ton of time commitments elsewhere, and can't reasonbly devote enough time to this project to match the usage.
Master should now be on the v3.x codebase, which overhauls the api significantly. Per usual, see `examples` for more information. There have been a number of forks over time, I'd encourage you all to seek those out, or new charting libraries.
# Installation Best,
To install `chart` run the following: - Will
```bash
> go get git.smarteching.com/zeni/go-chart/v2@latest
```
Most of the components are interchangeable so feel free to crib whatever you want.
# Output Examples
Spark Lines:
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/tvix_ltm.png)
Single axis:
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/goog_ltm.png)
Two axis:
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/two_axis.png)
# Other Chart Types
Pie Chart:
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/pie_chart.png)
The code for this chart can be found in `examples/pie_chart/main.go`.
Stacked Bar:
![](https://git.smarteching.com/zeni/go-chart/raw/branch/main/_images/stacked_bar.png)
The code for this chart can be found in `examples/stacked_bar/main.go`.
# Code Examples
Actual chart configurations and examples can be found in the `./examples/` directory. They are simple CLI programs that write to `output.png` (they are also updated with `go generate`.
If folder ends in "web", has web servers, so start them with `go run main.go` then access `http://localhost:8080` to see the output.
# Usage
Everything starts with the `chart.Chart` object. The bare minimum to draw a chart would be the following:
```golang
import (
...
"bytes"
...
"git.smarteching.com/zeni/go-chart/v2" //exposes "chart"
)
graph := chart.Chart{
Series: []chart.Series{
chart.ContinuousSeries{
XValues: []float64{1.0, 2.0, 3.0, 4.0},
YValues: []float64{1.0, 2.0, 3.0, 4.0},
},
},
}
buffer := bytes.NewBuffer([]byte{})
err := graph.Render(chart.PNG, buffer)
```
Explanation of the above: A `chart` can have many `Series`, a `Series` is a collection of things that need to be drawn according to the X range and the Y range(s).
Here, we have a single series with x range values as float64s, rendered to a PNG. Note; we can pass any type of `io.Writer` into `Render(...)`, meaning that we can render the chart to a file or a resonse or anything else that implements `io.Writer`.
# API Overview
Everything on the `chart.Chart` object has defaults that can be overriden. Whenever a developer sets a property on the chart object, it is to be assumed that value will be used instead of the default.
The best way to see the api in action is to look at the examples in the `./_examples/` directory.
# Design Philosophy
I wanted to make a charting library that used only native golang, that could be stood up on a server (i.e. it had built in fonts).
The goal with the API itself is to have the "zero value be useful", and to require the user to not code more than they absolutely needed.
# Contributions
Contributions are welcome though this library is in a holding pattern for the forseable future.

View file

@ -4,8 +4,8 @@ import (
"image/color" "image/color"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
"git.smarteching.com/zeni/go-chart/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"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestBarChartRender(t *testing.T) { func TestBarChartRender(t *testing.T) {

View file

@ -5,7 +5,7 @@ import (
"math" "math"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestBollingerBandSeries(t *testing.T) { func TestBollingerBandSeries(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"math" "math"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestBoxClone(t *testing.T) { func TestBoxClone(t *testing.T) {

View file

@ -8,8 +8,8 @@ import (
"testing" "testing"
"time" "time"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestChartGetDPI(t *testing.T) { func TestChartGetDPI(t *testing.T) {

View file

@ -7,7 +7,7 @@ import (
"os" "os"
"strings" "strings"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
var ( var (

View file

@ -1,6 +1,6 @@
package chart package chart
import "git.smarteching.com/zeni/go-chart/v2/drawing" import "github.com/wcharczuk/go-chart/v2/drawing"
var ( var (
// ColorWhite is white. // ColorWhite is white.

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestConcatSeries(t *testing.T) { func TestConcatSeries(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestRangeTranslate(t *testing.T) { func TestRangeTranslate(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestContinuousSeries(t *testing.T) { func TestContinuousSeries(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestDonutChart(t *testing.T) { func TestDonutChart(t *testing.T) {

View file

@ -6,7 +6,7 @@ import (
"image/color" "image/color"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestColorFromHex(t *testing.T) { func TestColorFromHex(t *testing.T) {

View file

@ -3,7 +3,7 @@ package drawing
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
type point struct { type point struct {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
var ( var (

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
chart "git.smarteching.com/zeni/go-chart/v2" chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
chart "git.smarteching.com/zeni/go-chart/v2" chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -5,8 +5,8 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -1,55 +0,0 @@
package main
//go:generate go run main.go
import (
"fmt"
"log"
"net/http"
"os"
"git.smarteching.com/zeni/go-chart/v2"
)
func drawChart(res http.ResponseWriter, req *http.Request) {
graph := chart.BarChart{
Title: "Test Bar Chart",
Background: chart.Style{
Padding: chart.Box{
Top: 40,
},
},
Height: 512,
BarWidth: 60,
Bars: []chart.Value{
{Value: 5.25, Label: "Blue"},
{Value: 4.88, Label: "Green"},
{Value: 4.74, Label: "Gray"},
{Value: 3.22, Label: "Orange"},
{Value: 3, Label: "Test"},
{Value: 2.27, Label: "??"},
{Value: 1, Label: "!!"},
},
}
res.Header().Set("Content-Type", "image/png")
err := graph.Render(chart.PNG, res)
if err != nil {
fmt.Printf("Error rendering chart: %v\n", err)
}
}
func port() string {
if len(os.Getenv("PORT")) > 0 {
return os.Getenv("PORT")
}
return "8080"
}
func main() {
listenPort := fmt.Sprintf(":%s", port())
fmt.Printf("Listening on %s\n", listenPort)
http.HandleFunc("/", drawChart)
log.Fatal(http.ListenAndServe(listenPort, nil))
}

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -8,7 +8,7 @@ import (
"os" "os"
"time" "time"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func random(min, max float64) float64 { func random(min, max float64) float64 {

View file

@ -5,7 +5,7 @@ import (
"log" "log"
"net/http" "net/http"
"git.smarteching.com/zeni/go-chart/v2" "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

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,8 +5,8 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,8 +5,8 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ import (
"log" "log"
"net/http" "net/http"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
const style = "svg .background { fill: white; }" + const style = "svg .background { fill: white; }" +

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,8 +3,8 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"log" "log"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
chart "git.smarteching.com/zeni/go-chart/v2" chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
chart "git.smarteching.com/zeni/go-chart/v2" chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -1,55 +0,0 @@
package main
import (
"fmt"
"log"
"net/http"
"git.smarteching.com/zeni/go-chart/v2"
)
func drawChart(res http.ResponseWriter, req *http.Request) {
pie := chart.PieChart{
Width: 512,
Height: 512,
Values: []chart.Value{
{Value: 5, Label: "Blue"},
{Value: 5, Label: "Green"},
{Value: 4, Label: "Gray"},
{Value: 4, Label: "Orange"},
{Value: 3, Label: "Deep Blue"},
{Value: 3, Label: "??"},
{Value: 1, Label: "!!"},
},
}
res.Header().Set("Content-Type", "image/png")
err := pie.Render(chart.PNG, res)
if err != nil {
fmt.Printf("Error rendering pie chart: %v\n", err)
}
}
func drawChartRegression(res http.ResponseWriter, req *http.Request) {
pie := chart.PieChart{
Width: 512,
Height: 512,
Values: []chart.Value{
{Value: 5, Label: "Blue"},
{Value: 2, Label: "Two"},
{Value: 1, Label: "One"},
},
}
res.Header().Set("Content-Type", chart.ContentTypeSVG)
err := pie.Render(chart.SVG, res)
if err != nil {
fmt.Printf("Error rendering pie chart: %v\n", err)
}
}
func main() {
http.HandleFunc("/", drawChart)
http.HandleFunc("/reg", drawChartRegression)
log.Fatal(http.ListenAndServe(":8080", nil))
}

View file

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
chart "git.smarteching.com/zeni/go-chart/v2" chart "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -9,7 +9,7 @@ import (
"strconv" "strconv"
"time" "time"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -6,7 +6,7 @@ import (
"sync" "sync"
"time" "time"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
var lock sync.Mutex var lock sync.Mutex

View file

@ -6,8 +6,8 @@ import (
_ "net/http/pprof" _ "net/http/pprof"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "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

@ -5,7 +5,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,7 +3,7 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,8 +3,8 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -6,8 +6,8 @@ import (
"os" "os"
"time" "time"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -5,8 +5,8 @@ package main
import ( import (
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
func main() { func main() {

View file

@ -4,7 +4,7 @@ import (
"net/http" "net/http"
"time" "time"
chart "git.smarteching.com/zeni/go-chart/v2" 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

@ -6,7 +6,7 @@ import (
"fmt" "fmt"
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -7,7 +7,7 @@ import (
"log" "log"
"os" "os"
"git.smarteching.com/zeni/go-chart/v2" "github.com/wcharczuk/go-chart/v2"
) )
func main() { func main() {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestFirstValueAnnotation(t *testing.T) { func TestFirstValueAnnotation(t *testing.T) {

View file

@ -3,8 +3,8 @@ package chart
import ( import (
"sync" "sync"
"git.smarteching.com/zeni/go-chart/v2/roboto"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/roboto"
) )
var ( var (

6
go.mod
View file

@ -1,8 +1,8 @@
module git.smarteching.com/zeni/go-chart/v2 module github.com/wcharczuk/go-chart/v2
go 1.23.1 go 1.15
require ( require (
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0
golang.org/x/image v0.21.0 golang.org/x/image v0.18.0
) )

64
go.sum
View file

@ -1,4 +1,64 @@
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
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=
golang.org/x/image v0.21.0 h1:c5qV36ajHpdj4Qi0GnE0jUc/yuo33OLFaa0d+crTD5s= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
golang.org/x/image v0.21.0/go.mod h1:vUbsLavqK/W303ZroQQVKQ+Af3Yl6Uz1Ppu5J/cLz78= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestGenerateGridLines(t *testing.T) { func TestGenerateGridLines(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestHistogramSeries(t *testing.T) { func TestHistogramSeries(t *testing.T) {

2
jet.go
View file

@ -1,6 +1,6 @@
package chart package chart
import "git.smarteching.com/zeni/go-chart/v2/drawing" import "github.com/wcharczuk/go-chart/v2/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"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestLastValueAnnotationSeries(t *testing.T) { func TestLastValueAnnotationSeries(t *testing.T) {

View file

@ -1,7 +1,7 @@
package chart package chart
import ( import (
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
) )
// Legend returns a legend renderable function. // Legend returns a legend renderable function.

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestLegend(t *testing.T) { func TestLegend(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestLinearRegressionSeries(t *testing.T) { func TestLinearRegressionSeries(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestLogRangeTranslate(t *testing.T) { func TestLogRangeTranslate(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
var ( var (

View file

@ -3,7 +3,7 @@ package matrix
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestNew(t *testing.T) { func TestNew(t *testing.T) {

View file

@ -3,7 +3,7 @@ package matrix
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestPoly(t *testing.T) { func TestPoly(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestPercentageDifferenceSeries(t *testing.T) { func TestPercentageDifferenceSeries(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"bytes" "bytes"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestPieChart(t *testing.T) { func TestPieChart(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"math" "math"
"git.smarteching.com/zeni/go-chart/v2/matrix" "github.com/wcharczuk/go-chart/v2/matrix"
) )
// Interface Assertions. // Interface Assertions.

View file

@ -3,8 +3,8 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/matrix" "github.com/wcharczuk/go-chart/v2/matrix"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestPolynomialRegression(t *testing.T) { func TestPolynomialRegression(t *testing.T) {

View file

@ -6,8 +6,8 @@ import (
"io" "io"
"math" "math"
"git.smarteching.com/zeni/go-chart/v2/drawing"
"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

@ -3,8 +3,8 @@ package chart
import ( import (
"io" "io"
"git.smarteching.com/zeni/go-chart/v2/drawing"
"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.

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestSeqEach(t *testing.T) { func TestSeqEach(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
type mockValuesProvider struct { type mockValuesProvider struct {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestSplitCSV(t *testing.T) { func TestSplitCSV(t *testing.T) {

View file

@ -4,8 +4,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"git.smarteching.com/zeni/go-chart/v2/drawing"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
const ( const (

View file

@ -3,9 +3,9 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/drawing"
"git.smarteching.com/zeni/go-chart/v2/testutil"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/drawing"
"github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestStyleIsZero(t *testing.T) { func TestStyleIsZero(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestTextWrapWord(t *testing.T) { func TestTextWrapWord(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestGenerateContinuousTicks(t *testing.T) { func TestGenerateContinuousTicks(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestTimeSeriesGetValue(t *testing.T) { func TestTimeSeriesGetValue(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestBuffer(t *testing.T) { func TestBuffer(t *testing.T) {

View file

@ -4,7 +4,7 @@ import (
"testing" "testing"
"time" "time"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestTimeValueFormatterWithFormat(t *testing.T) { func TestTimeValueFormatterWithFormat(t *testing.T) {

View file

@ -1,6 +1,6 @@
package chart package chart
import "git.smarteching.com/zeni/go-chart/v2/drawing" import "github.com/wcharczuk/go-chart/v2/drawing"
// ValuesProvider is a type that produces values. // ValuesProvider is a type that produces values.
type ValuesProvider interface { type ValuesProvider interface {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestValuesValues(t *testing.T) { func TestValuesValues(t *testing.T) {

View file

@ -9,8 +9,8 @@ import (
"golang.org/x/image/font" "golang.org/x/image/font"
"git.smarteching.com/zeni/go-chart/v2/drawing"
"github.com/golang/freetype/truetype" "github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2/drawing"
) )
// SVG returns a new png/raster renderer. // SVG returns a new png/raster renderer.

View file

@ -6,8 +6,8 @@ import (
"strings" "strings"
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/drawing" "github.com/wcharczuk/go-chart/v2/drawing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestVectorRendererPath(t *testing.T) { func TestVectorRendererPath(t *testing.T) {

View file

@ -1,6 +1,6 @@
package chart package chart
import "git.smarteching.com/zeni/go-chart/v2/drawing" import "github.com/wcharczuk/go-chart/v2/drawing"
var viridisColors = [256]drawing.Color{ var viridisColors = [256]drawing.Color{
{R: 0x44, G: 0x1, B: 0x54, A: 0xff}, {R: 0x44, G: 0x1, B: 0x54, A: 0xff},

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestXAxisGetTicks(t *testing.T) { func TestXAxisGetTicks(t *testing.T) {

View file

@ -3,7 +3,7 @@ package chart
import ( import (
"testing" "testing"
"git.smarteching.com/zeni/go-chart/v2/testutil" "github.com/wcharczuk/go-chart/v2/testutil"
) )
func TestYAxisGetTicks(t *testing.T) { func TestYAxisGetTicks(t *testing.T) {