gplot

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBarChart

func CreateBarChart(config BarChartConfig) *plot.Plot

CreateBarChart generates and returns a plot.Plot object based on BarChartConfig.

func CreateHistogram

func CreateHistogram(config HistogramConfig) *plot.Plot

CreateHistogram generates and returns a plot.Plot object based on HistogramConfig.

func SaveChart

func SaveChart(plt *plot.Plot, filename string)

SaveChart saves the plot to a file. Supported file formats: .jpg|.jpeg|.pdf|.png|.svg|.tex|.tif|.tiff Automatically determine the file extension based on the filename.

Types

type BarChartConfig

type BarChartConfig struct {
	Title      string   // Title of the chart.
	XAxis      []string // X-axis data (categories).
	SeriesData any      // Accepts []float64 or *insyra.DataList
	XAxisName  string   // Optional: X-axis name.
	YAxisName  string   // Optional: Y-axis name.
	BarWidth   float64  // Optional: Bar width for each bar in the chart. Default is 20.
}

BarChartConfig defines the configuration for a single series bar chart.

type HistogramConfig

type HistogramConfig struct {
	Title      string // Title of the chart.
	SeriesData any    // Accepts []float64 or *insyra.DataList or insyra.IDataList.
	XAxisName  string // Optional: X-axis name.
	YAxisName  string // Optional: Y-axis name.
	Bins       int    // Number of bins for the histogram.
}

HistogramConfig defines the configuration for a single series histogram.

Jump to

Keyboard shortcuts

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