chartjs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Code generated by go-bindata. DO NOT EDIT. sources: assets/chart.min.js

Index

Constants

This section is empty.

Variables

View Source
var AssetsList = []string{
	"/chart.min.js",
}
View Source
var List = map[string]string{
	"chartjs": `{{define "chartjs"}}
    {{if ne .Title ""}}
        <p class="text-center">
            <strong>{{langHtml .Title}}</strong>
        </p>
    {{end}}
    <div class="chart">
        <canvas id="{{.ID}}" style="height: {{.Height}}px;"></canvas>
    </div>
    <script>
        new Chart(document.getElementById('{{.ID}}'), {{.Js}});
    </script>
{{end}}`,
}

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type Attributes

type Attributes struct {
	Labels []string `json:"labels,omitempty"`
}

type BarAttributes

type BarAttributes struct {
	Attributes

	DataSets BarDataSets `json:"datasets"`
}

type BarChart

type BarChart struct {
	*Chart

	JsContent BarJsContent
}

func Bar

func Bar() *BarChart

func (*BarChart) AddDataSet

func (l *BarChart) AddDataSet(s string) *BarChart

func (*BarChart) DSBackgroundColor

func (l *BarChart) DSBackgroundColor(backgroundColor Color) *BarChart

func (*BarChart) DSBorderCapStyle

func (l *BarChart) DSBorderCapStyle(borderCapStyle string) *BarChart

func (*BarChart) DSBorderColor

func (l *BarChart) DSBorderColor(borderColor Color) *BarChart

func (*BarChart) DSBorderSkipped

func (l *BarChart) DSBorderSkipped(skip string) *BarChart

func (*BarChart) DSBorderWidth

func (l *BarChart) DSBorderWidth(borderWidth float64) *BarChart

func (*BarChart) DSData

func (l *BarChart) DSData(data []float64) *BarChart

func (*BarChart) DSHoverBackgroundColor

func (l *BarChart) DSHoverBackgroundColor(hoverBackgroundColor Color) *BarChart

func (*BarChart) DSHoverBorderColor

func (l *BarChart) DSHoverBorderColor(hoverBorderColor Color) *BarChart

func (*BarChart) DSHoverBorderWidth

func (l *BarChart) DSHoverBorderWidth(hoverBorderWidth float64) *BarChart

func (*BarChart) DSLabel

func (l *BarChart) DSLabel(s string) *BarChart

func (*BarChart) DSOrder

func (l *BarChart) DSOrder(order float64) *BarChart

func (*BarChart) DSType

func (l *BarChart) DSType(t string) *BarChart

func (*BarChart) DSXAxisID

func (l *BarChart) DSXAxisID(xAxisID string) *BarChart

func (*BarChart) DSYAxisID

func (l *BarChart) DSYAxisID(yAxisID string) *BarChart

func (*BarChart) GetContent

func (l *BarChart) GetContent() template.HTML

func (*BarChart) SetHeight

func (l *BarChart) SetHeight(s int) *BarChart

func (*BarChart) SetID

func (l *BarChart) SetID(s string) *BarChart

func (*BarChart) SetLabels

func (l *BarChart) SetLabels(s []string) *BarChart

func (*BarChart) SetTitle

func (l *BarChart) SetTitle(s template.HTML) *BarChart

type BarDataSet

type BarDataSet struct {
	Label           string    `json:"label"`
	Data            []float64 `json:"data"`
	Type            string    `json:"type,omitempty"`
	BackgroundColor Color     `json:"backgroundColor,omitempty"`
	BorderCapStyle  string    `json:"borderCapStyle,omitempty"`
	BorderColor     Color     `json:"borderColor,omitempty"`

	BorderSkipped string  `json:"borderSkipped,omitempty"`
	BorderWidth   float64 `json:"borderWidth,omitempty"`

	HoverBackgroundColor Color   `json:"hoverBackgroundColor,omitempty"`
	HoverBorderColor     Color   `json:"hoverBorderColor,omitempty"`
	HoverBorderWidth     float64 `json:"hoverBorderWidth,omitempty"`

	Order   float64 `json:"order,omitempty"`
	XAxisID string  `json:"xAxisID,omitempty"`
	YAxisID string  `json:"yAxisID,omitempty"`
}

func (*BarDataSet) SetBackgroundColor

func (l *BarDataSet) SetBackgroundColor(backgroundColor Color) *BarDataSet

func (*BarDataSet) SetBorderCapStyle

func (l *BarDataSet) SetBorderCapStyle(borderCapStyle string) *BarDataSet

func (*BarDataSet) SetBorderColor

func (l *BarDataSet) SetBorderColor(borderColor Color) *BarDataSet

func (*BarDataSet) SetBorderSkipped

func (l *BarDataSet) SetBorderSkipped(skip string) *BarDataSet

func (*BarDataSet) SetBorderWidth

func (l *BarDataSet) SetBorderWidth(borderWidth float64) *BarDataSet

func (*BarDataSet) SetData

func (l *BarDataSet) SetData(data []float64) *BarDataSet

func (*BarDataSet) SetHoverBackgroundColor

func (l *BarDataSet) SetHoverBackgroundColor(hoverBackgroundColor Color) *BarDataSet

func (*BarDataSet) SetHoverBorderColor

