wxr
2023-07-31 177a7911bef4111d64ec0dfc6184eebb84fe23ed
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs
@@ -47,17 +47,25 @@
        /// </summary>
        /// <param name="displayScale">显示比例 0-100,比如设置了30,只显示30%,可以左右拖动显示其他</param>
        /// <returns></returns>
        public string InitOption(int displayScale)
        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轴文本
@@ -114,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
@@ -124,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',
@@ -241,7 +295,7 @@
                    xAxis: {
                        name: '{10}',
                        type: 'category',
                        boundaryGap: false,
                        boundaryGap: {11},
                        data: [{0}],
                        axisLabel : {
                            fontSize:30,
@@ -277,7 +331,7 @@
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        boundaryGap: {11},
                        data: [{0}],
                        name: '{10}'
                    },