Documentation
¶
Index ¶
- type BarChart
- func (b *BarChart) BarHeight(i int) float64
- func (b *BarChart) DataRange() (xmin, xmax, ymin, ymax float64)
- func (b *BarChart) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox
- func (b *BarChart) Plot(c draw.Canvas, plt *plot.Plot)
- func (b *BarChart) StackOn(on *BarChart)
- func (b *BarChart) Thumbnail(c *draw.Canvas)
- type GridBoundaries
- type Legend
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarChart ¶
type BarChart struct { plotter.Values // Width is the width of the bars. Width float64 // Color is the fill color of the bars. Color color.Color // LineStyle is the style of the outline of the bars. draw.LineStyle // Offset is added to the X location of each bar. // When the Offset is zero, the bars are drawn // centered at their X location. Offset vg.Length // XMin is the X location of the first bar. XMin // can be changed to move groups of bars // down the X axis in order to make grouped // bar charts. XMin float64 // Horizontal dictates whether the bars should be in the vertical // (default) or horizontal direction. If Horizontal is true, all // X locations and distances referred to here will actually be Y // locations and distances. Horizontal bool // contains filtered or unexported fields }
A BarChart presents grouped data with rectangular bars with lengths proportional to the data values.
Modification of gonum.org/v1/plot/plotter.BarChart to allow for column width specification in data coordinates.
func NewBarChart ¶
NewBarChart returns a new bar chart with a single bar for each value. The bars heights correspond to the values and their x locations correspond to the index of their value in the Valuer.
func (*BarChart) BarHeight ¶
BarHeight returns the maximum y value of the ith bar, taking into account any bars upon which it is stacked.
func (*BarChart) GlyphBoxes ¶
GlyphBoxes implements the GlyphBoxer interface.
type GridBoundaries ¶
func NewGridBoundaries ¶
func NewGridBoundaries(grid plotter.GridXYZ) (*GridBoundaries, error)
func (*GridBoundaries) DataRange ¶
func (h *GridBoundaries) DataRange() (xMin, xMax, yMin, yMax float64)
DataRange implements the DataRange method of the plot.DataRanger interface.
func (*GridBoundaries) GlyphBoxes ¶
func (h *GridBoundaries) GlyphBoxes(plt *plot.Plot) []plot.GlyphBox
GlyphBoxes implements the GlyphBoxes method of the plot.GlyphBoxer interface.