func (l *BarDataSet) SetHoverBorderColor(hoverBorderColor Color) *BarDataSet

func (*BarDataSet) SetHoverBorderWidth

func (l *BarDataSet) SetHoverBorderWidth(hoverBorderWidth float64) *BarDataSet

func (*BarDataSet) SetLabel

func (l *BarDataSet) SetLabel(label string) *BarDataSet

func (*BarDataSet) SetOrder

func (l *BarDataSet) SetOrder(order float64) *BarDataSet

func (*BarDataSet) SetType

func (l *BarDataSet) SetType(t string) *BarDataSet

func (*BarDataSet) SetXAxisID

func (l *BarDataSet) SetXAxisID(xAxisID string) *BarDataSet

func (*BarDataSet) SetYAxisID

func (l *BarDataSet) SetYAxisID(yAxisID string) *BarDataSet

type BarDataSets

type BarDataSets []*BarDataSet

func (BarDataSets) Add

func (l BarDataSets) Add(ds *BarDataSet) BarDataSets

type BarJsContent

type BarJsContent struct {
	JsContent

	Data BarAttributes `json:"data"`
}

type Chart

type Chart struct {
	*template2.BaseComponent

	ID     string
	Title  template.HTML
	Js     template.JS
	Height int

	JsContentOptions *Options
	// contains filtered or unexported fields
}

func NewChart

func NewChart() *Chart

func (*Chart) GetAsset

func (c *Chart) GetAsset(name string) ([]byte, error)

func (*Chart) GetAssetList

func (c *Chart) GetAssetList() []string

func (*Chart) GetContent

func (c *Chart) GetContent() template.HTML

func (*Chart) SetHeight

func (c *Chart) SetHeight(height int) *Chart

func (*Chart) SetID

func (c *Chart) SetID(id string) *Chart

func (*Chart) SetOptionAnimationDuration

func (c *Chart) SetOptionAnimationDuration(duration int)

func (*Chart) SetOptionAnimationEasing

func (c *Chart) SetOptionAnimationEasing(easing string)

func (*Chart) SetOptionElementArc

func (c *Chart) SetOptionElementArc(arc *OptionElementArc)

func (*Chart) SetOptionElementLine

func (c *Chart) SetOptionElementLine(line *OptionElementLine)

func (*Chart) SetOptionElementPoint

func (c *Chart) SetOptionElementPoint(point *OptionElementPoint)

func (*Chart) SetOptionElementRectangle

func (c *Chart) SetOptionElementRectangle(rectangle *OptionElementRectangle)

func (*Chart) SetOptionLayoutPaddingBottom

func (c *Chart) SetOptionLayoutPaddingBottom(bottom int)

func (*Chart) SetOptionLayoutPaddingLeft

func (c *Chart) SetOptionLayoutPaddingLeft(left int)

func (*Chart) SetOptionLayoutPaddingRight

func (c *Chart) SetOptionLayoutPaddingRight(right int)

func (*Chart) SetOptionLayoutPaddingTop

func (c *Chart) SetOptionLayoutPaddingTop(top int)

func (*Chart) SetOptionLegendAlign

func (c *Chart) SetOptionLegendAlign(align string)

func (*Chart) SetOptionLegendDisplay

func (c *Chart) SetOptionLegendDisplay(display bool)

func (*Chart) SetOptionLegendFullWidt

func (c *Chart) SetOptionLegendFullWidt(fullWidth bool)

func (*Chart) SetOptionLegendLabels

func (c *Chart) SetOptionLegendLabels(labels *OptionLegendLabel)

func (*Chart) SetOptionLegendPosition

func (c *Chart) SetOptionLegendPosition(position string)

func (*Chart) SetOptionLegendRevers

func (c *Chart) SetOptionLegendRevers(reverse bool)

func (*Chart) SetOptionLegendRt

func (c *Chart) SetOptionLegendRt(rtl bool)

func (*Chart) SetOptionLegendTextDirection

func (c *Chart) SetOptionLegendTextDirection(textDirection string)

func (*Chart) SetOptionTitleDisplay

func (c *Chart) SetOptionTitleDisplay(display bool)

func (*Chart) SetOptionTitleFontColor

func (c *Chart) SetOptionTitleFontColor(fontColor Color)

func (*Chart) SetOptionTitleFontFamily

func (c *Chart) SetOptionTitleFontFamily(fontFamily string)

func (*Chart) SetOptionTitleFontSize

func (c *Chart) SetOptionTitleFontSize(fontSize int)

func (*Chart) SetOptionTitleFontStyle

func (c *Chart) SetOptionTitleFontStyle(fontStyle string)

func (*Chart) SetOptionTitleLineHeight

func (c *Chart) SetOptionTitleLineHeight(lineHeight int)

func (*Chart) SetOptionTitlePadding

func (c *Chart) SetOptionTitlePadding(padding int)

func (*Chart) SetOptionTitlePosition

func (c *Chart) SetOptionTitlePosition(position string)

func (*Chart) SetOptionTitleText

func (c *Chart) SetOptionTitleText(text string)

func (*Chart) SetOptionTooltipsBackgroundColor

func (c *Chart) SetOptionTooltipsBackgroundColor(backgroundColor Color)

func (*Chart) SetOptionTooltipsBodyAlign

