Playing around with SVG

This commit is contained in:
2017-07-07 02:37:43 +02:00
parent 8c438ba08b
commit a80266358d
4 changed files with 32 additions and 25 deletions

View File

@ -5,6 +5,14 @@ import (
"math"
)
// PieChartSlice ...
type PieChartSlice struct {
From float64
To float64
Title string
Color string
}
// coords returns the coordinates for the given percentage.
func coords(percent float64) (float64, float64) {
x := math.Cos(2 * math.Pi * percent)