charts

package
v2.3.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 9 Imported by: 251

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bar

type Bar struct {
	RectChart
	// contains filtered or unexported fields
}

Bar represents a bar chart.

func NewBar

func NewBar() *Bar

NewBar creates a new bar chart instance.

func (*Bar) AddSeries

func (c *Bar) AddSeries(name string, data []opts.BarData, options ...SeriesOpts) *Bar

AddSeries adds the new series.

func (*Bar) EnablePolarType added in v2.2.4

func (c *Bar) EnablePolarType() *Bar

EnablePolarType enables the polar bar.

func (*Bar) SetXAxis

func (c *Bar) SetXAxis(x interface{}) *Bar

SetXAxis sets the X axis.

func (*Bar) Type

func (*Bar) Type() string

Type returns the chart type.

func (*Bar) Validate

func (c *Bar) Validate()

Validate validates the given configuration.

func (*Bar) XYReversal

func (c *Bar) XYReversal() *Bar

XYReversal checks if X axis and Y axis are reversed.

type Bar3D

type Bar3D struct {
	Chart3D
}

Bar3D represents a 3D bar chart.

func NewBar3D

func NewBar3D() *Bar3D

NewBar3D creates a new 3D bar chart.

func (*Bar3D) AddSeries added in v2.1.0

func (c *Bar3D) AddSeries(name string, data []opts.Chart3DData, options ...SeriesOpts) *Bar3D

AddSeries adds the new series.

func (*Bar3D) Type

func (*Bar3D) Type() string

Type returns the chart type.

type BaseActions added in v2.2.5

type BaseActions struct {
	actions.Type  `json:"type,omitempty"`
	actions.Areas `json:"areas,omitempty"`
}

BaseActions represents a dispatchAction set needed by all chart types.

func (*BaseActions) JSONNotEscapedAction added in v2.2.5

func (ba *BaseActions) JSONNotEscapedAction() template.HTML

JSONNotEscapedAction works like method JSON, but it returns a marshaled object whose characters will not be escaped in the template

type BaseConfiguration

type BaseConfiguration struct {
	opts.Legend       `json:"legend"`
	opts.Tooltip      `json:"tooltip"`
	opts.Toolbox      `json:"toolbox"`
	opts.Title        `json:"title"`
	opts.Polar        `json:"polar"`
	opts.AngleAxis    `json:"angleAxis"`
	opts.RadiusAxis   `json:"radiusAxis"`
	opts.Brush        `json:"brush"`
	*opts.AxisPointer `json:"axisPointer"`
	Calendar          []*opts.Calendar `json:"calendar"`

	render.Renderer        `json:"-"`
	opts.Initialization    `json:"-"`
	opts.Assets            `json:"-"`
	opts.RadarComponent    `json:"-"`
	opts.GeoComponent      `json:"-"`
	opts.ParallelComponent `json:"-"`
	opts.JSFunctions       `json:"-"`
	opts.SingleAxis        `json:"-"`

	MultiSeries
	XYAxis

	opts.XAxis3D
	opts.YAxis3D
	opts.ZAxis3D
	opts.Grid3D
	opts.Grid

	// Colors is the color list of palette.
	// If no color is set in series, the colors would be adopted sequentially and circularly
	// from this list as the colors of series.
	Colors []string

	// Animation whether enable the animation, default true
	Animation bool `json:"animation" default:"true"`

	// Array of datasets, managed by AddDataset()
	DatasetList []opts.Dataset `json:"dataset,omitempty"`

	DataZoomList  []opts.DataZoom  `json:"datazoom,omitempty"`
	VisualMapList []opts.VisualMap `json:"visualmap,omitempty"`

	// ParallelAxisList represents the component list which is the coordinate axis for parallel coordinate.
	ParallelAxisList []opts.ParallelAxis

	GridList []opts.Grid `json:"grid,omitempty"`
	// contains filtered or unexported fields
}

BaseConfiguration represents an option set needed by all chart types.

func (*BaseConfiguration) AddDataset added in v2.2.7

func (bc *BaseConfiguration) AddDataset(dataset ...opts.Dataset)

AddDataset adds a Dataset to this chart

func (*BaseConfiguration) FillDefaultValues added in v2.2.6

func (bc *BaseConfiguration) FillDefaultValues()

FillDefaultValues fill default values for chart options.

func (*BaseConfiguration) GetAssets

func (bc *BaseConfiguration) GetAssets() opts.Assets

GetAssets returns the Assets options.

func (*BaseConfiguration) JSON added in v2.2.0

func (bc *BaseConfiguration) JSON() map[string]interface{}

JSON wraps all the options to a map so that it could be used in the base template

Get data in bytes bs, _ : = json.Marshal(bar.JSON())

func (*BaseConfiguration) JSONNotEscaped added in v2.2.5

func (bc *BaseConfiguration) JSONNotEscaped() template.HTML

JSONNotEscaped works like method JSON, but it returns a marshaled object whose characters will not be escaped in the template

type BoxPlot

type BoxPlot struct {
	RectChart
}

BoxPlot represents a boxplot chart.

func NewBoxPlot

func NewBoxPlot() *BoxPlot

NewBoxPlot creates a new boxplot chart.

func (*BoxPlot) AddSeries

func (c *BoxPlot) AddSeries(name string, data []opts.BoxPlotData, options ...SeriesOpts) *BoxPlot

AddSeries adds the new series.

func (*BoxPlot) SetXAxis

func (c *BoxPlot) SetXAxis(x interface{}) *BoxPlot

SetXAxis adds the X axis.

func (*BoxPlot) Type

func (*BoxPlot) Type() string

Type returns the chart type.

func (*BoxPlot) Validate

func (c *BoxPlot) Validate()

Validate validates the given configuration.

type Chart3D

type Chart3D struct {
	BaseConfiguration
}

Chart3D is a chart in 3D coordinates.

func (*Chart3D) SetGlobalOptions

func (c *Chart3D) SetGlobalOptions(options ...GlobalOpts) *Chart3D

