gochartjs

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2020 License: MIT Imports: 1 Imported by: 0

README

gochartjs

A go adaptation of the data model used in chartsjs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chart

type Chart struct {
	Data    ChartData    `json:"data"`
	Options ChartOptions `json:"options"`
	// contains filtered or unexported fields
}

func NewChart

func NewChart(chartLabel string) *Chart

func (*Chart) AddDatum

func (c *Chart) AddDatum(d ChartDatum)

func (*Chart) AddLabels

func (c *Chart) AddLabels(labels []string)

type ChartData

type ChartData struct {
	Labels   []string     `json:"labels"`
	DataSets []ChartDatum `json:"datasets"`
}

type ChartDatum

type ChartDatum struct {
	Label           string        `json:"label"`
	BackgroundColor string        `json:"backgroundColor,omitempty"`
	BorderColor     string        `json:"borderColor,omitempty"`
	Data            []interface{} `json:"data"`
	Fill            bool          `json:"fill"`
}

type ChartOptions

type ChartOptions struct {
	Responsive          bool       `json:"responsive"`
	MaintainAspectRatio bool       `json:"maintainAspectRatio"`
	Title               ChartTitle `json:"title"`
}

type ChartTitle

type ChartTitle struct {
	Display bool   `json:"display"`
	Text    string `json:"text"`
}

type EmptyColor added in v0.1.1

type EmptyColor struct{}

Jump to

Keyboard shortcuts

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