mostly works.

This commit is contained in:
Will Charczuk 2016-07-10 10:43:04 -07:00
parent e9a36274ac
commit abfdc3e0d9
14 changed files with 465 additions and 159 deletions

44
axis.go
View file

@ -14,46 +14,6 @@ const (
type Axis interface {
GetName() string
GetStyle() Style
Render(c *Chart, r Renderer, canvasBox Box, ra Range)
}
// axis represents the basics of an axis implementation.
type axis struct {
Name string
Style Style
ValueFormatter ValueFormatter
Range Range
Ticks []Tick
}
func (a axis) GetName() string {
return a.Name
}
func (a axis) GetStyle() Style {
return a.Style
}
func (a axis) getTicks(ra Range) []Tick {
if len(a.Ticks) > 0 {
return a.Ticks
}
return a.generateTicks(ra)
}
func (a axis) generateTicks(ra Range) []Tick {
step := a.getTickStep(ra)
return a.generateTicksWithStep(ra, step)
}
func (a axis) getTickCount(ra Range) int {
return 0
}
func (a axis) getTickStep(ra Range) float64 {
return 0.0
}
func (a axis) generateTicksWithStep(ra Range, step float64) []Tick {
return []Tick{}
GetTicks(r Renderer, ra Range, vf ValueFormatter) []Tick
Render(c *Chart, r Renderer, canvasBox Box, ra Range, ticks []Tick)
}