From 668c435862b41dd6dee4d119932a5d1d142d9dfd Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Mon, 18 Feb 2019 09:25:47 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E7=A4=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E2=80=9CNo=20data=20to=20display=E2=80=9D=E4=B8=BA?= =?UTF-8?q?=E2=80=9CNo=20data=20display=20within=20a=20specified=20time=20?= =?UTF-8?q?range=E2=80=9D;=20=E6=97=B6=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=8C=96?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=9A=E6=9C=80=E5=90=8E=E7=9A=84=E2=80=9C?= =?UTF-8?q?=E3=80=82000=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit f3d4f0deec4d961c74abd9fb4fcdb260658f2c31) (cherry picked from commit bb6668d00f392e35bacd8a5c8409487d225f5481) --- .../WEB-INF/views/cfg/logCfgTrendList.jsp | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/logCfgTrendList.jsp b/src/main/webapp/WEB-INF/views/cfg/logCfgTrendList.jsp index 1f3719932..d1547c859 100644 --- a/src/main/webapp/WEB-INF/views/cfg/logCfgTrendList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/logCfgTrendList.jsp @@ -148,7 +148,8 @@ function showActionTransChart(xData,series){ xAxis: { type:'datetime', dateTimeLabelFormats: { - second: '%H:%M:%S', + millisecond: '%H:%M:%S', + second: '%H:%M:%S', minute: '%H:%M', hour: '%H:%M', day: '%m-%d', @@ -405,6 +406,59 @@ function showActionTransChart(xData,series){ return prev + curr; }); } + //配置趋势图需特殊提示,所以从公共js文件中拿出无数据提示方法到本文件中 + (function(d) { + "object" === typeof module && module.exports ? module.exports = d: d(Highcharts) + })(function(d) { (function(c) { + var d = c.seriesTypes, + e = c.Chart.prototype, + f = c.getOptions(), + g = c.extend, + h = c.each; + g(f.lang, { + noData: "No data display within a specified time range" + //noData: "There is no data this hour." + }); + f.noData = { + position: { + x: 0, + y: 0, + align: "center", + verticalAlign: "middle" + } + }; + f.noData.style = { + fontWeight: "bold", + fontSize: "12px", + color: "#666666" + }; + h("bubble gauge heatmap pie sankey treemap waterfall".split(" "), + function(b) { + d[b] && (d[b].prototype.hasData = function() { + return !! this.points.length + }) + }); + c.Series.prototype.hasData = function() { + return this.visible && void 0 !== this.dataMax && void 0 !== this.dataMin + }; + e.showNoData = function(b) { + var a = this.options; + b = b || a && a.lang.noData; + a = a && a.noData; ! this.noDataLabel && this.renderer && (this.noDataLabel = this.renderer.label(b, 0, 0, null, null, null, a.useHTML, null, "no-data"), this.noDataLabel.attr(a.attr).css(a.style), this.noDataLabel.add(), this.noDataLabel.align(g(this.noDataLabel.getBBox(), a.position), !1, "plotBox")) + }; + e.hideNoData = function() { + this.noDataLabel && (this.noDataLabel = this.noDataLabel.destroy()) + }; + e.hasData = function() { + for (var b = this.series || [], a = b.length; a--;) if (b[a].hasData() && !b[a].options.isInternal) return ! 0; + return this.loadingShown + }; + c.addEvent(c.Chart, "render", + function() { + this.hasData() ? this.hideNoData() : this.showNoData() + }) + })(d) + }); \ No newline at end of file