func (c *Chart) SetOptionTooltipsBodyAlign(bodyAlign string)

func (*Chart) SetOptionTooltipsBodyFontColor

func (c *Chart) SetOptionTooltipsBodyFontColor(bodyFontColor Color)

func (*Chart) SetOptionTooltipsBodyFontFamily

func (c *Chart) SetOptionTooltipsBodyFontFamily(bodyFontFamily string)

func (*Chart) SetOptionTooltipsBodyFontSize

func (c *Chart) SetOptionTooltipsBodyFontSize(bodyFontSize int)

func (*Chart) SetOptionTooltipsBodyFontStyle

func (c *Chart) SetOptionTooltipsBodyFontStyle(bodyFontStyle string)

func (*Chart) SetOptionTooltipsBodySpacing

func (c *Chart) SetOptionTooltipsBodySpacing(bodySpacing int)

func (*Chart) SetOptionTooltipsBorderColor

func (c *Chart) SetOptionTooltipsBorderColor(borderColor Color)

func (*Chart) SetOptionTooltipsBorderWidth

func (c *Chart) SetOptionTooltipsBorderWidth(borderWidth int)

func (*Chart) SetOptionTooltipsCaretPadding

func (c *Chart) SetOptionTooltipsCaretPadding(caretPadding int)

func (*Chart) SetOptionTooltipsCaretSize

func (c *Chart) SetOptionTooltipsCaretSize(caretSize int)

func (*Chart) SetOptionTooltipsCornerRadius

func (c *Chart) SetOptionTooltipsCornerRadius(cornerRadius int)

func (*Chart) SetOptionTooltipsDisplayColors

func (c *Chart) SetOptionTooltipsDisplayColors(displayColors bool)

func (*Chart) SetOptionTooltipsEnabled

func (c *Chart) SetOptionTooltipsEnabled(enabled bool)

func (*Chart) SetOptionTooltipsFooterAlign

func (c *Chart) SetOptionTooltipsFooterAlign(footerAlign string)

func (*Chart) SetOptionTooltipsFooterFontColor

func (c *Chart) SetOptionTooltipsFooterFontColor(footerFontColor Color)

func (*Chart) SetOptionTooltipsFooterFontFamily

func (c *Chart) SetOptionTooltipsFooterFontFamily(footerFontFamily string)

func (*Chart) SetOptionTooltipsFooterFontSize

func (c *Chart) SetOptionTooltipsFooterFontSize(footerFontSize int)

func (*Chart) SetOptionTooltipsFooterFontStyle

func (c *Chart) SetOptionTooltipsFooterFontStyle(footerFontStyle string)

func (*Chart) SetOptionTooltipsFooterMarginTop

func (c *Chart) SetOptionTooltipsFooterMarginTop(footerMarginTop int)

func (*Chart) SetOptionTooltipsFooterSpacing

func (c *Chart) SetOptionTooltipsFooterSpacing(footerSpacing int)

func (*Chart) SetOptionTooltipsIntersect

func (c *Chart) SetOptionTooltipsIntersect(intersect bool)

func (*Chart) SetOptionTooltipsMode

func (c *Chart) SetOptionTooltipsMode(mode string)

func (*Chart) SetOptionTooltipsMultiKeyBackground

func (c *Chart) SetOptionTooltipsMultiKeyBackground(multiKeyBackground Color)

func (*Chart) SetOptionTooltipsPosition

func (c *Chart) SetOptionTooltipsPosition(position string)

func (*Chart) SetOptionTooltipsRtl

func (c *Chart) SetOptionTooltipsRtl(rtl bool)

func (*Chart) SetOptionTooltipsTextDirection

func (c *Chart) SetOptionTooltipsTextDirection(textDirection string)

func (*Chart) SetOptionTooltipsTitleAlign

func (c *Chart) SetOptionTooltipsTitleAlign(titleAlign string)

func (*Chart) SetOptionTooltipsTitleFontColor

func (c *Chart) SetOptionTooltipsTitleFontColor(titleFontColor Color)

func (*Chart) SetOptionTooltipsTitleFontFamily

func (c *Chart) SetOptionTooltipsTitleFontFamily(titleFontFamily string)

func (*Chart) SetOptionTooltipsTitleFontSize

func (c *Chart) SetOptionTooltipsTitleFontSize(titleFontSize int)

func (*Chart) SetOptionTooltipsTitleFontStyle

func (c *Chart) SetOptionTooltipsTitleFontStyle(titleFontStyle string)

func (*Chart) SetOptionTooltipsTitleMarginBottom

func (c *Chart) SetOptionTooltipsTitleMarginBottom(titleMarginBottom int)

func (*Chart) SetOptionTooltipsTitleSpacing

func (c *Chart) SetOptionTooltipsTitleSpacing(titleSpacing int)

func (*Chart) SetOptionTooltipsXPadding

func (c *Chart) SetOptionTooltipsXPadding(xPadding int)

func (*Chart) SetOptionTooltipsYPadding

func (c *Chart) SetOptionTooltipsYPadding(yPadding int)

func (*Chart) SetTitle

func (c *Chart) SetTitle(title template.HTML) *Chart

type Color

type Color string

type DataSet

type DataSet struct {
	Label string    `json:"label,omitempty"`
	Data  []float64 `json:"data,omitempty"`
	Type  string    `json:"type,omitempty"`
}

