Documentation
¶
Index ¶
- func Init()
- type Chart
- type Clip
- type Config
- type ConfigHandle
- func (ch ConfigHandle) AppendFloats(label string, data []float64)
- func (ch ConfigHandle) ClearChartData()
- func (ch ConfigHandle) Datasets() []DatasetHandle
- func (ch ConfigHandle) SetAnimation(enableAnimation bool)
- func (ch ConfigHandle) SetPointRadius(pointRadius float64)
- func (ch ConfigHandle) SetShowLine(enableShowLine bool)
- func (ch ConfigHandle) SetSpanGaps(enableSpanGaps bool)
- type Data
- type Dataset
- type DatasetHandle
- func (dh DatasetHandle) AppendFloat(f float64)
- func (dh DatasetHandle) SetAnimation(enableAnimation bool)
- func (dh DatasetHandle) SetBackgroundColor(c color.Color)
- func (dh DatasetHandle) SetBorderColor(c color.Color)
- func (dh DatasetHandle) SetColor(c color.Color)
- func (dh DatasetHandle) SetData(ydata []float64)
- func (dh DatasetHandle) SetHidden(hidden bool)
- func (dh DatasetHandle) SetPointRadius(pointRadius float64)
- func (dh DatasetHandle) SetSpanGaps(enableSpanGaps bool)
- type LabelledXYer
- type LinePlot
- type Options
- type Plugin
- type PluginTitle
- type RealtimeLinePlot
- type XYer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chart ¶
func (Chart) Decimate ¶
Decimate keeps every mod'th point of all datasets. This can be used to improve rendering performance on graphs with many points. Higher mod values yield more aggressive decimation, with mod=2 being the least aggressive possible discarding 1 of every two sample points. mod must be greater than 1. Example: mod=10 discards 9 of every 10 points.
func (Chart) GetConfig ¶
func (c Chart) GetConfig() ConfigHandle
func (Chart) IsHiddenMeta ¶
IsHiddenMeta is null until user clicks on legend, then it is set to true if user has hidden dataset, or false if dataset is visible.
type ConfigHandle ¶
func (ConfigHandle) AppendFloats ¶
func (ch ConfigHandle) AppendFloats(label string, data []float64)
func (ConfigHandle) ClearChartData ¶
func (ch ConfigHandle) ClearChartData()
ClearChartData destroys dataset `data` fields and config data.labels and sets them to empty array
func (ConfigHandle) Datasets ¶
func (ch ConfigHandle) Datasets() []DatasetHandle
func (ConfigHandle) SetAnimation ¶
func (ch ConfigHandle) SetAnimation(enableAnimation bool)
SetAnimation enables or disables animations for the chart. Usually used for performance reasons or when animations are distracting.
func (ConfigHandle) SetPointRadius ¶
func (ch ConfigHandle) SetPointRadius(pointRadius float64)
SetPointRadius sets the point radius of the chart. Set to zero for performance gains.
func (ConfigHandle) SetShowLine ¶
func (ch ConfigHandle) SetShowLine(enableShowLine bool)
SetShowLine enables/disables line drawing for the chart.
func (ConfigHandle) SetSpanGaps ¶
func (ch ConfigHandle) SetSpanGaps(enableSpanGaps bool)
SetSpanGaps If you have a lot of data points, it can be more performant to enable spanGaps. This disables segmentation of the line, which can be an unneeded step.
type Dataset ¶
type Dataset struct {
Data js.Value `js:"data"`
BackgroundColor js.Value `js:"backgroundColor"`
BorderColor js.Value `js:"borderColor"`
Color js.Value `js:"color"`
// The label for the dataset which appears in the legend and tooltips.
Label string `js:"label"`
// How to clip relative to chartArea. Positive value allows overflow, negative value clips that many pixels inside chartArea. 0 = clip at chartArea.
// Clipping can also be configured per side: clip: {left: 5, top: false, right: -2, bottom: 0}
Clip Clip `js:"clip"`
// The drawing order of dataset. Also affects order for stacking, tooltip and legend.
Order int `js:"order"`
// The ID of the group to which this dataset belongs to (when stacked, each group will be a separate stack). Defaults to dataset `type`.
Stack string `js:"stack"`
Parsing bool `js:"parsing"`
Hidden bool `js:"hidden"`
SpanGaps bool `js:"spanGaps"`
}
type DatasetHandle ¶
func (DatasetHandle) AppendFloat ¶
func (dh DatasetHandle) AppendFloat(f float64)
func (DatasetHandle) SetAnimation ¶
func (dh DatasetHandle) SetAnimation(enableAnimation bool)
SetAnimation enables or disables animations for the dataset. Usually used for performance reasons or when animations are distracting.
func (DatasetHandle) SetBackgroundColor ¶
func (dh DatasetHandle) SetBackgroundColor(c color.Color)
func (DatasetHandle) SetBorderColor ¶
func (dh DatasetHandle) SetBorderColor(c color.Color)
SetBorderColor sets outline color of the chart data.
func (DatasetHandle) SetColor ¶
func (dh DatasetHandle) SetColor(c color.Color)
SetColor sets font color
func (DatasetHandle) SetData ¶
func (dh DatasetHandle) SetData(ydata []float64)
func (DatasetHandle) SetHidden ¶
func (dh DatasetHandle) SetHidden(hidden bool)
SetHidden hides/shows dataset data in chart.
func (DatasetHandle) SetPointRadius ¶
func (dh DatasetHandle) SetPointRadius(pointRadius float64)
SetPointRadius sets the point radius of dataset. Set to zero for performance gains.
func (DatasetHandle) SetSpanGaps ¶
func (dh DatasetHandle) SetSpanGaps(enableSpanGaps bool)
SetSpanGaps if the dataset has a lot of data points, it can be more performant to enable spanGaps. This disables segmentation of the line, which can be an unneeded step.
type LabelledXYer ¶
func LabelXYer ¶
func LabelXYer(label string, xyer XYer) LabelledXYer
type Options ¶
type Options struct {
Animation bool `js:"animation"`
Scales js.Value `js:"scales"`
Plugins js.Value `js:"plugins"`
}
func (*Options) AddPlugins ¶
type PluginTitle ¶
type RealtimeLinePlot ¶
type RealtimeLinePlot struct {
Chart
}
func NewRealtimeLinePlot ¶
func NewRealtimeLinePlot(ctx js.Value, xLabels []string, datasets []Dataset) RealtimeLinePlot
func (RealtimeLinePlot) AddData ¶
func (r RealtimeLinePlot) AddData(xLabel string, data []float64)
Call Update after calling AddData to update graph. data must be of length
func (RealtimeLinePlot) ClearChartData ¶
func (r RealtimeLinePlot) ClearChartData()
ClearChartData removes all data from chart.