Debian Codegraph @

axis.go

raw symbols SCIP
1 package chart
2
3 // TickPosition is an enumeration of possible tick drawing positions.
4 type TickPosition int
5
6 const (
7 // TickPositionUnset means to use the default tick position.
8 TickPositionUnset TickPosition = 0
9 // TickPositionBetweenTicks draws the labels for a tick between the previous and current tick.
10 TickPositionBetweenTicks TickPosition = 1
11 // TickPositionUnderTick draws the tick below the tick.
12 TickPositionUnderTick TickPosition = 2
13 )
14
15 // YAxisType is a type of y-axis; it can either be primary or secondary.
16 type YAxisType int
17
18 const (
19 // YAxisPrimary is the primary axis.
20 YAxisPrimary YAxisType = 0
21 // YAxisSecondary is the secondary axis.
22 YAxisSecondary YAxisType = 1
23 )
24
25 // Axis is a chart feature detailing what values happen where.
26 type Axis interface {
27 GetName() string
28 SetName(name string)
29
30 GetStyle() Style
31 SetStyle(style Style)
32
33 GetTicks() []Tick
34 GenerateTicks(r Renderer, ra Range, vf ValueFormatter) []Tick
35
36 // GenerateGridLines returns the gridlines for the axis.
37 GetGridLines(ticks []Tick) []GridLine
38
39 // Measure should return an absolute box for the axis.
40 // This is used when auto-fitting the canvas to the background.
41 Measure(r Renderer, canvasBox Box, ra Range, style Style, ticks []Tick) Box
42
43 // Render renders the axis.
44 Render(r Renderer, canvasBox Box, ra Range, style Style, ticks []Tick)
45 }