From cbc156bc38d8b8eae7aef60cb186ab2b52fa701f Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期二, 16 七月 2024 13:59:56 +0800
Subject: [PATCH] 增加全部挂断

---
 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs |  171 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 168 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs
index 08d7db5..bb491d3 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs
@@ -43,6 +43,31 @@
         }
 
         /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="displayScale">鏄剧ず姣斾緥 0-100锛屾瘮濡傝缃簡30锛屽彧鏄剧ず30%锛屽彲浠ュ乏鍙虫嫋鍔ㄦ樉绀哄叾浠�</param>
+        /// <returns></returns>
+        public string InitOption(int displayScale, bool isBar = false)
+        {
+            //缁勮Value
+            var newstring = optionString2.Replace("{0}", XvalueText);
+            newstring = newstring.Replace("{1}", YvalueText);
+            newstring = newstring.Replace("{10}", xTitle);
+            if (isBar)
+            {
+                newstring = newstring.Replace("{11}", "true");
+            }
+            else {
+                newstring = newstring.Replace("{11}", "false");
+            }
+            newstring = newstring.Replace("{20}", yTitle);
+            newstring = newstring.Replace("{30}", displayScale.ToString());
+            newstring = newstring.Replace(",,", ",");
+            return newstring;
+        }
+
+
+        /// <summary>
         /// 缁勮x杞存枃鏈�
         /// </summary>
         /// <param name="xData"></param>
@@ -97,6 +122,53 @@
         /// 缁勮y杞存枃鏈�
         /// </summary>
         /// <param name="yData"></param>
+        public string InitYdataText2(string name, List<EnvironmentalSensorHistor> yData, string color, bool isBar)
+        {
+            //缁勮Value
+            yTitle = name;
+            string valueText = string.Empty;
+            var YvalueTextItem = @"{
+                            data:[{1}],
+                            type:'{333}',
+                            smooth:0.6,
+                            symbol:'none',
+                            color:'{2}'}
+            ";
+            if (isBar)
+            {
+                YvalueTextItem = YvalueTextItem.Replace("{333}", "bar");
+            }
+            else
+            {
+                YvalueTextItem = YvalueTextItem.Replace("{333}", "line");
+            }
+            YvalueTextItem = YvalueTextItem.Replace("{0}", name);
+
+            foreach (var data in yData)
+            {
+                valueText += "'" + data.fieldValue + "',";
+            }
+            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
@@ -107,7 +179,6 @@
             //string bColor = color.Substring(5, 2);
             var YvalueTextItem = @"{name:'{0}',
                             data:[{1}],
-                            type:'line',
                             smooth:0.6,
                             symbol:'none',
                             color:'{2}CC',
@@ -153,7 +224,11 @@
 #if __IOS__
         public string optionString = @"{
                  tooltip: {
-                    trigger: 'axis'
+                    trigger: 'axis',
+                    textStyle: {
+                            fontSize: 30
+                        },
+                    padding:40,
                     },
                     grid: {
                          top: '10%',
@@ -163,6 +238,9 @@
                     },
                     xAxis: {
                         name: '{10}',
+                        nameTextStyle: {
+                                fontSize: 30
+                            },
                         type: 'category',
                         boundaryGap: false,
                         data: [{0}],
@@ -172,12 +250,16 @@
                     },
                     yAxis: {
                         name: '{20}',
+                        nameGap:30,
+                        nameTextStyle: {
+                                fontSize: 30
+                            },
                         type: 'value',
                         axisLabel : {
                             fontSize:30,
                         },
                     },
-                    series: [  
+                    series: [
                         {1}
                     ]
             }";
@@ -208,6 +290,89 @@
             }";
 #endif
 
+
+
+#if __IOS__
+        public string optionString2 = @"{
+                 tooltip: {
+                    trigger: 'axis',
+                    padding:40,
+                    textStyle: {
+                            fontSize: 30
+                        },
+                    },
+                    grid: {
+                         top: '10%',
+                        left: '10%',
+                        right: '10%',
+                        bottom: '10%',
+                    },
+                    xAxis: {
+                        name: '{10}',
+                        nameTextStyle: {
+                                fontSize: 30
+                            },
+                        type: 'category',
+                        boundaryGap: {11},
+                        data: [{0}],
+                        axisLabel : {
+                            fontSize:30,
+                        },
+                    },
+                    yAxis: {
+                        name: '{20}',  
+                        nameGap:30,
+                        nameTextStyle: {
+                                fontSize: 30
+                            },
+                        type: 'value',
+                        axisLabel : {
+                            fontSize:30,
+                        },
+                    },
+                    dataZoom: [{ 
+                        type: 'inside', 
+                        xAxisIndex: 0, 
+                        start: 0,
+                        end: {30} 
+                    }],
+                    series: [  
+                        {1}
+                    ]
+            }";
+#else
+        public string optionString2 = @"{
+                 tooltip: {
+                    trigger: 'axis'
+                    },
+                    grid: {
+                         top: '15%',
+                        left: '13%',
+                        right: '12%',
+                        bottom: '10%',
+                    },
+                    xAxis: {
+                        type: 'category',
+                        boundaryGap: {11},
+                        data: [{0}],
+                        name: '{10}'
+                    },
+                    yAxis: {
+                        type: 'value',
+                        name: '{20}'
+                    },
+                    dataZoom: [{ 
+                        type: 'inside', 
+                        xAxisIndex: 0, 
+                        start: 0,
+                        end: {30} 
+                    }],
+                    series: [  
+                        {1}
+                    ]
+            }";
+#endif
+
         /// <summary>
         /// 棰滆壊鍒楄〃
         /// </summary>

--
Gitblit v1.8.0