From 592974441a4df95fffd9167c90192da1a390b1c2 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 06 六月 2023 11:51:12 +0800 Subject: [PATCH] Merge branch 'Dev-Branch' --- HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs | 68 ++++++++++++++++++++++++++++++++-- 1 files changed, 64 insertions(+), 4 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs index e7a11a1..08d7db5 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs @@ -62,6 +62,7 @@ public string InitYdataText(string name, List<EnvironmentalSensorHistor> yData, string color) { //缁勮Value + yTitle = name; string valueText = string.Empty; var YvalueTextItem = @"{name:'{0}', data:[{1}], @@ -78,6 +79,63 @@ } YvalueTextItem = YvalueTextItem.Replace("{1}", valueText); YvalueTextItem = YvalueTextItem.Replace("{2}", color); + + if (YvalueText == "") + { + YvalueText = YvalueTextItem; + } + else + { + YvalueText += "," + YvalueTextItem; + } + + return YvalueTextItem; + } + + + /// <summary> + /// 缁勮y杞存枃鏈� + /// </summary> + /// <param name="yData"></param> + public string InitYdataTextLinearGradient(string name, List<EnvironmentalSensorHistor> yData, string color) + { + //缁勮Value + yTitle = name; + string valueText = string.Empty; + //string rColor = color.Substring(1, 2); + //string gColor = color.Substring(3, 2); + //string bColor = color.Substring(5, 2); + var YvalueTextItem = @"{name:'{0}', + data:[{1}], + type:'line', + smooth:0.6, + symbol:'none', + color:'{2}CC', + areaStyle: { + opacity: 0.8, + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ + { + offset: 0, + color: '{2}AA' + }, + { + offset: 1, + color: '{2}66' + } + ]) + },} + "; + YvalueTextItem = YvalueTextItem.Replace("{0}", name); + + foreach (var data in yData) + { + valueText += "'" + data.fieldValue + "',"; + } + YvalueTextItem = YvalueTextItem.Replace("{1}", valueText); + YvalueTextItem = YvalueTextItem.Replace("{2}", color); + //YvalueTextItem = YvalueTextItem.Replace("{111}", rColor); + //YvalueTextItem = YvalueTextItem.Replace("{222}", gColor); + //YvalueTextItem = YvalueTextItem.Replace("{333}", bColor); if (YvalueText == "") { @@ -124,23 +182,25 @@ ] }"; #else - public string optionString = @"{ + public string optionString = @"{ tooltip: { trigger: 'axis' }, grid: { - top: '10%', + top: '15%', left: '13%', - right: '10%', - bottom: '15%', + right: '12%', + bottom: '10%', }, xAxis: { type: 'category', boundaryGap: false, data: [{0}], + name: '{10}' }, yAxis: { type: 'value', + name: '{20}' }, series: [ {1} -- Gitblit v1.8.0