htmlPlot

package
v0.0.0-...-e9af47e Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChartConfig

type ChartConfig struct {
	XAxisName  string
	YAxisName  string
	ShowLegend bool
	ShowGrid   bool
	ViewBox    *[4]int
}

type HtmlPlotter

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

HtmlPlotter implements plots.HtmlPlotter interface, and plots multiple SVG plots to a single HTML file.

func NewHtmlPlotter

func NewHtmlPlotter(cfg PlotConfig) *HtmlPlotter

NewHtmlPlotter crates a new plotter instance.

func (*HtmlPlotter) AddChart

func (p *HtmlPlotter) AddChart(c plots.Chart)

AddChart adds another SVG chart to HTML plot

func (*HtmlPlotter) Plot

func (p *HtmlPlotter) Plot(target io.Writer) error

Plot generates HTML file with SVG charts and writes it to the target.

type PlotConfig

type PlotConfig struct {
	// How many charts per row to display
	Cols int
}

type SvgChart

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

SvgChart is a plots.LineChart implementation, which exclusively prints SVG charts.

func NewClassicChart

func NewClassicChart(name string, cfg ChartConfig) *SvgChart

NewClassicChart creates a preconfigured chart, which provides a classic view with enabled grid, axis names, legend, padding, etc.

func (*SvgChart) AddLine

func (c *SvgChart) AddLine(l *plots.Line)

AddLine add a new line to the chart

func (*SvgChart) Draw

func (c *SvgChart) Draw(target io.Writer) error

Draw prints the chart to the target.

func (*SvgChart) Name

func (c *SvgChart) Name() string

Name returns the chart name (title)

Jump to

Keyboard shortcuts

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