فهرست منبع

Graph: fix for legend show/hide toggle, broken by recent legend rewrite

Torkel Ödegaard 11 سال پیش
والد
کامیت
6861dc137f
2فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 2 0
      src/app/components/timeSeries.js
  2. 1 1
      src/app/panels/graph/axisEditor.html

+ 2 - 0
src/app/components/timeSeries.js

@@ -70,6 +70,7 @@ function (_, kbn) {
     this.stats.min = Number.MAX_VALUE;
     this.stats.min = Number.MAX_VALUE;
     this.stats.avg = null;
     this.stats.avg = null;
     this.stats.current = null;
     this.stats.current = null;
+    this.allIsNull = true;
 
 
     var ignoreNulls = fillStyle === 'connected';
     var ignoreNulls = fillStyle === 'connected';
     var nullAsZero = fillStyle === 'null as zero';
     var nullAsZero = fillStyle === 'null as zero';
@@ -89,6 +90,7 @@ function (_, kbn) {
 
 
       if (_.isNumber(currentValue)) {
       if (_.isNumber(currentValue)) {
         this.stats.total += currentValue;
         this.stats.total += currentValue;
+        this.allIsNull = false;
       }
       }
 
 
       if (currentValue > this.stats.max) {
       if (currentValue > this.stats.max) {

+ 1 - 1
src/app/panels/graph/axisEditor.html

@@ -40,7 +40,7 @@
 <div class="editor-row">
 <div class="editor-row">
   <div class="section">
   <div class="section">
     <h5>Legend styles</h5>
     <h5>Legend styles</h5>
-		<editor-opt-bool text="Show legend" model="panel.legend.show" change="render()"></editor-opt-bool>
+		<editor-opt-bool text="Show legend" model="panel.legend.show" change="get_data();"></editor-opt-bool>
 		<editor-opt-bool text="Include values" model="panel.legend.values" change="render()"></editor-opt-bool>
 		<editor-opt-bool text="Include values" model="panel.legend.values" change="render()"></editor-opt-bool>
 		<editor-opt-bool text="Align as table" model="panel.legend.alignAsTable" change="render()"></editor-opt-bool>
 		<editor-opt-bool text="Align as table" model="panel.legend.alignAsTable" change="render()"></editor-opt-bool>
 		<editor-opt-bool text="Right side" model="panel.legend.rightSide" change="render()"></editor-opt-bool>
 		<editor-opt-bool text="Right side" model="panel.legend.rightSide" change="render()"></editor-opt-bool>