SetGlobalOptions sets options for the Chart3D instance.

func (*Chart3D) Validate

func (c *Chart3D) Validate()

Validate validates the given configuration.

type Custom added in v2.3.3

type Custom struct {
	RectChart
}

Custom represents a custom chart.

func NewCustom added in v2.3.3

func NewCustom() *Custom

NewCustom creates a new Custom chart.

func (*Custom) AddSeries added in v2.3.3

func (c *Custom) AddSeries(name string, data []opts.CustomData, options ...SeriesOpts) *Custom

AddSeries adds the new series.

func (*Custom) SetXAxis added in v2.3.3

func (c *Custom) SetXAxis(x interface{}) *Custom

SetXAxis adds the X axis.

func (*Custom) Type added in v2.3.3

func (*Custom) Type() string

Type returns the chart type.

func (*Custom) Validate added in v2.3.3

func (c *Custom) Validate()

Validate validates the given configuration.

type EffectScatter

type EffectScatter struct {
	RectChart
}

EffectScatter represents an effect scatter chart.

func NewEffectScatter

func NewEffectScatter() *EffectScatter

NewEffectScatter creates a new effect scatter chart.

func (*EffectScatter) AddSeries

func (c *EffectScatter) AddSeries(name string, data []opts.EffectScatterData, options ...SeriesOpts) *EffectScatter

AddSeries adds the Y axis.

func (*EffectScatter) SetXAxis

func (c *EffectScatter) SetXAxis(x interface{}) *EffectScatter

SetXAxis adds the X axis.

func (*EffectScatter) Type

func (*EffectScatter) Type() string

Type returns the chart type.

func (*EffectScatter) Validate

func (c *EffectScatter) Validate()

Validate validates the given configuration.

type Funnel

type Funnel struct {
	BaseConfiguration
	BaseActions
}

Funnel represents a funnel chart.

func NewFunnel

func NewFunnel() *Funnel

NewFunnel creates a new funnel chart.

func (*Funnel) AddSeries

func (c *Funnel) AddSeries(name string, data []opts.FunnelData, options ...SeriesOpts) *Funnel

AddSeries adds new data sets.

func (*Funnel) SetDispatchActions added in v2.2.5

func (c *Funnel) SetDispatchActions(actions ...GlobalActions) *Funnel

SetDispatchActions sets actions for the Gauge instance.

func (*Funnel) SetGlobalOptions

func (c *Funnel) SetGlobalOptions(options ...GlobalOpts) *Funnel

SetGlobalOptions sets options for the Funnel instance.

func (*Funnel) Type

func (*Funnel) Type() string

Type returns the chart type.

func (*Funnel) Validate

func (c *Funnel) Validate()

Validate validates the given configuration.

type Gauge

type Gauge struct {
	BaseConfiguration
	BaseActions
}

Gauge represents a gauge chart.

func NewGauge

func NewGauge() *Gauge

NewGauge creates a new gauge chart.

func (*Gauge) AddSeries

func (c *Gauge) AddSeries(name string, data []opts.GaugeData, options ...SeriesOpts) *Gauge

AddSeries adds new data sets.

func (*Gauge) SetDispatchActions added in v2.2.5

func (c *Gauge) SetDispatchActions(actions ...GlobalActions) *Gauge

SetDispatchActions sets actions for the Gauge instance.

func (*Gauge) SetGlobalOptions

func (c *Gauge) SetGlobalOptions(options ...GlobalOpts) *Gauge

SetGlobalOptions sets options for the Gauge instance.

func (*Gauge) Type

func (*Gauge) Type() string

Type returns the chart type.

func (*Gauge) Validate

func (c *Gauge) Validate()

Validate validates the given configuration.

type Geo

type Geo struct {
	BaseConfiguration
	BaseActions
}

Geo represents a geo chart.

func NewGeo

func NewGeo() *Geo

NewGeo creates a new geo chart.

func (*Geo) AddSeries

func (c *Geo) AddSeries(name, geoType string, data []opts.GeoData, options ...SeriesOpts) *Geo

AddSeries adds new data sets. geoType options: * types.ChartScatter * types.ChartEffectScatter * types.ChartHeatMap

func (*Geo) SetDispatchActions added in v2.2.5

func (c *Geo) SetDispatchActions(actions ...GlobalActions) *Geo

SetDispatchActions sets actions for the Geo instance.

func (*Geo) SetGlobalOptions

func (c *Geo) SetGlobalOptions(options ...GlobalOpts) *Geo

SetGlobalOptions sets options for the Geo instance.

func (*Geo) Type

func (*Geo) Type() string

Type returns the chart type.

func (*Geo) Validate

func (c *Geo) Validate()

Validate validates the given configuration.

type GlobalActions added in v2.2.5

type GlobalActions func(ba *BaseActions)

GlobalActions sets the Global actions for charts

func WithAreas added in v2.2.5

func WithAreas(act actions.Areas) GlobalActions

WithAreas sets the areas of the action

func WithType added in v2.2.5

func WithType(act actions.Type) GlobalActions

WithType sets the type of the action

type GlobalOpts

type GlobalOpts func(bc *BaseConfiguration)

GlobalOpts sets the Global options for charts.

func WithAngleAxisOps added in v2.2.4

func WithAngleAxisOps(opt opts.AngleAxis) GlobalOpts

WithAngleAxisOps sets the angle of the axis.

func WithAnimation added in v2.2.7

func WithAnimation() GlobalOpts

WithAnimation enable or disable the animation.

func WithAxisPointerOpts added in v2.2.5

func WithAxisPointerOpts(opt *opts.AxisPointer) GlobalOpts

WithAxisPointerOpts sets the axis pointer.

func WithBrush added in v2.2.5

func WithBrush(opt opts.Brush) GlobalOpts

WithBrush sets the Brush.

func WithColorsOpts

func WithColorsOpts(opt opts.Colors) GlobalOpts

WithColorsOpts sets the color.

