You may have noticed in my recent posts (most notably Bitcoin Charts – Bid Comparison) I have been generating bullet graphs using the GO lang package github.com/NerdGGuy/BulletGraphGo. I started writing this package was created when I wanted to generate graphs in GO. There wasn’t much available that fit my needs until I discovered SVGO. By porting the SVGO bullet graph example to a package I was able to generate any bullet graph with ease. Here’s an example of how to generate a simple bullet graph.
package main
import (
"github.com/NerdGGuy/BulletGraphGo"
"github.com/ajstarks/svgo"
"os"
)
func main() {
canvas := svg.New(os.Stdout)
canvas.Start(1024, 800)
canvas.Rect(0, 0, 1024, 800, "fill:white")
canvas.Gstyle("font-family:Calibri;font-size:18px")
bg := bulletgraph.New(canvas)
bg.Data = append(bg.Data, bulletgraph.Bdata{Title: "Test", Subtitle: "subtitle", Scale: "0,60,2", Qmeasure: "27,29", Cmeasure: 27.5, Measure: 28.5})
bg.Drawbg(canvas)
canvas.Gend()
canvas.End()
}

If you have any questions feel free to ask in the comment/twitter/G+.
Update: I have generated some documentation. I will try and make this more complete in the future.
PACKAGE
package bulletgraph
import “github.com/NerdGGuy/BulletGraphGo”
Package for generating bulletgraphs in SVG – bullet graphs (Design Specification http://www.perceptualedge.com/articles/misc/Bullet_Graph_Design_Spec.pdf)
TYPES
type Bdata struct {
Title string
Subtitle string
Scale string
Qmeasure string
Cmeasure float64
Measure float64
}
Title: Title of the bulletgraph. Displayed on the left of the bullet graph by default.
Subtitle: Subtitle displayed under the title.
Scale: A delimited string indicating the start,end,increment values for the bullet graph e.g. “0,60,2″.
Qmeasure: A delimited string indicating the comparison “zones” in the bullet graph e.g. “27,29″.
Cmeasure: The comparison indicator in the bullet graph. Measure: The measure for the bar to display.
type Bulletgraph struct {
Top int
Left int
Right int
Title string
Data []Bdata
Note []Note
Flags Options
}
Top: The top of the first bullet graph.
Left: The leftmost pixel to draw the bullet graph.
Right: The rightmost pixel to draw the bullet graph.
Title: The title of the the generated SVG.
Data: An array of all the bullet graph data.
Note: An array of notes to display at the bottom of the SVG.
Flag: Options for generating bullet graphs.
func New(canvas *svg.SVG) *Bulletgraph
Creates a new Bulletgraph with default options.
func (bg *Bulletgraph) Drawbg(canvas *svg.SVG)
Drawbg draws the bullet graph onto the canvas
type Note struct {
Text string `xml:",chardata"`
}
Text: Note to be displayed under the bullet graph.
type Options struct {
Width, Height, Fontsize, Barheight, Gutter int
Bgcolor, Barcolor, Datacolor, Compcolor, Title string
Showtitle, Circlemark bool
}
These options have default values some of which are derived from the canvas.
Width: Width
Height: Height
Fontsize: Fontsize (px)
Barheight: Bar height
Gutter: Height of gutter around bar
Bgcolor: Background color
Barcolor: Bar color
Datacolor: Data color
Compcolor: Comparative color
Title: Title
Showtitle: Show title
Circlemark: Circle mark