Documentation ¶
Index ¶
Constants ¶
View Source
const ( ChartTypeBar = "bar" ChartTypeLine = "line" ChartTypePie = "pie" ChartTypeScatter = "scatter" )
Chart types
View Source
const ( ChartAxisTypesLinear = "linear" ChartAxisTypesTime = "time" )
Chart axis type
View Source
const ( ChartBackgroundColorBlue = "rgba(54, 162, 235, 0.2)" ChartBackgroundColorGreen = "rgba(75, 192, 192, 0.2)" ChartBackgroundColorOrange = "rgba(255, 159, 64, 0.2)" ChartBackgroundColorPurple = "rgba(153, 102, 255, 0.2)" ChartBackgroundColorRed = "rgba(255, 99, 132, 0.2)" ChartBackgroundColorYellow = "rgba(255, 206, 86, 0.2)" )
Chart background colors
View Source
const ( ChartBorderColorBlue = "rgba(54, 162, 235, 1)" ChartBorderColorGreen = "rgba(75, 192, 192, 1)" ChartBorderColorOrange = "rgba(255, 159, 64, 1)" ChartBorderColorPurple = "rgba(153, 102, 255, 1)" ChartBorderColorRed = "rgba(255,99,132,1)" ChartBorderColorYellow = "rgba(255, 206, 86, 1)" )
Chart border colors
View Source
const (
ChartAxisPositionsBottom = "bottom"
)
Chart axis positions
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Animation ¶ added in v0.2.0
type Animation struct {
Duration *int `json:"duration,omitempty"`
}
Animation ...
type Axis ¶
type Axis struct { Display *bool `json:"display,omitempty"` Position string `json:"position,omitempty"` ScaleLabel *ScaleLabel `json:"scaleLabel,omitempty"` Stacked *bool `json:"stacked,omitempty"` Ticks *Ticks `json:"ticks,omitempty"` TimeType *TimeType `json:"time,omitempty"` Type string `json:"type,omitempty,"` }
Axis represents an axis options
type Chart ¶
type Chart struct { Data *Data `json:"data,omitempty"` Options *Options `json:"options,omitempty"` Type string `json:"type"` }
Chart represents a chart
type Data ¶
type Data struct { Datasets []Dataset `json:"datasets,omitempty"` Labels []string `json:"labels,omitempty"` }
Data represents data
type Dataset ¶
type Dataset struct { BackgroundColor interface{} `json:"backgroundColor,omitempty"` BorderColor interface{} `json:"borderColor,omitempty"` Data []interface{} `json:"data,omitempty"` Label string `json:"label,omitempty"` PointRadius string `json:"pointRadius,omitempty"` Stack string `json:"stack,omitempty"` }
Dataset represents a dataset
type Elements ¶ added in v0.2.0
type Elements struct {
Line *Line `json:"line,omitempty"`
}
Elements ...
type Hover ¶ added in v0.2.0
type Hover struct {
AnimationDuration *int `json:"animationDuration,omitempty"`
}
Hover ...
type Legend ¶ added in v0.2.0
type Legend struct { Display *bool `json:"display,omitempty"` Labels *LegendLabels `json:"labels,omitempty"` }
Legend represents a legend options
type LegendLabels ¶ added in v0.2.0
type LegendLabels struct {
FontSize *int `json:"fontSize,omitempty"`
}
LegendLabels represents a legend options
type Options ¶
type Options struct { Animation *Animation `json:"animation,omitempty"` Elements *Elements `json:"elements,omitempty"` Hover *Hover `json:"hover,omitempty"` Legend *Legend `json:"legend,omitempty"` MaintainAspectRatio *bool `json:"maintainAspectRatio,omitempty"` Responsive *bool `json:"responsive,omitempty"` ResponsiveAnimationDuration *int `json:"responsiveAnimationDuration,omitempty"` Scales *Scales `json:"scales,omitempty"` Title *Title `json:"title,omitempty"` }
Options represents options
type ScaleLabel ¶
type ScaleLabel struct { Display *bool `json:"display,omitempty"` LabelString string `json:"labelString,omitempty"` }
ScaleLabel represents a scale label options
type Ticks ¶ added in v0.2.0
type Ticks struct {
FontSize *int `json:"fontSize,omitempty"`
}
Ticks represents an ticks options
type TimeDisplayFormats ¶ added in v0.2.0
type TimeDisplayFormats struct {
TimeDisplayFormatMillisecond string `json:"millisecond,omitempty"`
}
TimeDisplayFormats ...
type TimeType ¶ added in v0.2.0
type TimeType struct {
DisplayFormats *TimeDisplayFormats `json:"displayFormats,omitempty"`
}
TimeType ...
type TimedDataPoint ¶ added in v0.2.0
TimedDataPoint represents a data point
Click to show internal directories.
Click to hide internal directories.