func WithDataZoomOpts

func WithDataZoomOpts(opt ...opts.DataZoom) GlobalOpts

WithDataZoomOpts sets the list of the zoom data.

func WithGeoComponentOpts

func WithGeoComponentOpts(opt opts.GeoComponent) GlobalOpts

WithGeoComponentOpts sets the geo component.

func WithGrid3DOpts

func WithGrid3DOpts(opt opts.Grid3D) GlobalOpts

WithGrid3DOpts sets the grid of the Chart3D instance.

func WithGridOpts added in v2.2.5

func WithGridOpts(opt ...opts.Grid) GlobalOpts

WithGridOpts sets the List of the grid.

func WithInitializationOpts

func WithInitializationOpts(opt opts.Initialization) GlobalOpts

WithInitializationOpts sets the initialization.

func WithLegendOpts

func WithLegendOpts(opt opts.Legend) GlobalOpts

WithLegendOpts sets the legend.

func WithParallelAxisList

func WithParallelAxisList(opt []opts.ParallelAxis) GlobalOpts

WithParallelAxisList sets the list of the parallel axis.

func WithParallelComponentOpts

func WithParallelComponentOpts(opt opts.ParallelComponent) GlobalOpts

WithParallelComponentOpts sets the parallel component.

func WithPolarOps added in v2.2.4

func WithPolarOps(opt opts.Polar) GlobalOpts

WithPolarOps sets the polar.

func WithRadarComponentOpts

func WithRadarComponentOpts(opt opts.RadarComponent) GlobalOpts

WithRadarComponentOpts sets the component of the radar.

func WithRadiusAxisOps added in v2.2.4

func WithRadiusAxisOps(opt opts.RadiusAxis) GlobalOpts

WithRadiusAxisOps sets the radius of the axis.

func WithSingleAxisOpts

func WithSingleAxisOpts(opt opts.SingleAxis) GlobalOpts

WithSingleAxisOpts sets the single axis.

func WithTitleOpts

func WithTitleOpts(opt opts.Title) GlobalOpts

WithTitleOpts sets the title.

func WithToolboxOpts

func WithToolboxOpts(opt opts.Toolbox) GlobalOpts

WithToolboxOpts sets the toolbox.

func WithTooltipOpts

func WithTooltipOpts(opt opts.Tooltip) GlobalOpts

WithTooltipOpts sets the tooltip.

func WithVisualMapOpts

func WithVisualMapOpts(opt ...opts.VisualMap) GlobalOpts

WithVisualMapOpts sets the List of the visual map.

func WithXAxis3DOpts

func WithXAxis3DOpts(opt opts.XAxis3D) GlobalOpts

WithXAxis3DOpts sets the X axis of the Chart3D instance.

func WithXAxisOpts

func WithXAxisOpts(opt opts.XAxis, index ...int) GlobalOpts

WithXAxisOpts sets the X axis.

func WithYAxis3DOpts

func WithYAxis3DOpts(opt opts.YAxis3D) GlobalOpts

WithYAxis3DOpts sets the Y axis of the Chart3D instance.

func WithYAxisOpts

func WithYAxisOpts(opt opts.YAxis, index ...int) GlobalOpts

WithYAxisOpts sets the Y axis.

func WithZAxis3DOpts

func WithZAxis3DOpts(opt opts.ZAxis3D) GlobalOpts

WithZAxis3DOpts sets the Z axis of the Chart3D instance.

type Graph

type Graph struct {
	BaseConfiguration
	BaseActions
}

Graph represents a graph chart.

func NewGraph

func NewGraph() *Graph

NewGraph creates a new graph chart.

func (*Graph) AddSeries

func (c *Graph) AddSeries(name string, nodes []opts.GraphNode, links []opts.GraphLink, options ...SeriesOpts) *Graph

AddSeries adds the new series.

func (*Graph) SetDispatchActions added in v2.2.5

func (c *Graph) SetDispatchActions(actions ...GlobalActions) *Graph

SetDispatchActions sets actions for the Graph instance.

func (*Graph) SetGlobalOptions

func (c *Graph) SetGlobalOptions(options ...GlobalOpts) *Graph

SetGlobalOptions sets options for the Graph instance.

func (*Graph) Type

func (*Graph) Type() string

Type returns the chart type.

func (*Graph) Validate

func (c *Graph) Validate()

Validate validates the given configuration.

type HeatMap

type HeatMap struct {
	RectChart
}

HeatMap represents a heatmap chart.

func NewHeatMap

func NewHeatMap() *HeatMap

NewHeatMap creates a new heatmap chart.

func (*HeatMap) AddCalendar added in v2.3.3

func (c *HeatMap) AddCalendar(calendar ...*opts.Calendar) *HeatMap

AddCalendar adds the calendar configuration to the chart.

func (*HeatMap) AddSeries

func (c *HeatMap) AddSeries(name string, data []opts.HeatMapData, options ...SeriesOpts) *HeatMap

AddSeries adds the new series.

func (*HeatMap) SetXAxis

func (c *HeatMap) SetXAxis(x interface{}) *HeatMap

SetXAxis adds the X axis.

func (*HeatMap) Type

func (*HeatMap) Type() string

Type returns the chart type.

func (*HeatMap) Validate

func (c *HeatMap) Validate()

Validate validates the given configuration.

type Kline

type Kline struct {
	RectChart
}

Kline represents a kline chart.

func NewKLine

func NewKLine() *Kline

NewKLine creates a new kline chart.

func (*Kline) AddSeries

func (c *Kline) AddSeries(name string, data []opts.KlineData, options ...SeriesOpts) *Kline

AddSeries adds the new series.

func (*Kline) SetXAxis

func (c *Kline) SetXAxis(xAxis interface{}) *Kline

SetXAxis adds the X axis.

func (*Kline) Type

func (*Kline) Type() string

Type returns the chart type.

func (*Kline) Validate

func (c *Kline) Validate()

Validate validates the given configuration.

type Line