type DataSets

type DataSets []DataSet

type JsContent

type JsContent struct {
	Type    string   `json:"type,omitempty"`
	Options *Options `json:"options,omitempty"`
}

type LineAttributes

type LineAttributes struct {
	Attributes

	DataSets LineDataSets `json:"datasets"`
}

type LineChart

type LineChart struct {
	*Chart

	JsContent LineJsContent
}

func Line

func Line() *LineChart

func (*LineChart) AddDataSet

func (l *LineChart) AddDataSet(s string) *LineChart

func (*LineChart) DSBackgroundColor

func (l *LineChart) DSBackgroundColor(backgroundColor Color) *LineChart

func (*LineChart) DSBorderCapStyle

func (l *LineChart) DSBorderCapStyle(borderCapStyle string) *LineChart

func (*LineChart) DSBorderColor

func (l *LineChart) DSBorderColor(borderColor Color) *LineChart

func (*LineChart) DSBorderDash

func (l *LineChart) DSBorderDash(borderDash []int) *LineChart

func (*LineChart) DSBorderDashOffset

func (l *LineChart) DSBorderDashOffset(borderDashOffset float64) *LineChart

func (*LineChart) DSBorderJoinStyle

func (l *LineChart) DSBorderJoinStyle(borderJoinStyle string) *LineChart

func (*LineChart) DSBorderWidth

func (l *LineChart) DSBorderWidth(borderWidth float64) *LineChart

func (*LineChart) DSCubicInterpolationMode

func (l *LineChart) DSCubicInterpolationMode(cubicInterpolationMode string) *LineChart

func (*LineChart) DSData

func (l *LineChart) DSData(data []float64) *LineChart

func (*LineChart) DSFill

func (l *LineChart) DSFill(fill bool) *LineChart

func (*LineChart) DSHoverBackgroundColor

func (l *LineChart) DSHoverBackgroundColor(hoverBackgroundColor Color) *LineChart

func (*LineChart) DSHoverBorderCapStyle

func (l *LineChart) DSHoverBorderCapStyle(hoverBorderCapStyle string) *LineChart

func (*LineChart) DSHoverBorderColor

func (l *LineChart) DSHoverBorderColor(hoverBorderColor Color) *LineChart

func (*LineChart) DSHoverBorderDash

func (l *LineChart) DSHoverBorderDash(hoverBorderDash float64) *LineChart

func (*LineChart) DSHoverBorderDashOffset

func (l *LineChart) DSHoverBorderDashOffset(hoverBorderDashOffset float64) *LineChart

func (*LineChart) DSHoverBorderJoinStyle

func (l *LineChart) DSHoverBorderJoinStyle(hoverBorderJoinStyle string) *LineChart

func (*LineChart) DSHoverBorderWidth

func (l *LineChart) DSHoverBorderWidth(hoverBorderWidth float64) *LineChart

func (*LineChart) DSLabel

func (l *LineChart) DSLabel(s string) *LineChart

func (*LineChart) DSLineTension

func (l *LineChart) DSLineTension(lineTension float64) *LineChart

func (*LineChart) DSOrder

func (l *LineChart) DSOrder(order float64) *LineChart

func (*LineChart) DSPointBackgroundColor

func (l *LineChart) DSPointBackgroundColor(pointBackgroundColor Color) *LineChart

func (*LineChart) DSPointBorderColor

func (l *LineChart) DSPointBorderColor(pointBorderColor Color) *LineChart

func (*LineChart) DSPointBorderWidth

func (l *LineChart) DSPointBorderWidth(pointBorderWidth float64) *LineChart

func (*LineChart) DSPointHitRadius

func (l *LineChart) DSPointHitRadius(pointHitRadius float64) *LineChart

func (*LineChart) DSPointHoverBackgroundColor

func (l *LineChart) DSPointHoverBackgroundColor(pointHoverBackgroundColor Color) *LineChart

func (*LineChart) DSPointHoverBorderColor

func (l *LineChart) DSPointHoverBorderColor(pointHoverBorderColor Color) *LineChart

func (*LineChart) DSPointHoverBorderWidth

func (l *LineChart) DSPointHoverBorderWidth(pointHoverBorderWidth float64) *LineChart

func (*LineChart) DSPointHoverRadius

func (l *LineChart) DSPointHoverRadius(pointHoverRadius float64) *LineChart

func (*LineChart) DSPointRadius

func (l *LineChart) DSPointRadius(pointRadius float64) *LineChart

func (*LineChart) DSPointRotation

func (l *LineChart) DSPointRotation(pointRotation float64) *LineChart

func (*LineChart) DSPointStyle

func (l *LineChart) DSPointStyle(pointStyle string) *LineChart

func (*LineChart) DSShowLine

func (l *LineChart) DSShowLine(showLine bool) *LineChart

func (*LineChart) DSSpanGaps

func (l *LineChart) DSSpanGaps(spanGaps bool) *LineChart

func (*LineChart) DSSteppedLine

func (l *LineChart) DSSteppedLine(steppedLine bool) *LineChart

func (*LineChart) DSType

func (l *LineChart) DSType(t string) *LineChart

func (*LineChart) DSXAxisID

func (l *LineChart) DSXAxisID(xAxisID string) *LineChart

func (*LineChart) DSYAxisID

