Documentation
¶
Index ¶
- type BarChart
- func (c *BarChart) Render() string
- func (c *BarChart) SetColors(colors []string) Chart
- func (c *BarChart) SetData(data []float64) Chart
- func (c *BarChart) SetHorizontal(horizontal bool) *BarChart
- func (c *BarChart) SetLabels(labels []string) Chart
- func (c *BarChart) SetSize(width, height int) Chart
- func (c *BarChart) SetStacked(stacked bool) *BarChart
- func (c *BarChart) SetTitle(title string) Chart
- type BaseChart
- type Chart
- type LineChart
- func (c *LineChart) Render() string
- func (c *LineChart) SetColors(colors []string) Chart
- func (c *LineChart) SetData(data []float64) Chart
- func (c *LineChart) SetLabels(labels []string) Chart
- func (c *LineChart) SetSize(width, height int) Chart
- func (c *LineChart) SetSmooth(smooth bool) *LineChart
- func (c *LineChart) SetTitle(title string) Chart
- func (c *LineChart) ShowDataPoints(show bool) *LineChart
- type PieChart
- func (c *PieChart) Render() string
- func (c *PieChart) SetColors(colors []string) Chart
- func (c *PieChart) SetData(data []float64) Chart
- func (c *PieChart) SetDonutHole(percentage float64) *PieChart
- func (c *PieChart) SetLabels(labels []string) Chart
- func (c *PieChart) SetSize(width, height int) Chart
- func (c *PieChart) SetTitle(title string) Chart
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BarChart ¶
BarChart implements a bar chart
func NewBarChart ¶
func NewBarChart() *BarChart
NewBarChart creates a new bar chart with default settings
func (*BarChart) SetHorizontal ¶
SetHorizontal displays bars horizontally
func (*BarChart) SetStacked ¶
SetStacked stacks multiple data series
type BaseChart ¶
type BaseChart struct {
ChartType string
Title string
Width int
Height int
Data []float64
Labels []string
Colors []string
ShowTitle bool
ShowLegend bool
Margin struct {
Top int
Right int
Bottom int
Left int
}
BackgroundColor string
}
BaseChart contains common properties and methods for all chart types
type Chart ¶
type Chart interface {
SetTitle(title string) Chart
SetSize(width, height int) Chart
SetData(data []float64) Chart
SetLabels(labels []string) Chart
SetColors(colors []string) Chart
Render() string
}
Chart is the interface that all chart types must implement
type LineChart ¶
LineChart implements a line chart
func NewLineChart ¶
func NewLineChart() *LineChart
NewLineChart creates a new line chart with default settings
func (*LineChart) ShowDataPoints ¶
ShowDataPoints shows or hides data points for line charts
type PieChart ¶
PieChart implements a pie/donut chart
func NewPieChart ¶
func NewPieChart() *PieChart
NewPieChart creates a new pie chart with default settings
func (*PieChart) SetDonutHole ¶
SetDonutHole sets the inner circle size for donut charts
Click to show internal directories.
Click to hide internal directories.