type Line struct {
	RectChart
}

Line represents a line chart.

func NewLine

func NewLine() *Line

NewLine creates a new line chart.

func (*Line) AddSeries

func (c *Line) AddSeries(name string, data []opts.LineData, options ...SeriesOpts) *Line

AddSeries adds the new series.

func (*Line) SetXAxis

func (c *Line) SetXAxis(x interface{}) *Line

SetXAxis adds the X axis.

func (*Line) Type

func (*Line) Type() string

Type returns the chart type.

func (*Line) Validate

func (c *Line) Validate()

Validate validates the given configuration.

type Line3D

type Line3D struct {
	Chart3D
}

Line3D represents a 3D line chart.

func NewLine3D

func NewLine3D() *Line3D

NewLine3D creates a new 3D line chart.

func (*Line3D) AddSeries added in v2.1.0

func (c *Line3D) AddSeries(name string, data []opts.Chart3DData, options ...SeriesOpts) *Line3D

AddSeries adds the new series.

func (*Line3D) Type

func (*Line3D) Type() string

Type returns the chart type.

type Liquid

type Liquid struct {
	BaseConfiguration
	BaseActions
}

Liquid represents a liquid chart.

func NewLiquid

func NewLiquid() *Liquid

NewLiquid creates a new liquid chart.

func (*Liquid) AddSeries

func (c *Liquid) AddSeries(name string, data []opts.LiquidData, options ...SeriesOpts) *Liquid

AddSeries adds new data sets.

func (*Liquid) SetDispatchActions added in v2.2.5

func (c *Liquid) SetDispatchActions(actions ...GlobalActions) *Liquid

SetDispatchActions sets actions for the Liquid instance.

func (*Liquid) SetGlobalOptions

func (c *Liquid) SetGlobalOptions(options ...GlobalOpts) *Liquid

SetGlobalOptions sets options for the Liquid instance.

func (*Liquid) Type

func (*Liquid) Type() string

Type returns the chart type.

func (*Liquid) Validate

func (c *Liquid) Validate()

Validate validates the given configuration.

type Map

type Map struct {
	BaseConfiguration
	BaseActions
	// contains filtered or unexported fields
}

Map represents a map chart.

func NewMap

func NewMap() *Map

NewMap creates a new map chart.

func (*Map) AddSeries

func (c *Map) AddSeries(name string, data []opts.MapData, options ...SeriesOpts) *Map

AddSeries adds new data sets.

func (*Map) RegisterMapType

func (c *Map) RegisterMapType(mapType string)

RegisterMapType registers the given mapType.

func (*Map) SetDispatchActions added in v2.2.5

func (c *Map) SetDispatchActions(actions ...GlobalActions) *Map

SetDispatchActions sets actions for the Radar instance.

func (*Map) SetGlobalOptions

func (c *Map) SetGlobalOptions(options ...GlobalOpts) *Map

SetGlobalOptions sets options for the Map instance.

func (*Map) Type

func (*Map) Type() string

Type returns the chart type.

func (*Map) Validate

func (c *Map) Validate()

Validate validates the given configuration.

type MultiSeries

type MultiSeries []SingleSeries

MultiSeries represents multiple series.

func (*MultiSeries) SetSeriesOptions

func (ms *MultiSeries) SetSeriesOptions(opts ...SeriesOpts)

SetSeriesOptions sets options for all the series. Previous options will be overwrote every time hence setting them on the `AddSeries` if you want to customize each series individually

here -> ↓ <-

func (c *Bar) AddSeries(name string, data []opts.BarData, options ...SeriesOpts)

type Overlaper

type Overlaper interface {
	// contains filtered or unexported methods
}

type Parallel

type Parallel struct {
	BaseConfiguration
	BaseActions
}

Parallel represents a parallel axis.

func NewParallel

func NewParallel() *Parallel

NewParallel creates a new parallel instance.

func (*Parallel) AddSeries

func (c *Parallel) AddSeries(name string, data []opts.ParallelData, options ...SeriesOpts) *Parallel

AddSeries adds new data sets.

func (*Parallel) SetDispatchActions added in v2.2.5

func (c *Parallel) SetDispatchActions(actions ...GlobalActions) *Parallel

SetDispatchActions sets actions for the Radar instance.

func (*Parallel) SetGlobalOptions

func (c *Parallel) SetGlobalOptions(options ...GlobalOpts) *Parallel

SetGlobalOptions sets options for the Parallel instance.

func (*Parallel) Type

func (*Parallel) Type() string

Type returns the chart type.

func (*Parallel) Validate

func (c *Parallel) Validate()

Validate validates the given configuration.

type Pie

type Pie struct {
	BaseConfiguration
	BaseActions
}

Pie represents a pie chart.

func NewPie

func NewPie() *Pie

NewPie creates a new pie chart.

func (*Pie) AddSeries

func (c *Pie) AddSeries(name string, data []opts.PieData, options ...SeriesOpts) *Pie

AddSeries adds new data sets.

func (*Pie) SetDispatchActions added in v2.2.5

func (c *Pie) SetDispatchActions(actions ...GlobalActions) *Pie

SetDispatchActions sets actions for the Pie instance.

func (*Pie) SetGlobalOptions

func (c *Pie) SetGlobalOptions(options ...GlobalOpts) *Pie

SetGlobalOptions sets options for the Pie instance.

func (*Pie) Type

func (*Pie) Type() string

Type returns the chart type.

func (*Pie) Validate

func (c *Pie) Validate()

Validate validates the given configuration.

type Radar

type Radar struct {
	BaseConfiguration
	BaseActions

	// SymbolKeepAspect is whether to keep aspect for symbols in the form of path://.
	SymbolKeepAspect bool
}

Radar represents a radar chart.

func NewRadar

func NewRadar() *Radar

NewRadar creates a new radar chart.

func (*Radar) AddSeries

func (c *Radar) AddSeries(name string, data []opts.RadarData, options ...SeriesOpts) *Radar

AddSeries adds new data sets.