func (l *LineChart) DSYAxisID(yAxisID string) *LineChart

func (*LineChart) GetContent

func (l *LineChart) GetContent() template.HTML

func (*LineChart) SetHeight

func (l *LineChart) SetHeight(s int) *LineChart

func (*LineChart) SetID

func (l *LineChart) SetID(s string) *LineChart

func (*LineChart) SetLabels

func (l *LineChart) SetLabels(s []string) *LineChart

func (*LineChart) SetTitle

func (l *LineChart) SetTitle(s template.HTML) *LineChart

type LineDataSet

type LineDataSet struct {
	Label                     string    `json:"label"`
	Data                      []float64 `json:"data"`
	Type                      string    `json:"type,omitempty"`
	BackgroundColor           Color     `json:"backgroundColor,omitempty"`
	BorderCapStyle            string    `json:"borderCapStyle,omitempty"`
	BorderColor               Color     `json:"borderColor,omitempty"`
	BorderDash                []int     `json:"borderDash,omitempty"`
	BorderDashOffset          float64   `json:"borderDashOffset,omitempty"`
	BorderJoinStyle           string    `json:"borderJoinStyle,omitempty"`
	BorderWidth               float64   `json:"borderWidth,omitempty"`
	CubicInterpolationMode    string    `json:"cubicInterpolationMode,omitempty"`
	Fill                      bool      `json:"fill"`
	HoverBackgroundColor      Color     `json:"hoverBackgroundColor,omitempty"`
	HoverBorderCapStyle       string    `json:"hoverBorderCapStyle,omitempty"`
	HoverBorderColor          Color     `json:"hoverBorderColor,omitempty"`
	HoverBorderDash           float64   `json:"hoverBorderDash,omitempty"`
	HoverBorderDashOffset     float64   `json:"hoverBorderDashOffset,omitempty"`
	HoverBorderJoinStyle      string    `json:"hoverBorderJoinStyle,omitempty"`
	HoverBorderWidth          float64   `json:"hoverBorderWidth,omitempty"`
	LineTension               float64   `json:"lineTension,omitempty"`
	Order                     float64   `json:"order,omitempty"`
	PointBackgroundColor      Color     `json:"pointBackgroundColor,omitempty"`
	PointBorderColor          Color     `json:"pointBorderColor,omitempty"`
	PointBorderWidth          float64   `json:"pointBorderWidth,omitempty"`
	PointHitRadius            float64   `json:"pointHitRadius,omitempty"`
	PointHoverBackgroundColor Color     `json:"pointHoverBackgroundColor,omitempty"`
	PointHoverBorderColor     Color     `json:"pointHoverBorderColor,omitempty"`
	PointHoverBorderWidth     float64   `json:"pointHoverBorderWidth,omitempty"`
	PointHoverRadius          float64   `json:"pointHoverRadius,omitempty"`
	PointRadius               float64   `json:"pointRadius,omitempty"`
	PointRotation             float64   `json:"pointRotation,omitempty"`
	PointStyle                string    `json:"pointStyle,omitempty"`
	ShowLine                  bool      `json:"showLine,omitempty"`
	SpanGaps                  bool      `json:"spanGaps,omitempty"`
	SteppedLine               bool      `json:"steppedLine,omitempty"`
	XAxisID                   string    `json:"xAxisID,omitempty"`
	YAxisID                   string    `json:"yAxisID,omitempty"`
}

func (*LineDataSet) SetBackgroundColor

func (l *LineDataSet) SetBackgroundColor(backgroundColor Color) *LineDataSet

func (*LineDataSet) SetBorderCapStyle

func (l *LineDataSet) SetBorderCapStyle(borderCapStyle string) *LineDataSet

func (*LineDataSet) SetBorderColor

func (l *LineDataSet) SetBorderColor(borderColor Color) *LineDataSet

func (*LineDataSet) SetBorderDash

func (l *LineDataSet) SetBorderDash(borderDash []int) *LineDataSet

func (*LineDataSet) SetBorderDashOffset

func (l *LineDataSet) SetBorderDashOffset(borderDashOffset float64) *LineDataSet

func (*LineDataSet) SetBorderJoinStyle

func (l *LineDataSet) SetBorderJoinStyle(borderJoinStyle string) *LineDataSet

func (*LineDataSet) SetBorderWidth

func (l *LineDataSet) SetBorderWidth(borderWidth float64) *LineDataSet

func (*LineDataSet) SetCubicInterpolationMode

func (l *LineDataSet) SetCubicInterpolationMode(cubicInterpolationMode string) *LineDataSet

func (*LineDataSet) SetData

func (l *LineDataSet) SetData(data []float64) *LineDataSet

func (*LineDataSet) SetFill

func (l *LineDataSet) SetFill(fill bool) *LineDataSet

func (*LineDataSet) SetHoverBackgroundColor

func (l *LineDataSet) SetHoverBackgroundColor(hoverBackgroundColor Color) *LineDataSet

func (*LineDataSet) SetHoverBorderCapStyle

func (l *LineDataSet) SetHoverBorderCapStyle(hoverBorderCapStyle string) *LineDataSet

func (*LineDataSet) SetHoverBorderColor

func (l *LineDataSet) SetHoverBorderColor(hoverBorderColor Color) *LineDataSet

