uglycharts

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: ISC Imports: 6 Imported by: 0

README

ugly-charts (WIP)

Charting library for gotk3

It is by no means ready for wide use, but it satisfies my limited use case, and I will keep working on it as my requirements grow.

What works

  • Line charts
  • Multiple series
  • Customising marker size/line width
  • Autoranging axis
  • Partial drawing
  • Title

What doesn't

  • Everything else

What's planned

  • Area charts, scatter charts
  • Legend
  • Integer series (maybe)
  • Calculate decimal ticks properly
  • Make it usable for use cases other than trivial positive-not-very-big-numbers

Screenshot

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFloatSeries

func NewFloatSeries(capacity uint) *floatSeries

capacity is the initial size of the backing slice

Types

type Chart

type Chart interface {
	AddSeries(s Series)
	GetDrawingArea() *gtk.DrawingArea

	SetTitle(title string)
	ShowLegend(show bool)
	SetAutoRangingX(value bool)
	GetAutoRangingX() bool
	SetAutoRangingY(value bool)
	GetAutoRangingY() bool
	SetDrawMarker(value bool)
	SetColorScheme(value color.Palette)
	SetMarkerSize(value float64)
	SetLineWidth(value float64)
	SetMinX(value float64)
	GetMinX() float64
	SetMaxX(value float64)
	GetMaxX() float64
	SetMinY(value float64)
	GetMinY() float64
	SetMaxY(value float64)
	GetMaxY() float64
	// contains filtered or unexported methods
}

func NewLineChart

func NewLineChart(da *gtk.DrawingArea) Chart

NewLineChart Constructor that initializes backing slice and connects drawing function to GtkDrawingArea

type FloatPoint

type FloatPoint struct {
	X, Y float64
}

func (FloatPoint) Equals

func (p FloatPoint) Equals(other Point) bool

func (FloatPoint) GetCoordinates

func (p FloatPoint) GetCoordinates() (float64, float64)

func (FloatPoint) GetX

func (p FloatPoint) GetX() float64

func (FloatPoint) GetY

func (p FloatPoint) GetY() float64

type IntPoint

type IntPoint struct {
	X, Y int
}

func (IntPoint) Equals

func (p IntPoint) Equals(other Point) bool

func (IntPoint) GetCoordinates

func (p IntPoint) GetCoordinates() (float64, float64)

func (IntPoint) GetX

func (p IntPoint) GetX() float64

func (IntPoint) GetY

func (p IntPoint) GetY() float64

type Point

type Point interface {
	Equals(p Point) bool
	GetX() float64
	GetY() float64
	GetCoordinates() (float64, float64)
}

type Series

type Series interface {
	Add(p Point)
	Get(index int) (Point, error)
	Clear()
	ClearFree(capacity int)
	Size() int

	GetPoints() []Point
	// contains filtered or unexported methods
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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