func (*Radar) SetDispatchActions added in v2.2.5

func (c *Radar) SetDispatchActions(actions ...GlobalActions) *Radar

SetDispatchActions sets actions for the Radar instance.

func (*Radar) SetGlobalOptions

func (c *Radar) SetGlobalOptions(options ...GlobalOpts) *Radar

SetGlobalOptions sets options for the Radar instance.

func (*Radar) Type

func (*Radar) Type() string

Type returns the chart type.

func (*Radar) Validate

func (c *Radar) Validate()

Validate validates the given configuration.

type RectChart

type RectChart struct {
	RectConfiguration
	// contains filtered or unexported fields
}

RectChart is a chart in RectChart coordinate.

func (*RectChart) Overlap

func (rc *RectChart) Overlap(a ...Overlaper)

Overlap composes multiple charts into one single canvas. It is only suited for some of the charts which are in rectangular coordinate. Supported charts: Bar/BoxPlot/Line/Scatter/EffectScatter/Kline/HeatMap/Custom

func (*RectChart) SetDispatchActions added in v2.2.5

func (rc *RectChart) SetDispatchActions(options ...GlobalActions) *RectChart

SetDispatchActions sets actions for the RectChart instance.

func (*RectChart) SetGlobalOptions

func (rc *RectChart) SetGlobalOptions(options ...GlobalOpts) *RectChart

SetGlobalOptions sets options for the RectChart instance.

func (*RectChart) Validate

func (rc *RectChart) Validate()

Validate validates the given configuration.

type RectConfiguration

type RectConfiguration struct {
	BaseConfiguration
	BaseActions
}

RectConfiguration contains options for the rectangular coordinates.

type Sankey

type Sankey struct {
	BaseConfiguration
	BaseActions
}

Sankey represents a sankey chart.

func NewSankey

func NewSankey() *Sankey

NewSankey creates a new sankey chart.

func (*Sankey) AddSeries

func (c *Sankey) AddSeries(name string, nodes []opts.SankeyNode, links []opts.SankeyLink, options ...SeriesOpts) *Sankey

AddSeries adds new data sets.

func (*Sankey) SetDispatchActions added in v2.2.5

func (c *Sankey) SetDispatchActions(actions ...GlobalActions) *Sankey

SetDispatchActions sets actions for the Sankey instance.

func (*Sankey) SetGlobalOptions

func (c *Sankey) SetGlobalOptions(options ...GlobalOpts) *Sankey

SetGlobalOptions sets options for the Sankey instance.

func (*Sankey) Type

func (*Sankey) Type() string

Type returns the chart type.

func (*Sankey) Validate

func (c *Sankey) Validate()

Validate validates the given configuration.

type Scatter

type Scatter struct {
	RectChart
}

Scatter represents a scatter chart.

func NewScatter

func NewScatter() *Scatter

NewScatter creates a new scatter chart.

func (*Scatter) AddSeries

func (c *Scatter) AddSeries(name string, data []opts.ScatterData, options ...SeriesOpts) *Scatter

AddSeries adds the new series.

func (*Scatter) SetXAxis

func (c *Scatter) SetXAxis(x interface{}) *Scatter

SetXAxis adds the X axis.

func (*Scatter) Type

func (*Scatter) Type() string

Type returns the chart type.

func (*Scatter) Validate

func (c *Scatter) Validate()

Validate validates the given configuration.

type Scatter3D

type Scatter3D struct {
	Chart3D
}

Scatter3D represents a 3D scatter chart.

func NewScatter3D

func NewScatter3D() *Scatter3D

NewScatter3D creates a new 3D scatter chart.

func (*Scatter3D) AddSeries added in v2.1.0

func (c *Scatter3D) AddSeries(name string, data []opts.Chart3DData, options ...SeriesOpts) *Scatter3D

AddSeries adds the new series.

func (*Scatter3D) Type

func (*Scatter3D) Type() string

Type returns the chart type.

type SeriesOpts

type SeriesOpts func(s *SingleSeries)

func WithAreaStyleOpts

func WithAreaStyleOpts(opt opts.AreaStyle) SeriesOpts

WithAreaStyleOpts sets the area style.

func WithBar3DChartOpts

func WithBar3DChartOpts(opt opts.Bar3DChart) SeriesOpts

WithBar3DChartOpts sets the Bar3DChart option.

func WithBarChartOpts

func WithBarChartOpts(opt opts.BarChart) SeriesOpts

WithBarChartOpts sets the BarChart option.

func WithCalendarIndex added in v2.3.3

func WithCalendarIndex(index int) SeriesOpts

func WithCircularStyleOpts added in v2.2.5

func WithCircularStyleOpts(opt opts.CircularStyle) SeriesOpts

With CircularStyle Opts

func WithCoordinateSystem added in v2.3.3

func WithCoordinateSystem(cs string) SeriesOpts

func WithCustomChartOpts added in v2.3.3

func WithCustomChartOpts(opt opts.CustomChart) SeriesOpts

WithCustomChartOpts sets the CustomChart option.

func WithDatasetIndex added in v2.2.7

func WithDatasetIndex(index int) SeriesOpts

WithDatasetIndex sets the datasetIndex option.

func WithEmphasisOpts

func WithEmphasisOpts(opt opts.Emphasis) SeriesOpts

WithEmphasisOpts sets the emphasis.

func WithEncodeOpts added in v2.2.5

func WithEncodeOpts(opt opts.Encode) SeriesOpts

WithEncodeOpts Set encodes for dataSets

func WithGraphChartOpts

func WithGraphChartOpts(opt opts.GraphChart) SeriesOpts

WithGraphChartOpts sets the GraphChart option.

func WithHeatMapChartOpts

func WithHeatMapChartOpts(opt opts.HeatMapChart) SeriesOpts

WithHeatMapChartOpts sets the HeatMapChart option.

func WithItemStyleOpts

func WithItemStyleOpts(opt opts.ItemStyle) SeriesOpts