func (*LineDataSet) SetHoverBorderDash

func (l *LineDataSet) SetHoverBorderDash(hoverBorderDash float64) *LineDataSet

func (*LineDataSet) SetHoverBorderDashOffset

func (l *LineDataSet) SetHoverBorderDashOffset(hoverBorderDashOffset float64) *LineDataSet

func (*LineDataSet) SetHoverBorderJoinStyle

func (l *LineDataSet) SetHoverBorderJoinStyle(hoverBorderJoinStyle string) *LineDataSet

func (*LineDataSet) SetHoverBorderWidth

func (l *LineDataSet) SetHoverBorderWidth(hoverBorderWidth float64) *LineDataSet

func (*LineDataSet) SetLabel

func (l *LineDataSet) SetLabel(label string) *LineDataSet

func (*LineDataSet) SetLineTension

func (l *LineDataSet) SetLineTension(lineTension float64) *LineDataSet

func (*LineDataSet) SetOrder

func (l *LineDataSet) SetOrder(order float64) *LineDataSet

func (*LineDataSet) SetPointBackgroundColor

func (l *LineDataSet) SetPointBackgroundColor(pointBackgroundColor Color) *LineDataSet

func (*LineDataSet) SetPointBorderColor

func (l *LineDataSet) SetPointBorderColor(pointBorderColor Color) *LineDataSet

func (*LineDataSet) SetPointBorderWidth

func (l *LineDataSet) SetPointBorderWidth(pointBorderWidth float64) *LineDataSet

func (*LineDataSet) SetPointHitRadius

func (l *LineDataSet) SetPointHitRadius(pointHitRadius float64) *LineDataSet

func (*LineDataSet) SetPointHoverBackgroundColor

func (l *LineDataSet) SetPointHoverBackgroundColor(pointHoverBackgroundColor Color) *LineDataSet

func (*LineDataSet) SetPointHoverBorderColor

func (l *LineDataSet) SetPointHoverBorderColor(pointHoverBorderColor Color) *LineDataSet

func (*LineDataSet) SetPointHoverBorderWidth

func (l *LineDataSet) SetPointHoverBorderWidth(pointHoverBorderWidth float64) *LineDataSet

func (*LineDataSet) SetPointHoverRadius

func (l *LineDataSet) SetPointHoverRadius(pointHoverRadius float64) *LineDataSet

func (*LineDataSet) SetPointRadius

func (l *LineDataSet) SetPointRadius(pointRadius float64) *LineDataSet

func (*LineDataSet) SetPointRotation

func (l *LineDataSet) SetPointRotation(pointRotation float64) *LineDataSet

func (*LineDataSet) SetPointStyle

func (l *LineDataSet) SetPointStyle(pointStyle string) *LineDataSet

func (*LineDataSet) SetShowLine

func (l *LineDataSet) SetShowLine(showLine bool) *LineDataSet

func (*LineDataSet) SetSpanGaps

func (l *LineDataSet) SetSpanGaps(spanGaps bool) *LineDataSet

func (*LineDataSet) SetSteppedLine

func (l *LineDataSet) SetSteppedLine(steppedLine bool) *LineDataSet

func (*LineDataSet) SetType

func (l *LineDataSet) SetType(t string) *LineDataSet

func (*LineDataSet) SetXAxisID

func (l *LineDataSet) SetXAxisID(xAxisID string) *LineDataSet

func (*LineDataSet) SetYAxisID

func (l *LineDataSet) SetYAxisID(yAxisID string) *LineDataSet

type LineDataSets

type LineDataSets []*LineDataSet

func (LineDataSets) Add

type LineJsContent

type LineJsContent struct {
	JsContent

	Data LineAttributes `json:"data"`
}

type OptionAnimation

type OptionAnimation struct {
	Duration int    `json:"duration,omitempty"`
	Easing   string `json:"easing,omitempty"`
}

type OptionElement

type OptionElement struct {
	Point     *OptionElementPoint     `json:"point,omitempty"`
	Line      *OptionElementLine      `json:"line,omitempty"`
	Rectangle *OptionElementRectangle `json:"rectangle,omitempty"`
	Arc       *OptionElementArc       `json:"arc,omitempty"`
}

type OptionElementArc

type OptionElementArc struct {
	Angle           int    `json:"angle,omitempty"`
	BackgroundColor Color  `json:"backgroundColor,omitempty"`
	BorderAlign     string `json:"borderAlign,omitempty"`
	BorderColor     Color  `json:"borderColor,omitempty"`
	BorderWidth     int    `json:"borderWidth,omitempty"`
}

type OptionElementLine

type OptionElementLine struct {
	Tension                int    `json:"tension,omitempty"`
	BackgroundColor        Color  `json:"background_color,omitempty"`
	BorderWidth            int    `json:"border_width,omitempty"`
	BorderColor            Color  `json:"border_color,omitempty"`
	BorderCapStyle         string `json:"border_cap_style,omitempty"`
	BorderDash             int    `json:"border_dash,omitempty"`
	BorderDashOffset       int    `json:"border_dash_offset,omitempty"`
	BorderJoinStyle        string `json:"border_join_style,omitempty"`
	CapBezierPoints        bool   `json:"cap_bezier_points,omitempty"`
	CubicInterpolationMode string `json:"cubic_interpolation_mode,omitempty"`
	Fill                   bool   `json:"fill,omitempty"`
	Stepped                bool   `json:"stepped,omitempty"`
}

