plot

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToFloat64SliceForTest

func ConvertToFloat64SliceForTest(s collection.Series) ([]float64, error)

ConvertToFloat64SliceForTest is a test-only export of convertToFloat64Slice

func ConvertToPieDataForTest

func ConvertToPieDataForTest(labelSeries, valueSeries collection.Series) ([]opts.PieData, error)

ConvertToPieDataForTest is a test-only export of convertToPieData

func ConvertToStringSliceForTest

func ConvertToStringSliceForTest(s collection.Series) ([]string, error)

ConvertToStringSliceForTest is a test-only export of convertToStringSlice

func RenderBar

func RenderBar(xSeries, ySeries collection.Series, chartOpts *ChartOptions) error

RenderBar generates a bar chart from Series data. xSeries provides the x-axis labels (typically string Series). ySeries provides the y-axis values (must be numeric: int64 or float64). opts configures chart appearance and output location.

Returns an error if: - Either Series is nil - ySeries is not numeric (int64 or float64) - Data conversion fails - File write fails

func RenderLine

func RenderLine(xSeries collection.Series, ySeriesList []collection.Series, seriesNames []string, chartOpts *ChartOptions) error

RenderLine generates a line chart from Series data. xSeries provides the x-axis labels (typically string Series). ySeriesList provides one or more y-axis series (must be numeric: int64 or float64). seriesNames provides names for each y-axis series (must match length of ySeriesList). chartOpts configures chart appearance and output location.

Returns an error if: - xSeries is nil - ySeriesList is empty or contains nil Series - Any ySeries is not numeric (int64 or float64) - seriesNames length doesn't match ySeriesList length - Data conversion fails - File write fails

func RenderPie

func RenderPie(labelSeries, valueSeries collection.Series, chartOpts *ChartOptions) error

RenderPie generates a pie chart from Series data. labelSeries provides the pie slice labels (typically string Series). valueSeries provides the pie slice values (must be numeric: int64 or float64). chartOpts configures chart appearance and output location.

Returns an error if: - Either Series is nil - valueSeries is not numeric (int64 or float64) - Data conversion fails - File write fails

func ValidateNumericSeriesForTest

func ValidateNumericSeriesForTest(s collection.Series) error

ValidateNumericSeriesForTest is a test-only export of validateNumericSeries

Types

type ChartOptions

type ChartOptions struct {
	// Title is the chart title displayed at the top
	Title string

	// Width is the chart width in pixels (default: 900)
	Width int

	// Height is the chart height in pixels (default: 500)
	Height int

	// OutputPath is the file path for HTML output (required)
	OutputPath string

	// Theme is the chart theme for styling (optional, e.g., "light", "dark")
	Theme string
}

ChartOptions configures chart properties for plotting operations. It provides control over chart appearance and output location.

func DefaultChartOptions

func DefaultChartOptions() *ChartOptions

DefaultChartOptions returns a ChartOptions with default values applied. Default width: 900 pixels Default height: 500 pixels Default title: empty string Default theme: empty string (go-echarts default)

Jump to

Keyboard shortcuts

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