WithItemStyleOpts sets the item style.

func WithKlineChartOpts added in v2.2.7

func WithKlineChartOpts(opt opts.KlineChart) SeriesOpts

WithLineChartOpts sets the LineChart option.

func WithLabelOpts

func WithLabelOpts(opt opts.Label) SeriesOpts

WithLabelOpts sets the label.

func WithLineChartOpts

func WithLineChartOpts(opt opts.LineChart) SeriesOpts

WithLineChartOpts sets the LineChart option.

func WithLineStyleOpts

func WithLineStyleOpts(opt opts.LineStyle) SeriesOpts

WithLineStyleOpts sets the line style.

func WithLiquidChartOpts

func WithLiquidChartOpts(opt opts.LiquidChart) SeriesOpts

WithLiquidChartOpts sets the LiquidChart option.

func WithMarkAreaNameCoordItemOpts added in v2.2.5

func WithMarkAreaNameCoordItemOpts(opt ...opts.MarkAreaNameCoordItem) SeriesOpts

WithMarkAreaNameCoordItemOpts sets the coordinates of the MarkLine.

func WithMarkAreaNameTypeItemOpts added in v2.2.5

func WithMarkAreaNameTypeItemOpts(opt ...opts.MarkAreaNameTypeItem) SeriesOpts

WithMarkAreaNameTypeItemOpts sets the type of the MarkArea.

func WithMarkAreaNameXAxisItemOpts added in v2.2.5

func WithMarkAreaNameXAxisItemOpts(opt ...opts.MarkAreaNameXAxisItem) SeriesOpts

WithMarkAreaNameXAxisItemOpts sets the X axis of the MarkLine.

func WithMarkAreaNameYAxisItemOpts added in v2.2.5

func WithMarkAreaNameYAxisItemOpts(opt ...opts.MarkAreaNameYAxisItem) SeriesOpts

WithMarkAreaNameYAxisItemOpts sets the Y axis of the MarkLine.

func WithMarkAreaStyleOpts added in v2.2.5

func WithMarkAreaStyleOpts(opt opts.MarkAreaStyle) SeriesOpts

WithMarkAreaStyleOpts sets the style of the MarkArea.

func WithMarkLineNameCoordItemOpts added in v2.2.5

func WithMarkLineNameCoordItemOpts(opt ...opts.MarkLineNameCoordItem) SeriesOpts

WithMarkLineNameCoordItemOpts sets the coordinates of the MarkLine.

func WithMarkLineNameTypeItemOpts

func WithMarkLineNameTypeItemOpts(opt ...opts.MarkLineNameTypeItem) SeriesOpts

WithMarkLineNameTypeItemOpts sets the type of the MarkLine.

func WithMarkLineNameXAxisItemOpts

func WithMarkLineNameXAxisItemOpts(opt ...opts.MarkLineNameXAxisItem) SeriesOpts

WithMarkLineNameXAxisItemOpts sets the X axis of the MarkLine.

func WithMarkLineNameYAxisItemOpts

func WithMarkLineNameYAxisItemOpts(opt ...opts.MarkLineNameYAxisItem) SeriesOpts

WithMarkLineNameYAxisItemOpts sets the Y axis of the MarkLine.

func WithMarkLineStyleOpts added in v2.2.5

func WithMarkLineStyleOpts(opt opts.MarkLineStyle) SeriesOpts

WithMarkLineStyleOpts sets the style of the MarkLine.

func WithMarkPointNameCoordItemOpts

func WithMarkPointNameCoordItemOpts(opt ...opts.MarkPointNameCoordItem) SeriesOpts

WithMarkPointNameCoordItemOpts sets the coordinated of the MarkPoint.

func WithMarkPointNameTypeItemOpts

func WithMarkPointNameTypeItemOpts(opt ...opts.MarkPointNameTypeItem) SeriesOpts

WithMarkPointNameTypeItemOpts sets the type of the MarkPoint.

func WithMarkPointStyleOpts

func WithMarkPointStyleOpts(opt opts.MarkPointStyle) SeriesOpts

WithMarkPointStyleOpts sets the style of the MarkPoint.

func WithPieChartOpts

func WithPieChartOpts(opt opts.PieChart) SeriesOpts

WithPieChartOpts sets the PieChart option.

func WithRippleEffectOpts

func WithRippleEffectOpts(opt opts.RippleEffect) SeriesOpts

WithRippleEffectOpts sets the ripple effect.

func WithScatterChartOpts

func WithScatterChartOpts(opt opts.ScatterChart) SeriesOpts

WithScatterChartOpts sets the ScatterChart option.

func WithSeriesAnimation added in v2.2.7

func WithSeriesAnimation(enable bool) SeriesOpts

func WithSunburstOpts added in v2.2.4

func WithSunburstOpts(opt opts.SunburstChart) SeriesOpts

WithSunburstOpts sets the SunburstChart option.

func WithTreeMapOpts added in v2.2.5

func WithTreeMapOpts(opt opts.TreeMapChart) SeriesOpts

WithTreeMapOpts sets the TreeMapChart options.

func WithTreeOpts added in v2.2.4

func WithTreeOpts(opt opts.TreeChart) SeriesOpts

WithTreeOpts sets the TreeChart option.

func WithWorldCloudChartOpts

func WithWorldCloudChartOpts(opt opts.WordCloudChart) SeriesOpts

WithWorldCloudChartOpts sets the WorldCloudChart option.

type SingleSeries

