feat: add tick generation properties and legendColorizeRows
parent
bfe32bf10e
commit
9dd37a1d1b
76
dashboard.go
76
dashboard.go
|
@ -716,12 +716,20 @@ type LinePlusSingleStatProperties struct {
|
|||
DecimalPlaces DecimalPlaces `json:"decimalPlaces"`
|
||||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
ShadeBelow bool `json:"shadeBelow"`
|
||||
Position string `json:"position"`
|
||||
TimeFormat string `json:"timeFormat"`
|
||||
HoverDimension string `json:"hoverDimension"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
@ -736,12 +744,20 @@ type XYViewProperties struct {
|
|||
ViewColors []ViewColor `json:"colors"`
|
||||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
ShadeBelow bool `json:"shadeBelow"`
|
||||
Position string `json:"position"`
|
||||
TimeFormat string `json:"timeFormat"`
|
||||
HoverDimension string `json:"hoverDimension"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
@ -758,11 +774,19 @@ type BandViewProperties struct {
|
|||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
TimeFormat string `json:"timeFormat"`
|
||||
HoverDimension string `json:"hoverDimension"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
UpperColumn string `json:"upperColumn"`
|
||||
MainColumn string `json:"mainColumn"`
|
||||
LowerColumn string `json:"lowerColumn"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
@ -773,24 +797,30 @@ type CheckViewProperties struct {
|
|||
CheckID string `json:"checkID"`
|
||||
Queries []DashboardQuery `json:"queries"`
|
||||
ViewColors []string `json:"colors"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
||||
// SingleStatViewProperties represents options for single stat view in Chronograf
|
||||
type SingleStatViewProperties struct {
|
||||
Type string `json:"type"`
|
||||
Queries []DashboardQuery `json:"queries"`
|
||||
Prefix string `json:"prefix"`
|
||||
TickPrefix string `json:"tickPrefix"`
|
||||
Suffix string `json:"suffix"`
|
||||
TickSuffix string `json:"tickSuffix"`
|
||||
ViewColors []ViewColor `json:"colors"`
|
||||
DecimalPlaces DecimalPlaces `json:"decimalPlaces"`
|
||||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
Type string `json:"type"`
|
||||
Queries []DashboardQuery `json:"queries"`
|
||||
Prefix string `json:"prefix"`
|
||||
TickPrefix string `json:"tickPrefix"`
|
||||
Suffix string `json:"suffix"`
|
||||
TickSuffix string `json:"tickSuffix"`
|
||||
ViewColors []ViewColor `json:"colors"`
|
||||
DecimalPlaces DecimalPlaces `json:"decimalPlaces"`
|
||||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
}
|
||||
|
||||
// HistogramViewProperties represents options for histogram view in Chronograf
|
||||
|
@ -806,6 +836,7 @@ type HistogramViewProperties struct {
|
|||
BinCount int `json:"binCount"`
|
||||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
@ -816,8 +847,15 @@ type HeatmapViewProperties struct {
|
|||
Queries []DashboardQuery `json:"queries"`
|
||||
ViewColors []string `json:"colors"`
|
||||
BinSize int32 `json:"binSize"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
XDomain []float64 `json:"xDomain,omitempty"`
|
||||
YDomain []float64 `json:"yDomain,omitempty"`
|
||||
XAxisLabel string `json:"xAxisLabel"`
|
||||
|
@ -829,6 +867,7 @@ type HeatmapViewProperties struct {
|
|||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
TimeFormat string `json:"timeFormat"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
@ -840,8 +879,15 @@ type ScatterViewProperties struct {
|
|||
ViewColors []string `json:"colors"`
|
||||
FillColumns []string `json:"fillColumns"`
|
||||
SymbolColumns []string `json:"symbolColumns"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
XDomain []float64 `json:"xDomain,omitempty"`
|
||||
YDomain []float64 `json:"yDomain,omitempty"`
|
||||
XAxisLabel string `json:"xAxisLabel"`
|
||||
|
@ -853,6 +899,7 @@ type ScatterViewProperties struct {
|
|||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
TimeFormat string `json:"timeFormat"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
@ -863,7 +910,11 @@ type MosaicViewProperties struct {
|
|||
Queries []DashboardQuery `json:"queries"`
|
||||
ViewColors []string `json:"colors"`
|
||||
FillColumns []string `json:"fillColumns"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YSeriesColumns []string `json:"ySeriesColumns"`
|
||||
XDomain []float64 `json:"xDomain,omitempty"`
|
||||
YDomain []float64 `json:"yDomain,omitempty"`
|
||||
|
@ -876,6 +927,7 @@ type MosaicViewProperties struct {
|
|||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
TimeFormat string `json:"timeFormat"`
|
||||
LegendColorizeRows bool `json:"legendColorizeRows"`
|
||||
LegendOpacity float64 `json:"legendOpacity"`
|
||||
LegendOrientationThreshold int `json:"legendOrientationThreshold"`
|
||||
}
|
||||
|
|
|
@ -48,12 +48,20 @@ func TestView_MarshalJSON(t *testing.T) {
|
|||
"geom": "",
|
||||
"note": "",
|
||||
"showNoteWhenEmpty": false,
|
||||
"xColumn": "",
|
||||
"yColumn": "",
|
||||
"generateAxisTicks": false,
|
||||
"xColumn": "",
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "",
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
"shadeBelow": false,
|
||||
"position": "",
|
||||
"timeFormat": "",
|
||||
"hoverDimension": "",
|
||||
"legendColorizeRows": false,
|
||||
"legendOpacity": 0,
|
||||
"legendOrientationThreshold": 0
|
||||
}
|
||||
|
|
|
@ -464,8 +464,16 @@ func TestService_handleGetDashboard(t *testing.T) {
|
|||
"showNoteWhenEmpty": false,
|
||||
"timeFormat": "",
|
||||
"type": "xy",
|
||||
"generateAxisTicks": false,
|
||||
"xColumn": "",
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "",
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
"legendColorizeRows": false,
|
||||
"legendOpacity": 0,
|
||||
"legendOrientationThreshold": 0
|
||||
},
|
||||
|
@ -983,9 +991,17 @@ func TestService_handlePostDashboard(t *testing.T) {
|
|||
"showNoteWhenEmpty": false,
|
||||
"timeFormat": "",
|
||||
"type": "",
|
||||
"generateAxisTicks": false,
|
||||
"xColumn": "",
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "",
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
"type": "xy",
|
||||
"legendColorizeRows": false,
|
||||
"legendOpacity": 0,
|
||||
"legendOrientationThreshold": 0
|
||||
},
|
||||
|
|
121
http/swagger.yml
121
http/swagger.yml
|
@ -8976,10 +8976,28 @@ components:
|
|||
$ref: "#/components/schemas/Axes"
|
||||
legend:
|
||||
$ref: "#/components/schemas/Legend"
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
type: number
|
||||
format: float
|
||||
xTickStep:
|
||||
type: number
|
||||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
type: number
|
||||
format: float
|
||||
yTickStep:
|
||||
type: number
|
||||
format: float
|
||||
shadeBelow:
|
||||
type: boolean
|
||||
hoverDimension:
|
||||
|
@ -8990,6 +9008,8 @@ components:
|
|||
enum: [overlaid, stacked]
|
||||
geom:
|
||||
$ref: "#/components/schemas/XYGeom"
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -9037,10 +9057,28 @@ components:
|
|||
$ref: "#/components/schemas/Axes"
|
||||
legend:
|
||||
$ref: "#/components/schemas/Legend"
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
type: number
|
||||
format: float
|
||||
xTickStep:
|
||||
type: number
|
||||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
type: number
|
||||
format: float
|
||||
yTickStep:
|
||||
type: number
|
||||
format: float
|
||||
upperColumn:
|
||||
type: string
|
||||
mainColumn:
|
||||
|
@ -9052,6 +9090,8 @@ components:
|
|||
enum: [auto, x, y, xy]
|
||||
geom:
|
||||
$ref: "#/components/schemas/XYGeom"
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -9099,10 +9139,28 @@ components:
|
|||
$ref: "#/components/schemas/Axes"
|
||||
legend:
|
||||
$ref: "#/components/schemas/Legend"
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
type: number
|
||||
format: float
|
||||
xTickStep:
|
||||
type: number
|
||||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
type: number
|
||||
format: float
|
||||
yTickStep:
|
||||
type: number
|
||||
format: float
|
||||
shadeBelow:
|
||||
type: boolean
|
||||
hoverDimension:
|
||||
|
@ -9117,6 +9175,8 @@ components:
|
|||
type: string
|
||||
decimalPlaces:
|
||||
$ref: "#/components/schemas/DecimalPlaces"
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -9165,8 +9225,18 @@ components:
|
|||
showNoteWhenEmpty:
|
||||
description: If true, will display note when empty
|
||||
type: boolean
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
type: number
|
||||
format: float
|
||||
xTickStep:
|
||||
type: number
|
||||
format: float
|
||||
ySeriesColumns:
|
||||
type: array
|
||||
items:
|
||||
|
@ -9197,6 +9267,8 @@ components:
|
|||
type: string
|
||||
ySuffix:
|
||||
type: string
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -9246,10 +9318,28 @@ components:
|
|||
showNoteWhenEmpty:
|
||||
description: If true, will display note when empty
|
||||
type: boolean
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
type: number
|
||||
format: float
|
||||
xTickStep:
|
||||
type: number
|
||||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
type: number
|
||||
format: float
|
||||
yTickStep:
|
||||
type: number
|
||||
format: float
|
||||
fillColumns:
|
||||
type: array
|
||||
items:
|
||||
|
@ -9280,6 +9370,8 @@ components:
|
|||
type: string
|
||||
ySuffix:
|
||||
type: string
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -9328,10 +9420,28 @@ components:
|
|||
showNoteWhenEmpty:
|
||||
description: If true, will display note when empty
|
||||
type: boolean
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
type: number
|
||||
format: float
|
||||
xTickStep:
|
||||
type: number
|
||||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
type: number
|
||||
format: float
|
||||
yTickStep:
|
||||
type: number
|
||||
format: float
|
||||
xDomain:
|
||||
type: array
|
||||
items:
|
||||
|
@ -9356,6 +9466,8 @@ components:
|
|||
type: string
|
||||
binSize:
|
||||
type: number
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -9409,11 +9521,6 @@ components:
|
|||
$ref: "#/components/schemas/Legend"
|
||||
decimalPlaces:
|
||||
$ref: "#/components/schemas/DecimalPlaces"
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
legendOrientationThreshold:
|
||||
type: integer
|
||||
HistogramViewProperties:
|
||||
type: object
|
||||
required:
|
||||
|
@ -9468,6 +9575,8 @@ components:
|
|||
enum: [overlaid, stacked]
|
||||
binCount:
|
||||
type: integer
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
@ -9635,6 +9744,8 @@ components:
|
|||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/DashboardColor"
|
||||
legendColorizeRows:
|
||||
type: boolean
|
||||
legendOpacity:
|
||||
type: number
|
||||
format: float
|
||||
|
|
|
@ -753,8 +753,15 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.Kind = chartKindHeatMap
|
||||
ch.Queries = convertQueries(p.Queries)
|
||||
ch.Colors = stringsToColors(p.ViewColors)
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
ch.Axes = []axis{
|
||||
{Label: p.XAxisLabel, Prefix: p.XPrefix, Suffix: p.XSuffix, Name: "x", Domain: p.XDomain},
|
||||
{Label: p.YAxisLabel, Prefix: p.YPrefix, Suffix: p.YSuffix, Name: "y", Domain: p.YDomain},
|
||||
|
@ -762,6 +769,7 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.Note = p.Note
|
||||
ch.NoteOnEmpty = p.ShowNoteWhenEmpty
|
||||
ch.BinSize = int(p.BinSize)
|
||||
ch.LegendColorizeRows = p.LegendColorizeRows
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
case influxdb.HistogramViewProperties:
|
||||
|
@ -775,6 +783,7 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.NoteOnEmpty = p.ShowNoteWhenEmpty
|
||||
ch.BinCount = p.BinCount
|
||||
ch.Position = p.Position
|
||||
ch.LegendColorizeRows = p.LegendColorizeRows
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
case influxdb.MarkdownViewProperties:
|
||||
|
@ -787,9 +796,17 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.Axes = convertAxes(p.Axes)
|
||||
ch.Shade = p.ShadeBelow
|
||||
ch.HoverDimension = p.HoverDimension
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
ch.Position = p.Position
|
||||
ch.LegendColorizeRows = p.LegendColorizeRows
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
case influxdb.SingleStatViewProperties:
|
||||
|
@ -797,13 +814,15 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
setNoteFixes(p.Note, p.ShowNoteWhenEmpty, p.Prefix, p.Suffix)
|
||||
ch.TickPrefix = p.TickPrefix
|
||||
ch.TickSuffix = p.TickSuffix
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
case influxdb.MosaicViewProperties:
|
||||
ch.Kind = chartKindMosaic
|
||||
ch.Queries = convertQueries(p.Queries)
|
||||
ch.Colors = stringsToColors(p.ViewColors)
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YSeriesColumns = p.YSeriesColumns
|
||||
ch.Axes = []axis{
|
||||
{Label: p.XAxisLabel, Prefix: p.XPrefix, Suffix: p.XSuffix, Name: "x", Domain: p.XDomain},
|
||||
|
@ -811,20 +830,29 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
}
|
||||
ch.Note = p.Note
|
||||
ch.NoteOnEmpty = p.ShowNoteWhenEmpty
|
||||
ch.LegendColorizeRows = p.LegendColorizeRows
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
case influxdb.ScatterViewProperties:
|
||||
ch.Kind = chartKindScatter
|
||||
ch.Queries = convertQueries(p.Queries)
|
||||
ch.Colors = stringsToColors(p.ViewColors)
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
ch.Axes = []axis{
|
||||
{Label: p.XAxisLabel, Prefix: p.XPrefix, Suffix: p.XSuffix, Name: "x", Domain: p.XDomain},
|
||||
{Label: p.YAxisLabel, Prefix: p.YPrefix, Suffix: p.YSuffix, Name: "y", Domain: p.YDomain},
|
||||
}
|
||||
ch.Note = p.Note
|
||||
ch.NoteOnEmpty = p.ShowNoteWhenEmpty
|
||||
ch.LegendColorizeRows = p.LegendColorizeRows
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
case influxdb.TableViewProperties:
|
||||
|
@ -851,11 +879,19 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.Axes = convertAxes(p.Axes)
|
||||
ch.Geom = p.Geom
|
||||
ch.HoverDimension = p.HoverDimension
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
ch.UpperColumn = p.UpperColumn
|
||||
ch.MainColumn = p.MainColumn
|
||||
ch.LowerColumn = p.LowerColumn
|
||||
ch.LegendColorizeRows = p.LegendColorizeRows
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
case influxdb.XYViewProperties:
|
||||
|
@ -866,9 +902,17 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.Geom = p.Geom
|
||||
ch.Shade = p.ShadeBelow
|
||||
ch.HoverDimension = p.HoverDimension
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
ch.Position = p.Position
|
||||
ch.LegendColorizeRows = p.LegendColorizeRows
|
||||
ch.LegendOpacity = float64(p.LegendOpacity)
|
||||
ch.LegendOrientationThreshold = int(p.LegendOrientationThreshold)
|
||||
}
|
||||
|
@ -955,8 +999,10 @@ func convertChartToResource(ch chart) Resource {
|
|||
}
|
||||
|
||||
assignNonZeroBools(r, map[string]bool{
|
||||
fieldChartNoteOnEmpty: ch.NoteOnEmpty,
|
||||
fieldChartShade: ch.Shade,
|
||||
fieldChartNoteOnEmpty: ch.NoteOnEmpty,
|
||||
fieldChartShade: ch.Shade,
|
||||
fieldChartGenerateAxisTicks: ch.GenerateAxisTicks,
|
||||
fieldChartLegendColorizeRows: ch.LegendColorizeRows,
|
||||
})
|
||||
|
||||
assignNonZeroStrings(r, map[string]string{
|
||||
|
@ -975,7 +1021,9 @@ func convertChartToResource(ch chart) Resource {
|
|||
|
||||
assignNonZeroInts(r, map[string]int{
|
||||
fieldChartXPos: ch.XPos,
|
||||
fieldChartXTotalTicks: ch.XTotalTicks,
|
||||
fieldChartYPos: ch.YPos,
|
||||
fieldChartYTotalTicks: ch.YTotalTicks,
|
||||
fieldChartBinCount: ch.BinCount,
|
||||
fieldChartBinSize: ch.BinSize,
|
||||
fieldChartLegendOrientationThreshold: ch.LegendOrientationThreshold,
|
||||
|
@ -983,6 +1031,10 @@ func convertChartToResource(ch chart) Resource {
|
|||
|
||||
assignNonZeroFloats(r, map[string]float64{
|
||||
fieldChartLegendOpacity: ch.LegendOpacity,
|
||||
fieldChartXTickStart: ch.XTickStart,
|
||||
fieldChartXTickStep: ch.XTickStep,
|
||||
fieldChartYTickStart: ch.YTickStart,
|
||||
fieldChartYTickStep: ch.YTickStep,
|
||||
})
|
||||
|
||||
return r
|
||||
|
|
|
@ -1461,8 +1461,15 @@ func (p *Template) parseChart(dashMetaName string, chartIdx int, r Resource) (*c
|
|||
TickSuffix: r.stringShort(fieldChartTickSuffix),
|
||||
TimeFormat: r.stringShort(fieldChartTimeFormat),
|
||||
Width: r.intShort(fieldChartWidth),
|
||||
GenerateAxisTicks: r.boolShort(fieldChartGenerateAxisTicks),
|
||||
XCol: r.stringShort(fieldChartXCol),
|
||||
XTotalTicks: r.intShort(fieldChartXTotalTicks),
|
||||
XTickStart: r.float64Short(fieldChartXTickStart),
|
||||
XTickStep: r.float64Short(fieldChartXTickStep),
|
||||
YCol: r.stringShort(fieldChartYCol),
|
||||
YTotalTicks: r.intShort(fieldChartYTotalTicks),
|
||||
YTickStart: r.float64Short(fieldChartYTickStart),
|
||||
YTickStep: r.float64Short(fieldChartYTickStep),
|
||||
XPos: r.intShort(fieldChartXPos),
|
||||
YPos: r.intShort(fieldChartYPos),
|
||||
FillColumns: r.slcStr(fieldChartFillColumns),
|
||||
|
@ -1470,6 +1477,7 @@ func (p *Template) parseChart(dashMetaName string, chartIdx int, r Resource) (*c
|
|||
UpperColumn: r.stringShort(fieldChartUpperColumn),
|
||||
MainColumn: r.stringShort(fieldChartMainColumn),
|
||||
LowerColumn: r.stringShort(fieldChartLowerColumn),
|
||||
LegendColorizeRows: r.boolShort(fieldChartLegendColorizeRows),
|
||||
LegendOpacity: r.float64Short(fieldChartLegendOpacity),
|
||||
LegendOrientationThreshold: r.intShort(fieldChartLegendOrientationThreshold),
|
||||
}
|
||||
|
|
|
@ -557,10 +557,18 @@ const (
|
|||
fieldChartMainColumn = "mainColumn"
|
||||
fieldChartLowerColumn = "lowerColumn"
|
||||
fieldChartWidth = "width"
|
||||
fieldChartGenerateAxisTicks = "generateAxisTicks"
|
||||
fieldChartXCol = "xCol"
|
||||
fieldChartXTotalTicks = "xTotalTicks"
|
||||
fieldChartXTickStart = "xTickStart"
|
||||
fieldChartXTickStep = "xTickStep"
|
||||
fieldChartXPos = "xPos"
|
||||
fieldChartYCol = "yCol"
|
||||
fieldChartYTotalTicks = "yTotalTicks"
|
||||
fieldChartYTickStart = "yTickStart"
|
||||
fieldChartYTickStep = "yTickStep"
|
||||
fieldChartYPos = "yPos"
|
||||
fieldChartLegendColorizeRows = "legendColorizeRows"
|
||||
fieldChartLegendOpacity = "legendOpacity"
|
||||
fieldChartLegendOrientationThreshold = "legendOrientationThreshold"
|
||||
)
|
||||
|
@ -584,7 +592,11 @@ type chart struct {
|
|||
Axes axes
|
||||
Geom string
|
||||
YSeriesColumns []string
|
||||
GenerateAxisTicks bool
|
||||
XCol, YCol string
|
||||
XTotalTicks, YTotalTicks int
|
||||
XTickStart, YTickStart float64
|
||||
XTickStep, YTickStep float64
|
||||
UpperColumn string
|
||||
MainColumn string
|
||||
LowerColumn string
|
||||
|
@ -597,6 +609,7 @@ type chart struct {
|
|||
FillColumns []string
|
||||
TableOptions tableOptions
|
||||
TimeFormat string
|
||||
LegendColorizeRows bool
|
||||
LegendOpacity float64
|
||||
LegendOrientationThreshold int
|
||||
}
|
||||
|
@ -625,8 +638,15 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.strings(),
|
||||
BinSize: int32(c.BinSize),
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
XDomain: c.Axes.get("x").Domain,
|
||||
YDomain: c.Axes.get("y").Domain,
|
||||
XPrefix: c.Axes.get("x").Prefix,
|
||||
|
@ -638,6 +658,7 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
TimeFormat: c.TimeFormat,
|
||||
LegendColorizeRows: c.LegendColorizeRows,
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
}
|
||||
|
@ -654,6 +675,7 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
BinCount: c.BinCount,
|
||||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
LegendColorizeRows: c.LegendColorizeRows,
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
}
|
||||
|
@ -667,7 +689,11 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Type: influxdb.ViewPropertyTypeMosaic,
|
||||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.strings(),
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YSeriesColumns: c.YSeriesColumns,
|
||||
XDomain: c.Axes.get("x").Domain,
|
||||
YDomain: c.Axes.get("y").Domain,
|
||||
|
@ -680,6 +706,7 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
TimeFormat: c.TimeFormat,
|
||||
LegendColorizeRows: c.LegendColorizeRows,
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
}
|
||||
|
@ -690,8 +717,15 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
ViewColors: c.Colors.influxViewColors(),
|
||||
Legend: c.Legend.influxLegend(),
|
||||
HoverDimension: c.HoverDimension,
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
UpperColumn: c.UpperColumn,
|
||||
MainColumn: c.MainColumn,
|
||||
LowerColumn: c.LowerColumn,
|
||||
|
@ -700,6 +734,7 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
TimeFormat: c.TimeFormat,
|
||||
LegendColorizeRows: c.LegendColorizeRows,
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
}
|
||||
|
@ -708,8 +743,15 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Type: influxdb.ViewPropertyTypeScatter,
|
||||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.strings(),
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
XDomain: c.Axes.get("x").Domain,
|
||||
YDomain: c.Axes.get("y").Domain,
|
||||
XPrefix: c.Axes.get("x").Prefix,
|
||||
|
@ -721,6 +763,7 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
TimeFormat: c.TimeFormat,
|
||||
LegendColorizeRows: c.LegendColorizeRows,
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
}
|
||||
|
@ -735,12 +778,10 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
IsEnforced: c.EnforceDecimals,
|
||||
Digits: int32(c.DecimalPlaces),
|
||||
},
|
||||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.influxViewColors(),
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.influxViewColors(),
|
||||
}
|
||||
case chartKindSingleStatPlusLine:
|
||||
return influxdb.LinePlusSingleStatProperties{
|
||||
|
@ -753,8 +794,15 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
},
|
||||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
ShadeBelow: c.Shade,
|
||||
HoverDimension: c.HoverDimension,
|
||||
Legend: c.Legend.influxLegend(),
|
||||
|
@ -762,6 +810,7 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
ViewColors: c.Colors.influxViewColors(),
|
||||
Axes: c.Axes.influxAxes(),
|
||||
Position: c.Position,
|
||||
LegendColorizeRows: c.LegendColorizeRows,
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
}
|
||||
|
@ -801,8 +850,15 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Type: influxdb.ViewPropertyTypeXY,
|
||||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
ShadeBelow: c.Shade,
|
||||
HoverDimension: c.HoverDimension,
|
||||
Legend: c.Legend.influxLegend(),
|
||||
|
@ -812,6 +868,7 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Geom: c.Geom,
|
||||
Position: c.Position,
|
||||
TimeFormat: c.TimeFormat,
|
||||
LegendColorizeRows: c.LegendColorizeRows,
|
||||
LegendOpacity: float64(c.LegendOpacity),
|
||||
LegendOrientationThreshold: int(c.LegendOrientationThreshold),
|
||||
}
|
||||
|
|
|
@ -1058,6 +1058,14 @@ spec:
|
|||
assert.Equal(t, "heatmap", props.GetType())
|
||||
assert.Equal(t, "heatmap note", props.Note)
|
||||
assert.Equal(t, int32(10), props.BinSize)
|
||||
assert.Equal(t, true, props.GenerateAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
assert.Equal(t, true, props.LegendColorizeRows)
|
||||
assert.Equal(t, 1.0, props.LegendOpacity)
|
||||
assert.Equal(t, 5, props.LegendOrientationThreshold)
|
||||
assert.True(t, props.ShowNoteWhenEmpty)
|
||||
|
@ -1177,6 +1185,7 @@ spec:
|
|||
assert.Equal(t, "histogram", props.GetType())
|
||||
assert.Equal(t, "histogram note", props.Note)
|
||||
assert.Equal(t, 30, props.BinCount)
|
||||
assert.Equal(t, true, props.LegendColorizeRows)
|
||||
assert.Equal(t, 1.0, props.LegendOpacity)
|
||||
assert.Equal(t, 5, props.LegendOrientationThreshold)
|
||||
assert.True(t, props.ShowNoteWhenEmpty)
|
||||
|
@ -1293,6 +1302,11 @@ spec:
|
|||
assert.Equal(t, "y_prefix", props.YPrefix)
|
||||
assert.Equal(t, "x_suffix", props.XSuffix)
|
||||
assert.Equal(t, "y_suffix", props.YSuffix)
|
||||
assert.Equal(t, true, props.GenerateAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, true, props.LegendColorizeRows)
|
||||
assert.Equal(t, 1.0, props.LegendOpacity)
|
||||
assert.Equal(t, 5, props.LegendOrientationThreshold)
|
||||
})
|
||||
|
@ -1325,6 +1339,14 @@ spec:
|
|||
assert.Equal(t, "foo", props.UpperColumn)
|
||||
assert.Equal(t, "baz", props.MainColumn)
|
||||
assert.Equal(t, "bar", props.LowerColumn)
|
||||
assert.Equal(t, true, props.GenerateAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
assert.Equal(t, true, props.LegendColorizeRows)
|
||||
assert.Equal(t, 1.0, props.LegendOpacity)
|
||||
assert.Equal(t, 5, props.LegendOrientationThreshold)
|
||||
|
||||
|
@ -1390,6 +1412,14 @@ spec:
|
|||
assert.Equal(t, "y_prefix", props.YPrefix)
|
||||
assert.Equal(t, "x_suffix", props.XSuffix)
|
||||
assert.Equal(t, "y_suffix", props.YSuffix)
|
||||
assert.Equal(t, true, props.GenerateAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
assert.Equal(t, true, props.LegendColorizeRows)
|
||||
assert.Equal(t, 1.0, props.LegendOpacity)
|
||||
assert.Equal(t, 5, props.LegendOrientationThreshold)
|
||||
})
|
||||
|
@ -1830,6 +1860,14 @@ spec:
|
|||
assert.Equal(t, "overlaid", props.Position)
|
||||
assert.Equal(t, "leg_type", props.Legend.Type)
|
||||
assert.Equal(t, "horizontal", props.Legend.Orientation)
|
||||
assert.Equal(t, true, props.GenerateAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
assert.Equal(t, true, props.LegendColorizeRows)
|
||||
assert.Equal(t, 1.0, props.LegendOpacity)
|
||||
assert.Equal(t, 5, props.LegendOrientationThreshold)
|
||||
|
||||
|
@ -2288,6 +2326,14 @@ spec:
|
|||
assert.Equal(t, "xy chart note", props.Note)
|
||||
assert.True(t, props.ShowNoteWhenEmpty)
|
||||
assert.Equal(t, "stacked", props.Position)
|
||||
assert.Equal(t, true, props.GenerateAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
assert.Equal(t, true, props.LegendColorizeRows)
|
||||
assert.Equal(t, 1.0, props.LegendOpacity)
|
||||
assert.Equal(t, 5, props.LegendOrientationThreshold)
|
||||
|
||||
|
|
|
@ -2360,8 +2360,15 @@ func TestService(t *testing.T) {
|
|||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
XDomain: []float64{0, 10},
|
||||
YDomain: []float64{0, 100},
|
||||
XAxisLabel: "x_label",
|
||||
|
@ -2372,6 +2379,7 @@ func TestService(t *testing.T) {
|
|||
YSuffix: "y_suffix",
|
||||
BinSize: 10,
|
||||
TimeFormat: "",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
|
@ -2396,6 +2404,7 @@ func TestService(t *testing.T) {
|
|||
XAxisLabel: "x_label",
|
||||
BinCount: 30,
|
||||
Position: "stacked",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
|
@ -2414,8 +2423,15 @@ func TestService(t *testing.T) {
|
|||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
XDomain: []float64{0, 10},
|
||||
YDomain: []float64{0, 100},
|
||||
XAxisLabel: "x_label",
|
||||
|
@ -2425,6 +2441,7 @@ func TestService(t *testing.T) {
|
|||
YPrefix: "y_prefix",
|
||||
YSuffix: "y_suffix",
|
||||
TimeFormat: "",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
|
@ -2442,7 +2459,11 @@ func TestService(t *testing.T) {
|
|||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YSeriesColumns: []string{"y"},
|
||||
XDomain: []float64{0, 10},
|
||||
YDomain: []float64{0, 100},
|
||||
|
@ -2452,6 +2473,7 @@ func TestService(t *testing.T) {
|
|||
YAxisLabel: "y_label",
|
||||
YPrefix: "y_prefix",
|
||||
YSuffix: "y_suffix",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
|
@ -2474,8 +2496,6 @@ func TestService(t *testing.T) {
|
|||
Suffix: "suf",
|
||||
TickSuffix: "true",
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2497,8 +2517,6 @@ func TestService(t *testing.T) {
|
|||
Suffix: "suf",
|
||||
TickSuffix: "true",
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -2522,9 +2540,17 @@ func TestService(t *testing.T) {
|
|||
HoverDimension: "y",
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
Position: "stacked",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
|
@ -2548,10 +2574,18 @@ func TestService(t *testing.T) {
|
|||
HoverDimension: "y",
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
Position: "overlaid",
|
||||
TimeFormat: "",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
|
@ -2574,12 +2608,20 @@ func TestService(t *testing.T) {
|
|||
HoverDimension: "y",
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
UpperColumn: "upper",
|
||||
MainColumn: "main",
|
||||
LowerColumn: "lower",
|
||||
TimeFormat: "",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
|
@ -2842,8 +2884,15 @@ func TestService(t *testing.T) {
|
|||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
XDomain: []float64{0, 10},
|
||||
YDomain: []float64{0, 100},
|
||||
XAxisLabel: "x_label",
|
||||
|
@ -2861,17 +2910,20 @@ func TestService(t *testing.T) {
|
|||
Name: "view name",
|
||||
},
|
||||
Properties: influxdb.HistogramViewProperties{
|
||||
Type: influxdb.ViewPropertyTypeHistogram,
|
||||
Note: "a note",
|
||||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "scale", Hex: "#8F8AF4", Value: 0}, {Type: "scale", Hex: "#8F8AF4", Value: 0}, {Type: "scale", Hex: "#8F8AF4", Value: 0}},
|
||||
FillColumns: []string{"a", "b"},
|
||||
XColumn: "_value",
|
||||
XDomain: []float64{0, 10},
|
||||
XAxisLabel: "x_label",
|
||||
BinCount: 30,
|
||||
Position: "stacked",
|
||||
Type: influxdb.ViewPropertyTypeHistogram,
|
||||
Note: "a note",
|
||||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "scale", Hex: "#8F8AF4", Value: 0}, {Type: "scale", Hex: "#8F8AF4", Value: 0}, {Type: "scale", Hex: "#8F8AF4", Value: 0}},
|
||||
FillColumns: []string{"a", "b"},
|
||||
XColumn: "_value",
|
||||
XDomain: []float64{0, 10},
|
||||
XAxisLabel: "x_label",
|
||||
BinCount: 30,
|
||||
Position: "stacked",
|
||||
LegendColorizeRows: true,
|
||||
LegendOpacity: 1.0,
|
||||
LegendOrientationThreshold: 5,
|
||||
},
|
||||
}),
|
||||
}
|
||||
|
|
|
@ -22,6 +22,14 @@ spec:
|
|||
geom: line
|
||||
width: 6
|
||||
height: 3
|
||||
generateAxisTicks: true
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
queries:
|
||||
|
|
|
@ -17,9 +17,17 @@
|
|||
"yPos": 2,
|
||||
"width": 6,
|
||||
"height": 3,
|
||||
"generateAxisTicks": true,
|
||||
"xCol": "_time",
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yCol": "_value",
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
"binSize": 10,
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1.0,
|
||||
"legendOrientationThreshold": 5,
|
||||
"queries": [
|
||||
|
|
|
@ -14,10 +14,18 @@ spec:
|
|||
width: 6
|
||||
height: 3
|
||||
binSize: 10
|
||||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
generateAxisTicks: true
|
||||
xCol: _time
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yCol: _value
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
queries:
|
||||
- query: >
|
||||
from(bucket: v.bucket) |> range(start: v.timeRangeStart) |> filter(fn: (r) => r._measurement == "mem") |> filter(fn: (r) => r._field == "used_percent") |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false) |> yield(name: "mean")
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
"xCol": "_value",
|
||||
"position": "stacked",
|
||||
"binCount": 30,
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1.0,
|
||||
"legendOrientationThreshold": 5,
|
||||
"fillColumns": [
|
||||
|
|
|
@ -14,6 +14,7 @@ spec:
|
|||
height: 3
|
||||
binCount: 30
|
||||
fillColumns: ["a", "b"]
|
||||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
queries:
|
||||
|
|
|
@ -13,11 +13,16 @@ spec:
|
|||
suffix: days
|
||||
xPos: 1
|
||||
yPos: 2
|
||||
generateAxisTicks: true
|
||||
xCol: _time
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yCol: _value
|
||||
width: 6
|
||||
height: 3
|
||||
ySeriesColumns: ["_value", "foo"]
|
||||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
queries:
|
||||
|
|
|
@ -17,8 +17,16 @@
|
|||
"yPos": 2,
|
||||
"width": 6,
|
||||
"height": 3,
|
||||
"generateAxisTicks": true,
|
||||
"xCol": "_time",
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yCol": "_value",
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1.0,
|
||||
"legendOrientationThreshold": 5,
|
||||
"queries": [
|
||||
|
|
|
@ -13,10 +13,18 @@ spec:
|
|||
suffix: days
|
||||
xPos: 1
|
||||
yPos: 2
|
||||
generateAxisTicks: true
|
||||
xCol: _time
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yCol: _value
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
width: 6
|
||||
height: 3
|
||||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
queries:
|
||||
|
|
|
@ -22,9 +22,17 @@
|
|||
"decimalPlaces": 1,
|
||||
"shade": true,
|
||||
"hoverDimension": "y",
|
||||
"generateAxisTicks": true,
|
||||
"xColumn": "_time",
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yColumn": "_value",
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
"position": "overlaid",
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1.0,
|
||||
"legendOrientationThreshold": 5,
|
||||
"legend": {
|
||||
|
|
|
@ -19,6 +19,14 @@ spec:
|
|||
shade: true
|
||||
hoverDimension: "y"
|
||||
position: overlaid
|
||||
generateAxisTicks: true
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
legend:
|
||||
|
|
|
@ -22,8 +22,16 @@
|
|||
"position": "stacked",
|
||||
"shade": true,
|
||||
"hoverDimension": "y",
|
||||
"generateAxisTicks": true,
|
||||
"xColumn": "_time",
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yColumn": "_value",
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
"legendColorizeRows": true,
|
||||
"legendOpacity": 1.0,
|
||||
"legendOrientationThreshold": 5,
|
||||
"queries": [
|
||||
|
|
|
@ -17,6 +17,14 @@ spec:
|
|||
hoverDimension: "y"
|
||||
geom: line
|
||||
position: stacked
|
||||
generateAxisTicks: true
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
queries:
|
||||
|
|
Loading…
Reference in New Issue