This is an automated email from the ASF dual-hosted git repository. miao pushed a commit to branch grafana_plugin in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 330707640d2333f17920bb05d854a2190b742666 Author: luke.miao <[email protected]> AuthorDate: Tue Dec 10 13:54:54 2024 +0800 Fixed the issue of displaying 0 when the number is null --- iotdb-connector/grafana-plugin/package.json | 2 +- iotdb-connector/grafana-plugin/pkg/plugin/plugin.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/iotdb-connector/grafana-plugin/package.json b/iotdb-connector/grafana-plugin/package.json index 675cd1e84a1..246dc6a6bf0 100644 --- a/iotdb-connector/grafana-plugin/package.json +++ b/iotdb-connector/grafana-plugin/package.json @@ -1,6 +1,6 @@ { "name": "iotdb", - "version": "1.0.0", + "version": "1.0.1", "description": "Apache IoTDB", "scripts": { "build": "grafana-toolkit plugin:build", diff --git a/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go b/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go index 6d9f9783a7a..ebb7710b3c3 100644 --- a/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go +++ b/iotdb-connector/grafana-plugin/pkg/plugin/plugin.go @@ -326,7 +326,7 @@ func recoverType(m []interface{}) interface{} { tmp := make([]float64, len(m)) for i := range m { if m[i] == nil { - tmp[i] = 0 + tmp[i] = math.NaN() } else { tmp[i] = m[i].(float64) } @@ -352,7 +352,7 @@ func recoverType(m []interface{}) interface{} { tmp := make([]float64, len(m)) for i := range m { if m[i] == nil { - tmp[i] = 0 + tmp[i] = math.NaN() } else { tmp[i] = m[i].(float64) }