type SingleSeries struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`

	// Rectangular charts
	Stack      string `json:"stack,omitempty"`
	XAxisIndex int    `json:"xAxisIndex,omitempty"`
	YAxisIndex int    `json:"yAxisIndex,omitempty"`

	// Bar
	BarGap         string `json:"barGap,omitempty"`
	BarCategoryGap string `json:"barCategoryGap,omitempty"`
	ShowBackground bool   `json:"showBackground,omitempty"`
	RoundCap       bool   `json:"roundCap,omitempty"`

	// Bar3D
	Shading string `json:"shading,omitempty"`

	// Graph
	Links              interface{} `json:"links,omitempty"`
	Layout             string      `json:"layout,omitempty"`
	Force              interface{} `json:"force,omitempty"`
	Categories         interface{} `json:"categories,omitempty"`
	Roam               bool        `json:"roam,omitempty"`
	EdgeSymbol         interface{} `json:"edgeSymbol,omitempty"`
	EdgeSymbolSize     interface{} `json:"edgeSymbolSize,omitempty"`
	EdgeLabel          interface{} `json:"edgeLabel,omitempty"`
	Draggable          bool        `json:"draggable,omitempty"`
	FocusNodeAdjacency bool        `json:"focusNodeAdjacency,omitempty"`
	SymbolKeepAspect   bool        `json:"symbolKeepAspect,omitempty"`

	// KLine
	BarWidth    string `json:"barWidth,omitempty"`
	BarMinWidth string `json:"barMinWidth,omitempty"`
	BarMaxWidth string `json:"barMaxWidth,omitempty"`

	// Line
	Step         interface{} `json:"step,omitempty"`
	Smooth       bool        `json:"smooth"`
	ConnectNulls bool        `json:"connectNulls"`
	ShowSymbol   bool        `json:"showSymbol"`
	Symbol       string      `json:"symbol,omitempty"`
	Color        string      `json:"color,omitempty"`

	// Liquid
	IsLiquidOutline bool `json:"outline,omitempty"`
	IsWaveAnimation bool `json:"waveAnimation"`

	// Map
	MapType     string `json:"map,omitempty"`
	CoordSystem string `json:"coordinateSystem,omitempty"`

	// Pie
	RoseType interface{} `json:"roseType,omitempty"`
	Center   interface{} `json:"center,omitempty"`
	Radius   interface{} `json:"radius,omitempty"`

	// Scatter
	SymbolSize interface{} `json:"symbolSize,omitempty"`

	// Tree
	Orient            string      `json:"orient,omitempty"`
	ExpandAndCollapse bool        `json:"expandAndCollapse,omitempty"`
	InitialTreeDepth  int         `json:"initialTreeDepth,omitempty"`
	Leaves            interface{} `json:"leaves,omitempty"`
	Left              string      `json:"left,omitempty"`
	Right             string      `json:"right,omitempty"`
	Top               string      `json:"top,omitempty"`
	Bottom            string      `json:"bottom,omitempty"`

	// TreeMap
	LeafDepth  int         `json:"leafDepth,omitempty"`
	Levels     interface{} `json:"levels,omitempty"`
	UpperLabel interface{} `json:"upperLabel,omitempty"`

	// WordCloud
	Shape         string    `json:"shape,omitempty"`
	SizeRange     []float32 `json:"sizeRange,omitempty"`
	RotationRange []float32 `json:"rotationRange,omitempty"`

	// Sunburst
	NodeClick               string `json:"nodeClick,omitempty"`
	Sort                    string `json:"sort,omitempty"`
	RenderLabelForZeroData  bool   `json:"renderLabelForZeroData"`
	SelectedMode            bool   `json:"selectedMode"`
	Animation               bool   `json:"animation" default:"true"`
	AnimationThreshold      int    `json:"animationThreshold,omitempty"`
	AnimationDuration       int    `json:"animationDuration,omitempty"`
	AnimationEasing         string `json:"animationEasing,omitempty"`
	AnimationDelay          int    `json:"animationDelay,omitempty"`
	AnimationDurationUpdate int    `json:"animationDurationUpdate,omitempty"`
	AnimationEasingUpdate   string `json:"animationEasingUpdate,omitempty"`
	AnimationDelayUpdate    int    `json:"animationDelayUpdate,omitempty"`

	// Custom
	RenderItem string `json:"renderItem,omitempty"`

	// series data
	Data         interface{} `json:"data,omitempty"`
	DatasetIndex int         `json:"datasetIndex,omitempty"`

	// series options
	*opts.Encode        `json:"encode,omitempty"`
	*opts.ItemStyle     `json:"itemStyle,omitempty"`
	*opts.Label         `json:"label,omitempty"`
	*opts.LabelLine     `json:"labelLine,omitempty"`
	*opts.Emphasis      `json:"emphasis,omitempty"`
	*opts.MarkLines     `json:"markLine,omitempty"`
	*opts.MarkAreas     `json:"markArea,omitempty"`
	*opts.MarkPoints    `json:"markPoint,omitempty"`
	*opts.RippleEffect  `json:"rippleEffect,omitempty"`
	*opts.LineStyle     `json:"lineStyle,omitempty"`
	*opts.AreaStyle     `json:"areaStyle,omitempty"`
	*opts.TextStyle     `json:"textStyle,omitempty"`
	*opts.CircularStyle `json:"circular,omitempty"`

	// Calendar
	CalendarIndex int `json:"calendarIndex,omitempty"`
}

func (*SingleSeries) ConfigureSeriesOpts added in v2.2.5

func (s *SingleSeries) ConfigureSeriesOpts(options ...SeriesOpts)

func (*SingleSeries) InitSeriesDefaultOpts added in v2.2.7

func (s *SingleSeries) InitSeriesDefaultOpts(c BaseConfiguration)

type Sunburst added in v2.2.4

type Sunburst struct {
	BaseConfiguration
	BaseActions
}

Sunburst represents a sunburst chart.

func NewSunburst added in v2.2.4

func NewSunburst() *Sunburst

NewSunburst creates a new sunburst chart instance.

func (*Sunburst) AddSeries added in v2.2.4

func (c *Sunburst) AddSeries(name string, data []opts.SunBurstData, options ...SeriesOpts) *Sunburst

AddSeries adds new data sets.

func (*Sunburst) SetDispatchActions added in v2.2.5

func (c *Sunburst) SetDispatchActions(actions ...GlobalActions) *Sunburst

SetDispatchActions sets actions for the Sunburst instance.

func (*Sunburst) SetGlobalOptions added in v2.2.4

func (c *Sunburst) SetGlobalOptions(options ...GlobalOpts) *Sunburst

SetGlobalOptions sets options for the Pie instance.

func (*Sunburst) Type added in v2.2.4

func (*Sunburst) Type() string

Type returns the chart type.

func (*Sunburst) Validate added in v2.2.4

func (c *Sunburst) Validate()

Validate validates the given configuration.

type Surface3D

type Surface3D struct {
	Chart3D
}

Surface3D represents a 3D surface chart.

func NewSurface3D

func NewSurface3D() *Surface3D

NewSurface3D creates a new 3d surface chart.

func (*Surface3D) AddSeries added in v2.1.0

func (c *Surface3D) AddSeries(name string, data []opts.Chart3DData, options ...SeriesOpts) *Surface3D

AddSeries adds the new series.

func (*Surface3D) Type

func (*Surface3D) Type() string

Type returns the chart type.

type ThemeRiver

type ThemeRiver struct {
	BaseConfiguration
	BaseActions
}

ThemeRiver represents a theme river chart.

func NewThemeRiver

func NewThemeRiver() *ThemeRiver

NewThemeRiver creates a new theme river chart.

func (*ThemeRiver) AddSeries

func (c *ThemeRiver) AddSeries(name string, data []opts.ThemeRiverData, options ...SeriesOpts) *ThemeRiver

AddSeries adds new data sets.

func (*ThemeRiver) SetDispatchActions added in v2.2.5

func (c *ThemeRiver) SetDispatchActions(actions ...GlobalActions) *ThemeRiver

SetDispatchActions sets actions for the ThemeRiver instance.

func (*ThemeRiver) SetGlobalOptions

func (c *ThemeRiver) SetGlobalOptions(options ...GlobalOpts) *ThemeRiver

SetGlobalOptions sets options for the ThemeRiver instance.

func (*ThemeRiver) Type

func (*ThemeRiver) Type() string

Type returns the chart type.

func (*ThemeRiver) Validate

func (c *ThemeRiver) Validate()

Validate validates the given configuration.

type Tree added in v2.2.4

type Tree struct {
	BaseConfiguration
	BaseActions
}

Tree represents a Tree chart.

func NewTree added in v2.2.4

func NewTree() *Tree

NewTree creates a new Tree chart instance.

func (*Tree) AddSeries added in v2.2.4

func (c *Tree) AddSeries(name string, data []opts.TreeData, options ...SeriesOpts) *Tree

AddSeries adds new data sets.

func (*Tree) SetDispatchActions added in v2.2.5

func (c *Tree) SetDispatchActions(actions ...GlobalActions) *Tree

SetDispatchActions sets actions for the Tree instance.

func (*Tree) SetGlobalOptions added in v2.2.4

func (c *Tree) SetGlobalOptions(options ...GlobalOpts) *Tree

SetGlobalOptions sets options for the Tree instance.

func (*Tree) Type added in v2.2.4

func (*Tree) Type() string

Type returns the chart type.

func (*Tree) Validate added in v2.2.4

func (c *Tree) Validate()

Validate validates the given configuration.

type TreeMap added in v2.2.5

type TreeMap struct {
	BaseConfiguration
	BaseActions
}

TreeMap represents a TreeMap chart.

func NewTreeMap added in v2.2.5

func NewTreeMap() *TreeMap

NewTreeMap creates a new TreeMap chart instance.

func (*TreeMap) AddSeries added in v2.2.5

func (c *TreeMap) AddSeries(name string, data []opts.TreeMapNode, options ...SeriesOpts) *TreeMap

AddSeries adds new data sets.

func (*TreeMap) SetDispatchActions added in v2.2.5

func (c *TreeMap) SetDispatchActions(actions ...GlobalActions) *TreeMap

SetDispatchActions sets actions for the TreeMap instance.

func (*TreeMap) SetGlobalOptions added in v2.2.5

func (c *TreeMap) SetGlobalOptions(options ...GlobalOpts) *TreeMap

SetGlobalOptions sets options for the TreeMap instance.

func (*TreeMap) Type added in v2.2.5

func (*TreeMap) Type() string

Type returns the chart type.

func (*TreeMap) Validate added in v2.2.5

func (c *TreeMap) Validate()

Validate validates the given configuration.

type WordCloud

type WordCloud struct {
	BaseConfiguration
	BaseActions
}

WordCloud represents a word cloud chart.

func NewWordCloud

func NewWordCloud() *WordCloud

NewWordCloud creates a new word cloud chart.

func (*WordCloud) AddSeries

func (c *WordCloud) AddSeries(name string, data []opts.WordCloudData, options ...SeriesOpts) *WordCloud

AddSeries adds new data sets.

func (*WordCloud) SetDispatchActions added in v2.2.5

func (c *WordCloud) SetDispatchActions(actions ...GlobalActions) *WordCloud

SetDispatchActions sets actions for the WordCloud instance.

func (*WordCloud) SetGlobalOptions

func (c *WordCloud) SetGlobalOptions(options ...GlobalOpts) *WordCloud

SetGlobalOptions sets options for the WordCloud instance.

func (*WordCloud) Type

func (*WordCloud) Type() string

Type returns the chart type.

func (*WordCloud) Validate

func (c *WordCloud) Validate()

Validate validates the given configuration.

type XYAxis

type XYAxis struct {
	XAxisList []opts.XAxis `json:"xaxis"`
	YAxisList []opts.YAxis `json:"yaxis"`
}

XYAxis represent the X and Y axis in the rectangular coordinates.

func (*XYAxis) ExtendXAxis

func (xy *XYAxis) ExtendXAxis(xAxis ...opts.XAxis)

ExtendXAxis adds new X axes.

func (*XYAxis) ExtendYAxis

func (xy *XYAxis) ExtendYAxis(yAxis ...opts.YAxis)

ExtendYAxis adds new Y axes.

Jump to

Keyboard shortcuts

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