NatelEnergy/grafana-discrete-panel

0.0.7 value mappings broken. 0.0.6 works fine

Closed this issue · 3 comments

Just upgraded to 0.0.7 and the value mappings no longer apply. 0.0.6 works fine. No changes to config; I can replicate just by switching between versions.

Grafana v4.4.1, running in official grafana/grafana docker image.

Can you post the panel json for your config?

image

I guess this is the same issue I have for a week weeks.

Panel JSON:

{
  "backgroundColor": "rgba(128, 128, 128, 0.1)",
  "colorMaps": [
    {
      "color": "#CCC",
      "text": "N/A"
    },
    {
      "color": "rgb(175, 47, 47)",
      "text": "home"
    },
    {
      "color": "rgb(53, 58, 160)",
      "text": "away"
    }
  ],
  "crosshairColor": "#8F070C",
  "datasource": null,
  "display": "timeline",
  "editable": true,
  "error": false,
  "expandFromQueryS": 0,
  "extendLastValue": true,
  "gridPos": {
    "h": 7,
    "w": 24,
    "x": 0,
    "y": 35
  },
  "highlightOnMouseover": true,
  "id": 13,
  "legendSortBy": "-ms",
  "lineColor": "rgba(128, 128, 128, 1.0)",
  "links": [],
  "mappingTypes": [
    {
      "name": "value to text",
      "value": 1
    },
    {
      "name": "range to text",
      "value": 2
    }
  ],
  "metricNameColor": "#000000",
  "rangeMaps": [
    {
      "from": "null",
      "text": "N/A",
      "to": "null"
    }
  ],
  "rowHeight": 50,
  "showLegend": true,
  "showLegendNames": true,
  "showLegendPercent": true,
  "showLegendValues": true,
  "showTimeAxis": true,
  "targets": [
    {
      "dsType": "influxdb",
      "groupBy": [
        {
          "params": [
            "$interval"
          ],
          "type": "time"
        },
        {
          "params": [
            "null"
          ],
          "type": "fill"
        }
      ],
      "measurement": "MeAtHome",
      "orderByTime": "ASC",
      "policy": "default",
      "refId": "A",
      "resultFormat": "time_series",
      "select": [
        [
          {
            "params": [
              "value"
            ],
            "type": "field"
          },
          {
            "params": [],
            "type": "distinct"
          }
        ]
      ],
      "tags": []
    }
  ],
  "textSize": 24,
  "textSizeTime": 12,
  "timeTextColor": "#d8d9da",
  "title": "MeAtHome",
  "type": "natel-discrete-panel",
  "units": "short",
  "valueMaps": [
    {
      "op": "=",
      "text": "N/A",
      "value": "null"
    },
    {
      "op": "=",
      "text": "home",
      "value": "1"
    },
    {
      "op": "=",
      "text": "away",
      "value": "0"
    }
  ],
  "valueTextColor": "#000000",
  "writeAllValues": false,
  "writeLastValue": true,
  "writeMetricNames": false
}

response