type OptionElementPoint

type OptionElementPoint struct {
	Radius           int    `json:"radius,omitempty"`
	PointStyle       string `json:"pointStyle,omitempty"`
	Rotation         int    `json:"rotation,omitempty"`
	BackgroundColor  Color  `json:"backgroundColor,omitempty"`
	BorderWidth      int    `json:"borderWidth,omitempty"`
	BorderColor      Color  `json:"borderColor,omitempty"`
	HitRadius        int    `json:"hitRadius,omitempty"`
	HoverRadius      int    `json:"hoverRadius,omitempty"`
	HoverBorderWidth int    `json:"hoverBorderWidth,omitempty"`
}

type OptionElementRectangle

type OptionElementRectangle struct {
	BackgroundColor Color  `json:"backgroundColor,omitempty"`
	BorderWidth     int    `json:"borderWidth,omitempty"`
	BorderColor     Color  `json:"borderColor,omitempty"`
	BorderSkipped   string `json:"borderSkipped,omitempty"`
}

type OptionLayout

type OptionLayout struct {
	Padding struct {
		Left   int `json:"left,omitempty"`
		Right  int `json:"right,omitempty"`
		Top    int `json:"top,omitempty"`
		Bottom int `json:"bottom,omitempty"`
	} `json:"padding,omitempty"`
}

type OptionLegend

type OptionLegend struct {
	Display       bool               `json:"display,omitempty"`
	Position      string             `json:"position,omitempty"`
	Align         string             `json:"align,omitempty"`
	FullWidth     bool               `json:"full_width,omitempty"`
	Reverse       bool               `json:"reverse,omitempty"`
	Rtl           bool               `json:"rtl,omitempty"`
	TextDirection string             `json:"text_direction,omitempty"`
	Labels        *OptionLegendLabel `json:"labels,omitempty"`
}

type OptionLegendLabel

type OptionLegendLabel struct {
	BoxWidth      int    `json:"box_width,omitempty"`
	FontSize      int    `json:"fontSize,omitempty"`
	FontStyle     string `json:"fontStyle,omitempty"`
	FontColor     Color  `json:"fontColor,omitempty"`
	FontFamily    string `json:"fontFamily,omitempty"`
	Padding       int    `json:"padding,omitempty"`
	UsePointStyle bool   `json:"usePointStyle,omitempty"`
}

type OptionTitle

type OptionTitle struct {
	Display    bool   `json:"display,omitempty"`
	Position   string `json:"position,omitempty"`
	FontSize   int    `json:"fontSize,omitempty"`
	FontFamily string `json:"fontFamily,omitempty"`
	FontColor  Color  `json:"fontColor,omitempty"`
	FontStyle  string `json:"fontStyle,omitempty"`
	Padding    int    `json:"padding,omitempty"`
	LineHeight int    `json:"lineHeight,omitempty"`
	Text       string `json:"text,omitempty"`
}

type OptionTooltips

type OptionTooltips struct {
	Enabled            bool   `json:"enabled,omitempty"`
	Mode               string `json:"mode,omitempty"`
	Intersect          bool   `json:"intersect,omitempty"`
	Position           string `json:"position,omitempty"`
	BackgroundColor    Color  `json:"backgroundColor,omitempty"`
	TitleFontFamily    string `json:"titleFontFamily,omitempty"`
	TitleFontSize      int    `json:"titleFontSize,omitempty"`
	TitleFontStyle     string `json:"titleFontStyle,omitempty"`
	TitleFontColor     Color  `json:"titleFontColor,omitempty"`
	TitleAlign         string `json:"titleAlign,omitempty"`
	TitleSpacing       int    `json:"titleSpacing,omitempty"`
	TitleMarginBottom  int    `json:"titleMarginBottom,omitempty"`
	BodyFontFamily     string `json:"bodyFontFamily,omitempty"`
	BodyFontSize       int    `json:"bodyFontSize,omitempty"`
	BodyFontStyle      string `json:"bodyFontStyle,omitempty"`
	BodyFontColor      Color  `json:"bodyFontColor,omitempty"`
	BodyAlign          string `json:"bodyAlign,omitempty"`
	BodySpacing        int    `json:"bodySpacing,omitempty"`
	FooterFontFamily   string `json:"footerFontFamily,omitempty"`
	FooterFontSize     int    `json:"footerFontSize,omitempty"`
	FooterFontStyle    string `json:"footerFontStyle,omitempty"`
	FooterFontColor    Color  `json:"footerFontColor,omitempty"`
	FooterAlign        string `json:"footerAlign,omitempty"`
	FooterSpacing      int    `json:"footerSpacing,omitempty"`
	FooterMarginTop    int    `json:"footerMarginTop,omitempty"`
	XPadding           int    `json:"xPadding,omitempty"`
	YPadding           int    `json:"yPadding,omitempty"`
	CaretPadding       int    `json:"caretPadding,omitempty"`
	CaretSize          int    `json:"caretSize,omitempty"`
	CornerRadius       int    `json:"cornerRadius,omitempty"`
	MultiKeyBackground Color  `json:"multiKeyBackground,omitempty"`
	DisplayColors      bool   `json:"displayColors,omitempty"`
	BorderColor        Color  `json:"borderColor,omitempty"`
	BorderWidth        int    `json:"borderWidth,omitempty"`
	Rtl                bool   `json:"rtl,omitempty"`
	TextDirection      string `json:"textDirection,omitempty"`
}

