bw

package module
v0.0.0-...-445c466 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

bw - Borud's Widgets

This repository contains experimental widgets.

Go Reference

Bars Widget

This is a very simple bar graph widget.

screenshot of Bars widget

Documentation

Overview

Package bw is short for Borud's Widgets.

This package contains various widgets that I've needed. They are by no means production ready, but if you find them useful feel free to make use of them. Just be aware that they may change without warning, they may be slow and buggy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bars

type Bars struct {
	widget.BaseWidget

	BarMinSize     fyne.Size
	Spacing        float32
	ColorFunc      ColorFunc
	ShowPercentage bool
	// contains filtered or unexported fields
}

Bars implements a simple bar chart widget

func NewBars

func NewBars(n int) *Bars

NewBars creates new bars widget

func (*Bars) CreateRenderer

func (b *Bars) CreateRenderer() fyne.WidgetRenderer

CreateRenderer returns a renderer for Bars

func (*Bars) SetValue

func (b *Bars) SetValue(i int, v float64)

SetValue sets the value at a given index i to value v.

func (*Bars) Value

func (b *Bars) Value(i int) float64

Value returns the value at a given index.

type ColorFunc

type ColorFunc func(v float64) color.Color

ColorFunc takes a value v in the range [0.0,1.0] and returns a color. You can use this to render the color of the bar according to some scheme of your own choosing.

Directories

Path Synopsis
cmd
demo
Package main contains a simple test application for bar chart
Package main contains a simple test application for bar chart

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