{"results":[{"statement_id":0,"series":[{"name":"MeAtHome","columns":["time","distinct"],"values":[[1526585400000,1],[1526585700000,1],[1526586000000,1],[1526586300000,1],[1526586600000,1],[1526586900000,1],[1526587200000,1],[1526587500000,1],[1526587800000,1],[1526588100000,1],[1526588400000,1],[1526588700000,1],[1526589000000,1],[1526589300000,1],[1526589600000,1],[1526589900000,1],[1526590200000,1],[1526590500000,1],[1526590800000,1],[1526591100000,1],[1526591400000,1],[1526591700000,1],[1526592000000,1],[1526592300000,1],[1526592600000,1],[1526592900000,1],[1526593200000,1],[1526593500000,1],[1526593800000,1],[1526594100000,1],[1526594400000,1],[1526594700000,1],[1526595000000,1],[1526595300000,1],[1526595600000,1],[1526595900000,1],[1526596200000,1],[1526596500000,1],[1526596800000,1],[1526597100000,1],[1526597400000,1],[1526597700000,1],[1526598000000,1],[1526598300000,1],[1526598600000,1],[1526598900000,1],[1526599200000,1],[1526599500000,1],[1526599800000,1],[1526600100000,1],[1526600400000,1],[1526600700000,1],[1526601000000,1],[1526601300000,1],[1526601600000,1],[1526601900000,1],[1526602200000,1],[1526602500000,1],[1526602800000,1],[1526603100000,1],[1526603400000,1],[1526603700000,1],[1526604000000,1],[1526604300000,1],[1526604600000,1],[1526604900000,1],[1526605200000,1],[1526605500000,1],[1526605800000,1],[1526606100000,1],[1526606400000,1],[1526606700000,1],[1526607000000,1],[1526607300000,1],[1526607600000,1],[1526607900000,1],[1526608200000,1],[1526608500000,1],[1526608800000,1],[1526609100000,1],[1526609400000,1],[1526609700000,1],[1526610000000,1],[1526610300000,1],[1526610600000,1],[1526610900000,1],[1526611200000,1],[1526611500000,1],[1526611800000,1],[1526612100000,1],[1526612400000,1],[1526612700000,1],[1526613000000,1],[1526613300000,1],[1526613600000,1],[1526613900000,1],[1526614200000,1],[1526614500000,1],[1526614800000,1],[1526615100000,1],[1526615400000,1],[1526615700000,1],[1526616000000,1],[1526616300000,1],[1526616600000,1],[1526616900000,1],[1526617200000,1],[1526617500000,1],[1526617800000,1],[1526618100000,1],[1526618400000,1],[1526618700000,1],[1526619000000,1],[1526619300000,1],[1526619600000,1],[1526619900000,1],[1526620200000,1],[1526620500000,1],[1526620800000,1],[1526621100000,1],[1526621400000,1],[1526621700000,1],[1526622000000,1],[1526622000000,0],[1526622300000,0],[1526622600000,0],[1526622900000,0],[1526623200000,0],[1526623500000,0],[1526623800000,0],[1526624100000,0],[1526624400000,0],[1526624700000,0],[1526625000000,0],[1526625300000,0],[1526625600000,0],[1526625900000,0],[1526626200000,0],[1526626500000,0],[1526626800000,0],[1526627100000,0],[1526627400000,0],[1526627700000,0],[1526628000000,0],[1526628300000,0],[1526628600000,0],[1526628900000,0],[1526629200000,0],[1526629500000,0],[1526629800000,0],[1526630100000,0],[1526630400000,0],[1526630700000,0],[1526631000000,0],[1526631300000,0],[1526631600000,0],[1526631900000,0],[1526632200000,0],[1526632500000,0],[1526632800000,0],[1526633100000,0],[1526633400000,0],[1526633700000,0],[1526634000000,0],[1526634300000,0],[1526634600000,0],[1526634900000,0],[1526635200000,0],[1526635500000,0],[1526635800000,0],[1526636100000,0],[1526636400000,0],[1526636700000,0],[1526637000000,0],[1526637300000,0],[1526637600000,0],[1526637900000,0],[1526638200000,0],[1526638500000,0],[1526638800000,0],[1526639100000,0],[1526639400000,0],[1526639700000,0],[1526640000000,0],[1526640300000,0],[1526640600000,0],[1526640900000,0],[1526641200000,0],[1526641500000,0],[1526641800000,0],[1526642100000,0],[1526642400000,0],[1526642700000,0],[1526643000000,0],[1526643300000,0],[1526643600000,0],[1526643900000,0],[1526644200000,0],[1526644500000,0],[1526644800000,0],[1526645100000,0],[1526645400000,0],[1526645700000,0],[1526646000000,0],[1526646300000,0],[1526646600000,0],[1526646900000,0],[1526647200000,0],[1526647500000,0],[1526647800000,0],[1526648100000,0],[1526648400000,0],[1526648700000,0],[1526649000000,0],[1526649300000,0],[1526649600000,0],[1526649900000,0],[1526650200000,0],[1526650500000,0],[1526650800000,0],[1526651100000,0],[1526651400000,0],[1526651700000,0],[1526652000000,0],[1526652300000,0],[1526652600000,0],[1526652900000,0],[1526653200000,0],[1526653500000,0],[1526653800000,0],[1526654100000,0],[1526654400000,0],[1526654700000,0],[1526655000000,0],[1526655300000,0],[1526655600000,0],[1526655900000,0],[1526656200000,0],[1526656500000,0],[1526656800000,0],[1526657100000,0],[1526657400000,0],[1526657700000,0],[1526658000000,0],[1526658300000,0],[1526658600000,0],[1526658900000,0],[1526659200000,0],[1526659500000,0],[1526659800000,0],[1526660100000,0],[1526660400000,0],[1526660700000,0],[1526661000000,0],[1526661300000,0],[1526661600000,0],[1526661900000,0],[1526662200000,0],[1526662500000,0],[1526662740000,1],[1526662800000,1],[1526663100000,1],[1526663400000,1],[1526663700000,1],[1526664000000,1],[1526664300000,1],[1526664600000,1],[1526664900000,1],[1526665200000,1],[1526665500000,1],[1526665800000,1],[1526666100000,1],[1526666400000,1],[1526666700000,1],[1526667000000,1],[1526667300000,1],[1526667600000,1],[1526667900000,1],[1526668200000,1],[1526668500000,1],[1526668800000,1],[1526669100000,1],[1526669400000,1],[1526669700000,1],[1526670000000,1],[1526670300000,1],[1526670600000,1],[1526670900000,1],[1526671200000,1],[1526671500000,1]]}]}]}

My guess the values are numbers but the mapping is looking for string/characters.
"value": "0"
[1526662500000,0],[1526662740000,1]

Grafana v5.1.0 (844bdc5)
influxdb 1.5.2

btw: There are other people reporting this issue in another repository, but I could not find an issue here.
neuralfraud/grafana-prtg#74 (comment)

I also posted this here: grafana/grafana#11992

I found and fixed the problem... it is in master and will be released with 0.0.8