Documentation
¶
Index ¶
- Variables
- func RemoveIndexFromSlice[K comparable](index int, slice []K) []K
- func ShiftSlice[K comparable](newData K, slice []K) []K
- type LineChartDatapoint
- type LineChartSkn
- func (w *LineChartSkn) ApplyDataPoint(seriesName string, newDataPoint LineChartDatapoint)
- func (w *LineChartSkn) ApplyDataSeries(seriesName string, newSeries []LineChartDatapoint) error
- func (w *LineChartSkn) CreateRenderer() fyne.WidgetRenderer
- func (w *LineChartSkn) GetBottomCenteredLabel() string
- func (w *LineChartSkn) GetBottomLeftLabel() string
- func (w *LineChartSkn) GetBottomRightLabel() string
- func (w *LineChartSkn) GetMiddleLeftLabel() string
- func (w *LineChartSkn) GetMiddleRightLabel() string
- func (w *LineChartSkn) GetTitle() string
- func (w *LineChartSkn) GetTopLeftLabel() string
- func (w *LineChartSkn) GetTopRightLabel() string
- func (w *LineChartSkn) IsDataPointMarkersEnabled() bool
- func (w *LineChartSkn) IsHorizGridLinesEnabled() bool
- func (w *LineChartSkn) IsMousePointDisplayEnabled() bool
- func (w *LineChartSkn) IsVertGridLinesEnabled() bool
- func (w *LineChartSkn) MouseDown(me *desktop.MouseEvent)
- func (w *LineChartSkn) MouseIn(*desktop.MouseEvent)
- func (w *LineChartSkn) MouseMoved(me *desktop.MouseEvent)
- func (w *LineChartSkn) MouseOut()
- func (w *LineChartSkn) MouseUp(*desktop.MouseEvent)
- func (w *LineChartSkn) SetBottomCenteredLabel(newValue string)
- func (w *LineChartSkn) SetBottomLeftLabel(newValue string)
- func (w *LineChartSkn) SetBottomRightLabel(newValue string)
- func (w *LineChartSkn) SetDataPointMarkers(enable bool)
- func (w *LineChartSkn) SetHorizGridLines(enable bool)
- func (w *LineChartSkn) SetMiddleLeftLabel(newValue string)
- func (w *LineChartSkn) SetMiddleRightLabel(newValue string)
- func (w *LineChartSkn) SetMinSize(s fyne.Size)
- func (w *LineChartSkn) SetMousePointDisplay(enable bool)
- func (w *LineChartSkn) SetTitle(newValue string)
- func (w *LineChartSkn) SetTopLeftLabel(newValue string)
- func (w *LineChartSkn) SetTopRightLabel(newValue string)
- func (w *LineChartSkn) SetVertGridLines(enable bool)
- type SknLineChart
Constants ¶
This section is empty.
Variables ¶
var (
DebugLoggingEnabled = false
)
Functions ¶
func RemoveIndexFromSlice ¶
func RemoveIndexFromSlice[K comparable](index int, slice []K) []K
RemoveIndexFromSlice remove the given index from any type of slice
func ShiftSlice ¶
func ShiftSlice[K comparable](newData K, slice []K) []K
ShiftSlice drops index 0 and append newData to any type of slice
Types ¶
type LineChartDatapoint ¶ added in v1.2.5
type LineChartDatapoint interface { Value() float32 SetValue(y float32) ColorName() string SetColorName(n string) Timestamp() string SetTimestamp(t string) // MarkerPosition internal use only: current data point marker location MarkerPosition() (*fyne.Position, *fyne.Position) // SetMarkerPosition internal use only: sace location of where data point marker is located SetMarkerPosition(top *fyne.Position, bottom *fyne.Position) }
LineChartDatapoint data container interface for SknLineChart
func NewLineChartDatapoint ¶ added in v1.2.5
func NewLineChartDatapoint(value float32, colorName, timestamp string) LineChartDatapoint
type LineChartSkn ¶
type LineChartSkn struct { widget.BaseWidget // Inherit from BaseWidget desktop.Hoverable // support mouse tracking desktop.Mouseable // Mouse Clicks DataPointXLimit int EnableDataPointMarkers bool EnableHorizGridLines bool EnableVertGridLines bool EnableMousePointDisplay bool TopLeftLabel string // The text to display in the widget TopCenteredLabel string TopRightLabel string LeftMiddleLabel string RightMiddleLabel string BottomLeftLabel string BottomCenteredLabel string BottomRightLabel string // Private: Exposed for Testing; DO NOT USE ObjectsCache []fyne.CanvasObject // contains filtered or unexported fields }
LineChartSkn widget to display multiple series of data points which will roll off older point beyond the 120 point limit.
func NewLineChart ¶
func NewLineChart(topTitle, bottomTitle string, dataPoints *map[string][]LineChartDatapoint) (*LineChartSkn, error)
NewLineChart Create the Line Chart be careful not to exceed the series data point limit, which defaults to 120
can return a valid chart object and an error object; errors really should be handled and are caused by data points exceeding the container limit of 120; they will be truncated
func (*LineChartSkn) ApplyDataPoint ¶
func (w *LineChartSkn) ApplyDataPoint(seriesName string, newDataPoint LineChartDatapoint)
ApplyDataPoint adds a new datapoint to an existing series will shift out the oldest point if containers limit is exceeded
func (*LineChartSkn) ApplyDataSeries ¶
func (w *LineChartSkn) ApplyDataSeries(seriesName string, newSeries []LineChartDatapoint) error
ApplyDataSeries adds a new series of data to existing chart set. throws error if new series exceeds containers point limit
func (*LineChartSkn) CreateRenderer ¶
func (w *LineChartSkn) CreateRenderer() fyne.WidgetRenderer
CreateRenderer Create the renderer. This is called by the fyne application
func (*LineChartSkn) GetBottomCenteredLabel ¶
func (w *LineChartSkn) GetBottomCenteredLabel() string
GetBottomCenteredLabel returns text of bottom center label
func (*LineChartSkn) GetBottomLeftLabel ¶
func (w *LineChartSkn) GetBottomLeftLabel() string
GetBottomLeftLabel returns text of bottom left label
func (*LineChartSkn) GetBottomRightLabel ¶
func (w *LineChartSkn) GetBottomRightLabel() string
GetBottomRightLabel returns text of bottom right label
func (*LineChartSkn) GetMiddleLeftLabel ¶
func (w *LineChartSkn) GetMiddleLeftLabel() string
GetMiddleLeftLabel returns text of middle left label
func (*LineChartSkn) GetMiddleRightLabel ¶
func (w *LineChartSkn) GetMiddleRightLabel() string
GetMiddleRightLabel returns text of middle right label
func (*LineChartSkn) GetTitle ¶
func (w *LineChartSkn) GetTitle() string
GetTitle return text of the chart's title from top center
func (*LineChartSkn) GetTopLeftLabel ¶
func (w *LineChartSkn) GetTopLeftLabel() string
GetTopLeftLabel return text from top left label
func (*LineChartSkn) GetTopRightLabel ¶
func (w *LineChartSkn) GetTopRightLabel() string
GetTopRightLabel returns text of top right label
func (*LineChartSkn) IsDataPointMarkersEnabled ¶
func (w *LineChartSkn) IsDataPointMarkersEnabled() bool
IsDataPointMarkersEnabled returns state of chart's use of data point markers on series data
func (*LineChartSkn) IsHorizGridLinesEnabled ¶
func (w *LineChartSkn) IsHorizGridLinesEnabled() bool
IsHorizGridLinesEnabled returns state of chart's display of horizontal grid line
func (*LineChartSkn) IsMousePointDisplayEnabled ¶
func (w *LineChartSkn) IsMousePointDisplayEnabled() bool
IsMousePointDisplayEnabled return state of mouse popups when hovered over a chart datapoint
func (*LineChartSkn) IsVertGridLinesEnabled ¶
func (w *LineChartSkn) IsVertGridLinesEnabled() bool
IsVertGridLinesEnabled returns state of chart's display of vertical grid line
func (*LineChartSkn) MouseDown ¶ added in v1.2.5
func (w *LineChartSkn) MouseDown(me *desktop.MouseEvent)
MouseDown btn.2 toggles markers, btn.1 toggles mouse point display
func (*LineChartSkn) MouseIn ¶
func (w *LineChartSkn) MouseIn(*desktop.MouseEvent)
MouseIn unused interface method
func (*LineChartSkn) MouseMoved ¶
func (w *LineChartSkn) MouseMoved(me *desktop.MouseEvent)
MouseMoved interface method to discover which data point is under mouse
func (*LineChartSkn) MouseOut ¶
func (w *LineChartSkn) MouseOut()
MouseOut disable display of mouse data point display
func (*LineChartSkn) MouseUp ¶ added in v1.2.5
func (w *LineChartSkn) MouseUp(*desktop.MouseEvent)
MouseUp unused interface method
func (*LineChartSkn) SetBottomCenteredLabel ¶
func (w *LineChartSkn) SetBottomCenteredLabel(newValue string)
SetBottomCenteredLabel changes displayed text, empty disables display
func (*LineChartSkn) SetBottomLeftLabel ¶
func (w *LineChartSkn) SetBottomLeftLabel(newValue string)
SetBottomLeftLabel changes displayed text, empty disables display
func (*LineChartSkn) SetBottomRightLabel ¶
func (w *LineChartSkn) SetBottomRightLabel(newValue string)
SetBottomRightLabel changes displayed text, empty disables display
func (*LineChartSkn) SetDataPointMarkers ¶
func (w *LineChartSkn) SetDataPointMarkers(enable bool)
SetDataPointMarkers enables data point markers on display series points
func (*LineChartSkn) SetHorizGridLines ¶
func (w *LineChartSkn) SetHorizGridLines(enable bool)
SetHorizGridLines enables chart horizontal grid lines
func (*LineChartSkn) SetMiddleLeftLabel ¶
func (w *LineChartSkn) SetMiddleLeftLabel(newValue string)
SetMiddleLeftLabel changes displayed text, empty disables display
func (*LineChartSkn) SetMiddleRightLabel ¶
func (w *LineChartSkn) SetMiddleRightLabel(newValue string)
SetMiddleRightLabel changes displayed text, empty disables display
func (*LineChartSkn) SetMinSize ¶
func (w *LineChartSkn) SetMinSize(s fyne.Size)
SetMinSize override the default min size of chart
func (*LineChartSkn) SetMousePointDisplay ¶
func (w *LineChartSkn) SetMousePointDisplay(enable bool)
SetMousePointDisplay true/false, enables data point display under mouse pointer
func (*LineChartSkn) SetTitle ¶
func (w *LineChartSkn) SetTitle(newValue string)
SetTitle sets text to be display on chart at top center
func (*LineChartSkn) SetTopLeftLabel ¶
func (w *LineChartSkn) SetTopLeftLabel(newValue string)
SetTopLeftLabel sets text to be display on chart at top left
func (*LineChartSkn) SetTopRightLabel ¶
func (w *LineChartSkn) SetTopRightLabel(newValue string)
SetTopRightLabel changes displayed text, empty disables display
func (*LineChartSkn) SetVertGridLines ¶
func (w *LineChartSkn) SetVertGridLines(enable bool)
SetVertGridLines enables chart vertical grid lines
type SknLineChart ¶ added in v1.3.0
type SknLineChart interface { // Chart Attributes IsDataPointMarkersEnabled() bool // mouse button 2 toggles IsHorizGridLinesEnabled() bool IsVertGridLinesEnabled() bool IsMousePointDisplayEnabled() bool // hoverable and mouse button one SetDataPointMarkers(enable bool) SetHorizGridLines(enable bool) SetVertGridLines(enable bool) SetMousePointDisplay(enable bool) // Info labels GetTopLeftLabel() string GetTitle() string GetTopRightLabel() string // Scale legend GetMiddleLeftLabel() string GetMiddleRightLabel() string // Info Labels GetBottomLeftLabel() string GetBottomCenteredLabel() string GetBottomRightLabel() string SetTopLeftLabel(newValue string) SetTitle(newValue string) SetTopRightLabel(newValue string) SetMiddleLeftLabel(newValue string) SetMiddleRightLabel(newValue string) SetBottomLeftLabel(newValue string) SetBottomCenteredLabel(newValue string) SetBottomRightLabel(newValue string) // ApplyDataSeries add a whole data series at once // expect this will rarely be used, since loading more than 120 point will raise error ApplyDataSeries(seriesName string, newSeries []LineChartDatapoint) error // ApplyDataPoint primary method to add another data point to any series // If series has more than 120 points, point 0 will be rolled out making room for this one ApplyDataPoint(seriesName string, newDataPoint LineChartDatapoint) }
SknLineChart feature list