type Options

type Options struct {
	Animation *OptionAnimation `json:"animation,omitempty"`
	Layout    *OptionLayout    `json:"layout,omitempty"`
	Legend    *OptionLegend    `json:"legend,omitempty"`
	Title     *OptionTitle     `json:"title,omitempty"`
	Tooltips  *OptionTooltips  `json:"tooltips,omitempty"`
	Elements  *OptionElement   `json:"elements,omitempty"`
}

type PieAttributes

type PieAttributes struct {
	Attributes

	DataSets PieDataSets `json:"datasets"`
}

type PieChart

type PieChart struct {
	*Chart

	JsContent PieJsContent
}

func Pie

func Pie() *PieChart

func (*PieChart) AddDataSet

func (l *PieChart) AddDataSet(s string) *PieChart

func (*PieChart) DSBackgroundColor

func (l *PieChart) DSBackgroundColor(backgroundColor []Color) *PieChart

func (*PieChart) DSBorderColor

func (l *PieChart) DSBorderColor(borderColor Color) *PieChart

func (*PieChart) DSBorderWidth

func (l *PieChart) DSBorderWidth(borderWidth float64) *PieChart

func (*PieChart) DSData

func (l *PieChart) DSData(data []float64) *PieChart

func (*PieChart) DSHoverBackgroundColor

func (l *PieChart) DSHoverBackgroundColor(hoverBackgroundColor Color) *PieChart

func (*PieChart) DSHoverBorderColor

func (l *PieChart) DSHoverBorderColor(hoverBorderColor Color) *PieChart

func (*PieChart) DSHoverBorderWidth

func (l *PieChart) DSHoverBorderWidth(hoverBorderWidth float64) *PieChart

func (*PieChart) DSLabel

func (l *PieChart) DSLabel(s string) *PieChart

func (*PieChart) DSType

func (l *PieChart) DSType(t string) *PieChart

func (*PieChart) DSWeight

func (l *PieChart) DSWeight(weight int) *PieChart

func (*PieChart) GetContent

func (l *PieChart) GetContent() template.HTML

func (*PieChart) SetHeight

func (l *PieChart) SetHeight(s int) *PieChart

func (*PieChart) SetID

func (l *PieChart) SetID(s string) *PieChart

func (*PieChart) SetLabels

func (l *PieChart) SetLabels(s []string) *PieChart

func (*PieChart) SetTitle

func (l *PieChart) SetTitle(s template.HTML) *PieChart

type PieDataSet

type PieDataSet struct {
	Label           string    `json:"label"`
	Data            []float64 `json:"data"`
	Type            string    `json:"type,omitempty"`
	BackgroundColor []Color   `json:"backgroundColor,omitempty"`
	BorderColor     Color     `json:"borderColor,omitempty"`

	BorderWidth float64 `json:"borderWidth,omitempty"`
	BorderAlign string  `json:"borderAlign,omitempty"`

	HoverBackgroundColor Color   `json:"hoverBackgroundColor,omitempty"`
	HoverBorderColor     Color   `json:"hoverBorderColor,omitempty"`
	HoverBorderWidth     float64 `json:"hoverBorderWidth,omitempty"`

	Weight int `json:"weight,omitempty"`
}

func (*PieDataSet) SetBackgroundColor

func (l *PieDataSet) SetBackgroundColor(backgroundColor []Color) *PieDataSet

func (*PieDataSet) SetBorderAlign

func (l *PieDataSet) SetBorderAlign(align string) *PieDataSet

func (*PieDataSet) SetBorderColor

func (l *PieDataSet) SetBorderColor(borderColor Color) *PieDataSet

func (*PieDataSet) SetBorderWidth

func (l *PieDataSet) SetBorderWidth(borderWidth float64) *PieDataSet

func (*PieDataSet) SetData

func (l *PieDataSet) SetData(data []float64) *PieDataSet

func (*PieDataSet) SetHoverBackgroundColor

func (l *PieDataSet) SetHoverBackgroundColor(hoverBackgroundColor Color) *PieDataSet

func (*PieDataSet) SetHoverBorderColor

func (l *PieDataSet) SetHoverBorderColor(hoverBorderColor Color) *PieDataSet

func (*PieDataSet) SetHoverBorderWidth

func (l *PieDataSet) SetHoverBorderWidth(hoverBorderWidth float64) *PieDataSet

func (*PieDataSet) SetLabel

func (l *PieDataSet) SetLabel(label string) *PieDataSet

func (*PieDataSet) SetType

func (l *PieDataSet) SetType(t string) *PieDataSet

func (*PieDataSet) SetWeight

func (l *PieDataSet) SetWeight(weight int) *PieDataSet

type PieDataSets

type PieDataSets []*PieDataSet

func (PieDataSets) Add

func (l PieDataSets) Add(ds *PieDataSet) PieDataSets

type PieJsContent

type PieJsContent struct {
	JsContent

	Data PieAttributes `json:"data"`
}

Jump to

Keyboard shortcuts

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