feat: update generate ticks into an array of properties for each axis (#19850)
* feat: update generate ticks into an array of properties for each axis * fix: add missing operand * chore: reorder properties to be consistent * fix: update GenerateYAxisTicks to array of strings * fix: change expected property to nullpull/19857/head
parent
8aa3e6a6ca
commit
f6a26ee2b9
24
dashboard.go
24
dashboard.go
|
@ -716,12 +716,13 @@ type LinePlusSingleStatProperties struct {
|
|||
DecimalPlaces DecimalPlaces `json:"decimalPlaces"`
|
||||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
GenerateXAxisTicks []string `json:"generateXAxisTicks"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
GenerateYAxisTicks []string `json:"generateYAxisTicks"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
|
@ -744,12 +745,13 @@ type XYViewProperties struct {
|
|||
ViewColors []ViewColor `json:"colors"`
|
||||
Note string `json:"note"`
|
||||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
GenerateXAxisTicks []string `json:"generateXAxisTicks"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
GenerateYAxisTicks []string `json:"generateYAxisTicks"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
|
@ -774,12 +776,13 @@ type BandViewProperties struct {
|
|||
ShowNoteWhenEmpty bool `json:"showNoteWhenEmpty"`
|
||||
TimeFormat string `json:"timeFormat"`
|
||||
HoverDimension string `json:"hoverDimension"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
GenerateXAxisTicks []string `json:"generateXAxisTicks"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
GenerateYAxisTicks []string `json:"generateYAxisTicks"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
|
@ -797,13 +800,6 @@ 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"`
|
||||
|
@ -847,12 +843,13 @@ type HeatmapViewProperties struct {
|
|||
Queries []DashboardQuery `json:"queries"`
|
||||
ViewColors []string `json:"colors"`
|
||||
BinSize int32 `json:"binSize"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
GenerateXAxisTicks []string `json:"generateXAxisTicks"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
GenerateYAxisTicks []string `json:"generateYAxisTicks"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
|
@ -879,12 +876,13 @@ type ScatterViewProperties struct {
|
|||
ViewColors []string `json:"colors"`
|
||||
FillColumns []string `json:"fillColumns"`
|
||||
SymbolColumns []string `json:"symbolColumns"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
GenerateXAxisTicks []string `json:"generateXAxisTicks"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
YColumn string `json:"yColumn"`
|
||||
GenerateYAxisTicks []string `json:"generateYAxisTicks"`
|
||||
YTotalTicks int `json:"yTotalTicks"`
|
||||
YTickStart float64 `json:"yTickStart"`
|
||||
YTickStep float64 `json:"yTickStep"`
|
||||
|
@ -910,8 +908,8 @@ type MosaicViewProperties struct {
|
|||
Queries []DashboardQuery `json:"queries"`
|
||||
ViewColors []string `json:"colors"`
|
||||
FillColumns []string `json:"fillColumns"`
|
||||
GenerateAxisTicks bool `json:"generateAxisTicks"`
|
||||
XColumn string `json:"xColumn"`
|
||||
GenerateXAxisTicks []string `json:"generateXAxisTicks"`
|
||||
XTotalTicks int `json:"xTotalTicks"`
|
||||
XTickStart float64 `json:"xTickStart"`
|
||||
XTickStep float64 `json:"xTickStep"`
|
||||
|
|
|
@ -48,12 +48,13 @@ func TestView_MarshalJSON(t *testing.T) {
|
|||
"geom": "",
|
||||
"note": "",
|
||||
"showNoteWhenEmpty": false,
|
||||
"generateAxisTicks": false,
|
||||
"xColumn": "",
|
||||
"generateXAxisTicks": null,
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "",
|
||||
"generateYAxisTicks": null,
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
|
|
|
@ -464,12 +464,13 @@ func TestService_handleGetDashboard(t *testing.T) {
|
|||
"showNoteWhenEmpty": false,
|
||||
"timeFormat": "",
|
||||
"type": "xy",
|
||||
"generateAxisTicks": false,
|
||||
"xColumn": "",
|
||||
"generateXAxisTicks": null,
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "",
|
||||
"generateYAxisTicks": null,
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
|
@ -991,12 +992,13 @@ func TestService_handlePostDashboard(t *testing.T) {
|
|||
"showNoteWhenEmpty": false,
|
||||
"timeFormat": "",
|
||||
"type": "",
|
||||
"generateAxisTicks": false,
|
||||
"xColumn": "",
|
||||
"generateXAxisTicks": null,
|
||||
"xTotalTicks": 0,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 0,
|
||||
"yColumn": "",
|
||||
"generateYAxisTicks": null,
|
||||
"yTotalTicks": 0,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 0,
|
||||
|
|
|
@ -8976,10 +8976,12 @@ components:
|
|||
$ref: "#/components/schemas/Axes"
|
||||
legend:
|
||||
$ref: "#/components/schemas/Legend"
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
generateXAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
|
@ -8990,6 +8992,10 @@ components:
|
|||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
generateYAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
|
@ -9057,10 +9063,12 @@ components:
|
|||
$ref: "#/components/schemas/Axes"
|
||||
legend:
|
||||
$ref: "#/components/schemas/Legend"
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
generateXAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
|
@ -9071,6 +9079,10 @@ components:
|
|||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
generateYAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
|
@ -9139,10 +9151,12 @@ components:
|
|||
$ref: "#/components/schemas/Axes"
|
||||
legend:
|
||||
$ref: "#/components/schemas/Legend"
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
generateXAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
|
@ -9153,6 +9167,10 @@ components:
|
|||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
generateYAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
|
@ -9225,10 +9243,12 @@ components:
|
|||
showNoteWhenEmpty:
|
||||
description: If true, will display note when empty
|
||||
type: boolean
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
generateXAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
|
@ -9318,10 +9338,12 @@ components:
|
|||
showNoteWhenEmpty:
|
||||
description: If true, will display note when empty
|
||||
type: boolean
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
generateXAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
|
@ -9332,6 +9354,10 @@ components:
|
|||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
generateYAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
|
@ -9420,10 +9446,12 @@ components:
|
|||
showNoteWhenEmpty:
|
||||
description: If true, will display note when empty
|
||||
type: boolean
|
||||
generateAxisTicks:
|
||||
type: boolean
|
||||
xColumn:
|
||||
type: string
|
||||
generateXAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
xTotalTicks:
|
||||
type: integer
|
||||
xTickStart:
|
||||
|
@ -9434,6 +9462,10 @@ components:
|
|||
format: float
|
||||
yColumn:
|
||||
type: string
|
||||
generateYAxisTicks:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
yTotalTicks:
|
||||
type: integer
|
||||
yTickStart:
|
||||
|
|
|
@ -753,12 +753,13 @@ 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.GenerateXAxisTicks = p.GenerateXAxisTicks
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.GenerateYAxisTicks = p.GenerateYAxisTicks
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
|
@ -796,12 +797,13 @@ 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.GenerateXAxisTicks = p.GenerateXAxisTicks
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.GenerateYAxisTicks = p.GenerateYAxisTicks
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
|
@ -818,8 +820,8 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.Kind = chartKindMosaic
|
||||
ch.Queries = convertQueries(p.Queries)
|
||||
ch.Colors = stringsToColors(p.ViewColors)
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.GenerateXAxisTicks = p.GenerateXAxisTicks
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
|
@ -837,12 +839,13 @@ func convertCellView(cell influxdb.Cell) chart {
|
|||
ch.Kind = chartKindScatter
|
||||
ch.Queries = convertQueries(p.Queries)
|
||||
ch.Colors = stringsToColors(p.ViewColors)
|
||||
ch.GenerateAxisTicks = p.GenerateAxisTicks
|
||||
ch.XCol = p.XColumn
|
||||
ch.GenerateXAxisTicks = p.GenerateXAxisTicks
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.GenerateYAxisTicks = p.GenerateYAxisTicks
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
|
@ -879,12 +882,13 @@ 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.GenerateXAxisTicks = p.GenerateXAxisTicks
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.GenerateYAxisTicks = p.GenerateYAxisTicks
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
|
@ -902,12 +906,13 @@ 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.GenerateXAxisTicks = p.GenerateXAxisTicks
|
||||
ch.XTotalTicks = p.XTotalTicks
|
||||
ch.XTickStart = p.XTickStart
|
||||
ch.XTickStep = p.XTickStep
|
||||
ch.YCol = p.YColumn
|
||||
ch.GenerateYAxisTicks = p.GenerateYAxisTicks
|
||||
ch.YTotalTicks = p.YTotalTicks
|
||||
ch.YTickStart = p.YTickStart
|
||||
ch.YTickStep = p.YTickStep
|
||||
|
@ -969,6 +974,14 @@ func convertChartToResource(ch chart) Resource {
|
|||
r[fieldChartFillColumns] = ch.FillColumns
|
||||
}
|
||||
|
||||
if len(ch.GenerateXAxisTicks) > 0 {
|
||||
r[fieldChartGenerateXAxisTicks] = ch.GenerateXAxisTicks
|
||||
}
|
||||
|
||||
if len(ch.GenerateYAxisTicks) > 0 {
|
||||
r[fieldChartGenerateYAxisTicks] = ch.GenerateYAxisTicks
|
||||
}
|
||||
|
||||
if zero := new(tableOptions); ch.TableOptions != *zero {
|
||||
tRes := make(Resource)
|
||||
assignNonZeroBools(tRes, map[string]bool{
|
||||
|
@ -1001,7 +1014,6 @@ func convertChartToResource(ch chart) Resource {
|
|||
assignNonZeroBools(r, map[string]bool{
|
||||
fieldChartNoteOnEmpty: ch.NoteOnEmpty,
|
||||
fieldChartShade: ch.Shade,
|
||||
fieldChartGenerateAxisTicks: ch.GenerateAxisTicks,
|
||||
fieldChartLegendColorizeRows: ch.LegendColorizeRows,
|
||||
})
|
||||
|
||||
|
|
|
@ -1461,12 +1461,13 @@ 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),
|
||||
GenerateXAxisTicks: r.slcStr(fieldChartGenerateXAxisTicks),
|
||||
XTotalTicks: r.intShort(fieldChartXTotalTicks),
|
||||
XTickStart: r.float64Short(fieldChartXTickStart),
|
||||
XTickStep: r.float64Short(fieldChartXTickStep),
|
||||
YCol: r.stringShort(fieldChartYCol),
|
||||
GenerateYAxisTicks: r.slcStr(fieldChartGenerateYAxisTicks),
|
||||
YTotalTicks: r.intShort(fieldChartYTotalTicks),
|
||||
YTickStart: r.float64Short(fieldChartYTickStart),
|
||||
YTickStep: r.float64Short(fieldChartYTickStep),
|
||||
|
|
|
@ -557,13 +557,14 @@ const (
|
|||
fieldChartMainColumn = "mainColumn"
|
||||
fieldChartLowerColumn = "lowerColumn"
|
||||
fieldChartWidth = "width"
|
||||
fieldChartGenerateAxisTicks = "generateAxisTicks"
|
||||
fieldChartXCol = "xCol"
|
||||
fieldChartGenerateXAxisTicks = "generateXAxisTicks"
|
||||
fieldChartXTotalTicks = "xTotalTicks"
|
||||
fieldChartXTickStart = "xTickStart"
|
||||
fieldChartXTickStep = "xTickStep"
|
||||
fieldChartXPos = "xPos"
|
||||
fieldChartYCol = "yCol"
|
||||
fieldChartGenerateYAxisTicks = "generateYAxisTicks"
|
||||
fieldChartYTotalTicks = "yTotalTicks"
|
||||
fieldChartYTickStart = "yTickStart"
|
||||
fieldChartYTickStep = "yTickStep"
|
||||
|
@ -592,8 +593,9 @@ type chart struct {
|
|||
Axes axes
|
||||
Geom string
|
||||
YSeriesColumns []string
|
||||
GenerateAxisTicks bool
|
||||
XCol, YCol string
|
||||
GenerateXAxisTicks []string
|
||||
GenerateYAxisTicks []string
|
||||
XTotalTicks, YTotalTicks int
|
||||
XTickStart, YTickStart float64
|
||||
XTickStep, YTickStep float64
|
||||
|
@ -638,12 +640,13 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.strings(),
|
||||
BinSize: int32(c.BinSize),
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
GenerateXAxisTicks: c.GenerateXAxisTicks,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
GenerateYAxisTicks: c.GenerateYAxisTicks,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
|
@ -689,8 +692,8 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Type: influxdb.ViewPropertyTypeMosaic,
|
||||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.strings(),
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
GenerateXAxisTicks: c.GenerateXAxisTicks,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
|
@ -717,12 +720,13 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
ViewColors: c.Colors.influxViewColors(),
|
||||
Legend: c.Legend.influxLegend(),
|
||||
HoverDimension: c.HoverDimension,
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
GenerateXAxisTicks: c.GenerateXAxisTicks,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
GenerateYAxisTicks: c.GenerateYAxisTicks,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
|
@ -743,12 +747,13 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Type: influxdb.ViewPropertyTypeScatter,
|
||||
Queries: c.Queries.influxDashQueries(),
|
||||
ViewColors: c.Colors.strings(),
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
GenerateXAxisTicks: c.GenerateXAxisTicks,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
GenerateYAxisTicks: c.GenerateYAxisTicks,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
|
@ -794,12 +799,13 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
},
|
||||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
GenerateXAxisTicks: c.GenerateXAxisTicks,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
GenerateYAxisTicks: c.GenerateYAxisTicks,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
|
@ -850,12 +856,13 @@ func (c *chart) properties() influxdb.ViewProperties {
|
|||
Type: influxdb.ViewPropertyTypeXY,
|
||||
Note: c.Note,
|
||||
ShowNoteWhenEmpty: c.NoteOnEmpty,
|
||||
GenerateAxisTicks: c.GenerateAxisTicks,
|
||||
XColumn: c.XCol,
|
||||
GenerateXAxisTicks: c.GenerateXAxisTicks,
|
||||
XTotalTicks: c.XTotalTicks,
|
||||
XTickStart: c.XTickStart,
|
||||
XTickStep: c.XTickStep,
|
||||
YColumn: c.YCol,
|
||||
GenerateYAxisTicks: c.GenerateYAxisTicks,
|
||||
YTotalTicks: c.YTotalTicks,
|
||||
YTickStart: c.YTickStart,
|
||||
YTickStep: c.YTickStep,
|
||||
|
|
|
@ -1058,10 +1058,11 @@ 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, []string{"xTotalTicks", "xTickStart", "xTickStep"}, props.GenerateXAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, []string{"yTotalTicks", "yTickStart", "yTickStep"}, props.GenerateYAxisTicks)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
|
@ -1302,7 +1303,7 @@ 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, []string{"xTotalTicks", "xTickStart", "xTickStep"}, props.GenerateXAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
|
@ -1339,10 +1340,11 @@ 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, []string{"xTotalTicks", "xTickStart", "xTickStep"}, props.GenerateXAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, []string{"yTotalTicks", "yTickStart", "yTickStep"}, props.GenerateYAxisTicks)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
|
@ -1412,10 +1414,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, []string{"xTotalTicks", "xTickStart", "xTickStep"}, props.GenerateXAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, []string{"yTotalTicks", "yTickStart", "yTickStep"}, props.GenerateYAxisTicks)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
|
@ -1860,10 +1863,11 @@ 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, []string{"xTotalTicks", "xTickStart", "xTickStep"}, props.GenerateXAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, []string{"yTotalTicks", "yTickStart", "yTickStep"}, props.GenerateYAxisTicks)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
|
@ -2326,10 +2330,11 @@ 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, []string{"xTotalTicks", "xTickStart", "xTickStep"}, props.GenerateXAxisTicks)
|
||||
assert.Equal(t, 15, props.XTotalTicks)
|
||||
assert.Equal(t, 0.0, props.XTickStart)
|
||||
assert.Equal(t, 1000.0, props.XTickStep)
|
||||
assert.Equal(t, []string{"yTotalTicks", "yTickStart", "yTickStep"}, props.GenerateYAxisTicks)
|
||||
assert.Equal(t, 10, props.YTotalTicks)
|
||||
assert.Equal(t, 0.0, props.YTickStart)
|
||||
assert.Equal(t, 100.0, props.YTickStep)
|
||||
|
|
|
@ -2360,12 +2360,13 @@ func TestService(t *testing.T) {
|
|||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
GenerateXAxisTicks: []string{"xTotalTicks", "xTickStart", "xTickStep"},
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
GenerateYAxisTicks: []string{"yTotalTicks", "yTickStart", "yTickStep"},
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
|
@ -2423,12 +2424,13 @@ func TestService(t *testing.T) {
|
|||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
GenerateXAxisTicks: []string{"xTotalTicks", "xTickStart", "xTickStep"},
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
GenerateYAxisTicks: []string{"yTotalTicks", "yTickStart", "yTickStep"},
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
|
@ -2459,8 +2461,8 @@ func TestService(t *testing.T) {
|
|||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
GenerateXAxisTicks: []string{"xTotalTicks", "xTickStart", "xTickStep"},
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
|
@ -2540,12 +2542,13 @@ func TestService(t *testing.T) {
|
|||
HoverDimension: "y",
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
GenerateXAxisTicks: []string{"xTotalTicks", "xTickStart", "xTickStep"},
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
GenerateYAxisTicks: []string{"yTotalTicks", "yTickStart", "yTickStep"},
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
|
@ -2574,12 +2577,13 @@ func TestService(t *testing.T) {
|
|||
HoverDimension: "y",
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
GenerateXAxisTicks: []string{"xTotalTicks", "xTickStart", "xTickStep"},
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
GenerateYAxisTicks: []string{"yTotalTicks", "yTickStart", "yTickStep"},
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
|
@ -2608,12 +2612,13 @@ func TestService(t *testing.T) {
|
|||
HoverDimension: "y",
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []influxdb.ViewColor{{Type: "text", Hex: "red"}},
|
||||
GenerateAxisTicks: true,
|
||||
XColumn: "x",
|
||||
GenerateXAxisTicks: []string{"xTotalTicks", "xTickStart", "xTickStep"},
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
GenerateYAxisTicks: []string{"yTotalTicks", "yTickStart", "yTickStep"},
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
|
@ -2879,30 +2884,31 @@ func TestService(t *testing.T) {
|
|||
Name: "view name",
|
||||
},
|
||||
Properties: influxdb.HeatmapViewProperties{
|
||||
Type: influxdb.ViewPropertyTypeHeatMap,
|
||||
Note: "a note",
|
||||
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",
|
||||
XPrefix: "x_prefix",
|
||||
XSuffix: "x_suffix",
|
||||
YAxisLabel: "y_label",
|
||||
YPrefix: "y_prefix",
|
||||
YSuffix: "y_suffix",
|
||||
BinSize: 10,
|
||||
TimeFormat: "",
|
||||
Type: influxdb.ViewPropertyTypeHeatMap,
|
||||
Note: "a note",
|
||||
Queries: []influxdb.DashboardQuery{newQuery()},
|
||||
ShowNoteWhenEmpty: true,
|
||||
ViewColors: []string{"#8F8AF4", "#8F8AF4", "#8F8AF4"},
|
||||
XColumn: "x",
|
||||
GenerateXAxisTicks: []string{"xTotalTicks", "xTickStart", "xTickStep"},
|
||||
XTotalTicks: 15,
|
||||
XTickStart: 0,
|
||||
XTickStep: 1000,
|
||||
YColumn: "y",
|
||||
GenerateYAxisTicks: []string{"yTotalTicks", "yTickStart", "yTickStep"},
|
||||
YTotalTicks: 10,
|
||||
YTickStart: 0,
|
||||
YTickStep: 100,
|
||||
XDomain: []float64{0, 10},
|
||||
YDomain: []float64{0, 100},
|
||||
XAxisLabel: "x_label",
|
||||
XPrefix: "x_prefix",
|
||||
XSuffix: "x_suffix",
|
||||
YAxisLabel: "y_label",
|
||||
YPrefix: "y_prefix",
|
||||
YSuffix: "y_suffix",
|
||||
BinSize: 10,
|
||||
TimeFormat: "",
|
||||
},
|
||||
}),
|
||||
newDash("prancer", influxdb.View{
|
||||
|
|
|
@ -22,10 +22,17 @@ spec:
|
|||
geom: line
|
||||
width: 6
|
||||
height: 3
|
||||
generateAxisTicks: true
|
||||
generateXAxisTicks:
|
||||
- xTotalTicks
|
||||
- xTickStart
|
||||
- xTickStep
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
generateYAxisTicks:
|
||||
- yTotalTicks
|
||||
- yTickStart
|
||||
- yTickStep
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
|
|
|
@ -17,12 +17,13 @@
|
|||
"yPos": 2,
|
||||
"width": 6,
|
||||
"height": 3,
|
||||
"generateAxisTicks": true,
|
||||
"xCol": "_time",
|
||||
"generateXAxisTicks": ["xTotalTicks", "xTickStart", "xTickStep"],
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yCol": "_value",
|
||||
"generateYAxisTicks": ["yTotalTicks", "yTickStart", "yTickStep"],
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
|
|
|
@ -17,12 +17,19 @@ spec:
|
|||
legendColorizeRows: true
|
||||
legendOpacity: 1.0
|
||||
legendOrientationThreshold: 5
|
||||
generateAxisTicks: true
|
||||
generateXAxisTicks:
|
||||
- xTotalTicks
|
||||
- xTickStart
|
||||
- xTickStep
|
||||
xCol: _time
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yCol: _value
|
||||
generateYAxisTicks:
|
||||
- yTotalTicks
|
||||
- yTickStart
|
||||
- yTickStep
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
|
|
|
@ -13,7 +13,10 @@ spec:
|
|||
suffix: days
|
||||
xPos: 1
|
||||
yPos: 2
|
||||
generateAxisTicks: true
|
||||
generateXAxisTicks:
|
||||
- xTotalTicks
|
||||
- xTickStart
|
||||
- xTickStep
|
||||
xCol: _time
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
|
|
|
@ -17,12 +17,13 @@
|
|||
"yPos": 2,
|
||||
"width": 6,
|
||||
"height": 3,
|
||||
"generateAxisTicks": true,
|
||||
"generateXAxisTicks": ["xTotalTicks", "xTickStart", "xTickStep"],
|
||||
"xCol": "_time",
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yCol": "_value",
|
||||
"generateYAxisTicks": ["yTotalTicks", "yTickStart", "yTickStep"],
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
|
|
|
@ -13,12 +13,19 @@ spec:
|
|||
suffix: days
|
||||
xPos: 1
|
||||
yPos: 2
|
||||
generateAxisTicks: true
|
||||
generateXAxisTicks:
|
||||
- xTotalTicks
|
||||
- xTickStart
|
||||
- xTickStep
|
||||
xCol: _time
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
yCol: _value
|
||||
generateYAxisTicks:
|
||||
- yTotalTicks
|
||||
- yTickStart
|
||||
- yTickStep
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
"decimalPlaces": 1,
|
||||
"shade": true,
|
||||
"hoverDimension": "y",
|
||||
"generateAxisTicks": true,
|
||||
"generateXAxisTicks": ["xTotalTicks", "xTickStart", "xTickStep"],
|
||||
"xColumn": "_time",
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yColumn": "_value",
|
||||
"generateYAxisTicks": ["yTotalTicks", "yTickStart", "yTickStep"],
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
|
|
|
@ -19,10 +19,17 @@ spec:
|
|||
shade: true
|
||||
hoverDimension: "y"
|
||||
position: overlaid
|
||||
generateAxisTicks: true
|
||||
generateXAxisTicks:
|
||||
- xTotalTicks
|
||||
- xTickStart
|
||||
- xTickStep
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
generateYAxisTicks:
|
||||
- yTotalTicks
|
||||
- yTickStart
|
||||
- yTickStep
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
|
|
|
@ -22,12 +22,13 @@
|
|||
"position": "stacked",
|
||||
"shade": true,
|
||||
"hoverDimension": "y",
|
||||
"generateAxisTicks": true,
|
||||
"generateXAxisTicks": ["xTotalTicks", "xTickStart", "xTickStep"],
|
||||
"xColumn": "_time",
|
||||
"xTotalTicks": 15,
|
||||
"xTickStart": 0,
|
||||
"xTickStep": 1000,
|
||||
"yColumn": "_value",
|
||||
"generateYAxisTicks": ["yTotalTicks", "yTickStart", "yTickStep"],
|
||||
"yTotalTicks": 10,
|
||||
"yTickStart": 0,
|
||||
"yTickStep": 100,
|
||||
|
|
|
@ -17,10 +17,17 @@ spec:
|
|||
hoverDimension: "y"
|
||||
geom: line
|
||||
position: stacked
|
||||
generateAxisTicks: true
|
||||
generateXAxisTicks:
|
||||
- xTotalTicks
|
||||
- xTickStart
|
||||
- xTickStep
|
||||
xTotalTicks: 15
|
||||
xTickStart: 0
|
||||
xTickStep: 1000
|
||||
generateYAxisTicks:
|
||||
- yTotalTicks
|
||||
- yTickStart
|
||||
- yTickStep
|
||||
yTotalTicks: 10
|
||||
yTickStart: 0
|
||||
yTickStep: 100
|
||||
|
|
Loading…
Reference in New Issue