fix: Fixing master gauge issues

pull/16570/head
Zoe Steinkamp 2020-01-16 13:55:30 -07:00
parent 57e0bc751e
commit f4ba7db697
4 changed files with 15 additions and 3 deletions

View File

@ -715,7 +715,9 @@ 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"`

View File

@ -8502,7 +8502,9 @@ components:
- note
- showNoteWhenEmpty
- prefix
- tickPrefix
- suffix
- tickSuffix
- legend
- decimalPlaces
properties:
@ -8528,8 +8530,12 @@ components:
type: boolean
prefix:
type: string
tickPrefix:
type: string
suffix:
type: string
tickSuffix:
type: string
legend:
$ref: '#/components/schemas/Legend'
decimalPlaces:

View File

@ -248,6 +248,8 @@ func convertCellView(cell influxdb.Cell) chart {
case influxdb.SingleStatViewProperties:
setCommon(chartKindSingleStat, p.ViewColors, p.DecimalPlaces, p.Queries)
setNoteFixes(p.Note, p.ShowNoteWhenEmpty, p.Prefix, p.Suffix)
ch.TickPrefix = p.TickPrefix
ch.TickSuffix = p.TickSuffix
case influxdb.ScatterViewProperties:
ch.Kind = chartKindScatter
ch.Queries = convertQueries(p.Queries)

View File

@ -2269,9 +2269,11 @@ func (c chart) properties() influxdb.ViewProperties {
}
case chartKindSingleStat:
return influxdb.SingleStatViewProperties{
Type: influxdb.ViewPropertyTypeSingleStat,
Prefix: c.Prefix,
Suffix: c.Suffix,
Type: influxdb.ViewPropertyTypeSingleStat,
Prefix: c.Prefix,
TickPrefix: c.TickPrefix,
Suffix: c.Suffix,
TickSuffix: c.TickSuffix,
DecimalPlaces: influxdb.DecimalPlaces{
IsEnforced: c.EnforceDecimals,
Digits: int32(c.DecimalPlaces),