chart

package
v0.0.0-...-13ba52c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: MIT, Unlicense Imports: 8 Imported by: 2

README

gchart -- gio canvas charting package

gchart-sine

Documentation

Overview

Package chart makes charts using the gio canvas

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Grid

func Grid(canvas *gc.Canvas, left, bottom, width, height, size float64, color color.NRGBA)

Grid makes a grid

Types

type ChartBox

type ChartBox struct {
	Title                    string
	Data                     []NameValue
	Color                    color.NRGBA
	Top, Bottom, Left, Right float64
	Minvalue, Maxvalue       float64
	Zerobased                bool
}

ChartBox holds the essential data for making a chart

func DataRead

func DataRead(r io.Reader) (ChartBox, error)

DataRead reads tab separated values into a ChartBox default values for the top, bottom, left, right (90,50,10,90) are filled in as is the default color, black

func (*ChartBox) Area

func (c *ChartBox) Area(canvas *gc.Canvas, opacity float64)

Area makes a area chart with specified opacity

func (*ChartBox) Bar

func (c *ChartBox) Bar(canvas *gc.Canvas, size float64)

Bar makes a (column) bar chart

func (*ChartBox) CTitle

func (c *ChartBox) CTitle(canvas *gc.Canvas, size, offset float64)

CTitle makes a centered title

func (*ChartBox) Frame

func (c *ChartBox) Frame(canvas *gc.Canvas, op float64)

Frame makes a filled frame with the specified opacity (0-100)

func (*ChartBox) HBar

func (c *ChartBox) HBar(canvas *gc.Canvas, size, linespacing, textsize float64)

HBar makes a horizontal bar chart

func (*ChartBox) Label

func (c *ChartBox) Label(canvas *gc.Canvas, size float64, n int)

Label draws the x axis labels

func (*ChartBox) Lego

func (c *ChartBox) Lego(canvas *gc.Canvas, size float64)

Lego makes a lego/waffle chart

func (*ChartBox) Line

func (c *ChartBox) Line(canvas *gc.Canvas, size float64)

Line makes a line chart

func (*ChartBox) Pie

func (c *ChartBox) Pie(canvas *gc.Canvas, r float64)

Pie makes a pie chart

func (*ChartBox) Scatter

func (c *ChartBox) Scatter(canvas *gc.Canvas, size float64)

Scatter makes a scatter chart

func (*ChartBox) YAxis

func (c *ChartBox) YAxis(canvas *gc.Canvas, size, min, max, step float64, format string, gridlines bool)

YAxis makes the Y axis with optional grid lines

type NameValue

type NameValue struct {
	// contains filtered or unexported fields
}

NameValue is a name,value pair

Directories

Path Synopsis
gchart -- command line chart using giocanvas chart package
gchart -- command line chart using giocanvas chart package

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL