chart

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LineChart

func LineChart(props LineChartProps) *dom.Node

LineChart renders a line chart as a dom.Node the x is a list of dates, and y is float64 values connect the points with lines

func RenderLineChartLines

func RenderLineChartLines(props LineChartProps) []string

RenderLineChartLines renders the line chart and returns it as an array of strings

Types

type DataPoint

type DataPoint struct {
	X string  // Label for X axis (e.g., date, category)
	Y float64 // Value for Y axis
}

type LineChartProps

type LineChartProps struct {
	// Data points where X is typically a label (e.g., date) and Y is the value
	Data []DataPoint
	// Width of the chart (default: 60)
	Width int
	// Height of the chart (default: 20)
	Height int
	// Title of the chart
	Title string
}

Jump to

Keyboard shortcuts

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