internal

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyYAxis

func ApplyYAxis[T any](chart Chart[T], name string, labels *[]string, min *float64, max *float64, splitNumber *int, formatter string, data ...insyra.IDataList) (bool, map[string]int, func(insyra.IDataList) []opts.LineData, func(insyra.IDataList) []float64)

ApplyYAxis builds Y-axis options, applies them to the provided chart, and returns isCategory and mapping (if any). It will also set caller's labels if a pointer is provided so callers get derived labels automatically.

func SetBaseChartGlobalOptions

func SetBaseChartGlobalOptions[T any](chart Chart[T], config BaseChartConfig)

func SetShowLabels

func SetShowLabels[T any](chart Chart[T], showLabels bool, labelPos string, defaultLabelPos string)

Types

type BaseChartConfig

type BaseChartConfig struct {
	Width           string // Width of the chart (default "900px").
	Height          string // Height of the chart (default "500px").
	BackgroundColor string // Background color of the chart (default "white").
	Theme           string // Theme of the chart.
	Title           string // Title of the chart.
	Subtitle        string // Subtitle of the chart.
	TitlePos        string // Title position: "top" or "bottom".
	HideLegend      bool   // Whether to hide the legend.
	LegendPos       string // Legend position: "top" or "bottom".
}

type Chart

type Chart[T any] interface {
	SetGlobalOptions(...charts.GlobalOpts) T
	SetSeriesOptions(...charts.SeriesOpts)
	Render(w io.Writer) error
	RenderContent() []byte
}

Jump to

Keyboard shortcuts

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