chartjs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package chartjs provides a godom plugin for Chart.js integration. Chart.js is embedded and injected automatically — no CDN or manual <script> tag required. Users configure charts using plain Go maps that pass straight through to Chart.js.

Index

Constants

This section is empty.

Variables

View Source
var Plugin godom.PluginFunc = func(eng *godom.Engine) {
	eng.RegisterPlugin("chartjs", chartLibJS, bridgeJS)
}

Plugin registers Chart.js with a godom Engine.

Functions

func Register

func Register(eng *godom.Engine)

Register adds the Chart.js plugin to a godom Engine. Deprecated: Use eng.Use(chartjs.Plugin) instead.

Types

type Chart

type Chart struct {
	Type     string                   `json:"type"`
	Labels   []string                 `json:"labels,omitempty"`
	Datasets []map[string]interface{} `json:"datasets"`
	Options  map[string]interface{}   `json:"options,omitempty"`
}

Chart holds the configuration and data for a Chart.js chart. Options and Datasets use maps so any Chart.js property can be passed through without needing Go type definitions.

Jump to

Keyboard shortcuts

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