| | |
| | | public string InitYdataText(string name, List<EnvironmentalSensorHistor> yData, string color) |
| | | { |
| | | //组装Value |
| | | yTitle = name; |
| | | string valueText = string.Empty; |
| | | var YvalueTextItem = @"{name:'{0}', |
| | | data:[{1}], |
| | |
| | | } |
| | | |
| | | |
| | | /// <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 == "") |
| | | { |
| | | YvalueText = YvalueTextItem; |
| | | } |
| | | else |
| | | { |
| | | YvalueText += "," + YvalueTextItem; |
| | | } |
| | | |
| | | return YvalueTextItem; |
| | | } |
| | | |
| | | |
| | | #if __IOS__ |
| | | public string optionString = @"{ |
| | | tooltip: { |