From e13ff34658898c9f506681aa75244fead1fb2153 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期日, 06 六月 2021 14:17:10 +0800
Subject: [PATCH] 2021-6-6-2
---
HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs | 128 ++++++++++++++++++++++++++++++++----------
1 files changed, 98 insertions(+), 30 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs
index 79ba10d..2f3bccc 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption_BrokenLine.cs
@@ -4,71 +4,140 @@
namespace HDL_ON.UI
{
/// <summary>
- /// 楗煎浘
+ /// 鏇茬嚎鍥�
/// </summary>
public class EchartsOption_BrokenLine
{
/// <summary>
- ///
+ /// x杞存暟鎹�
/// </summary>
- /// <param name="xData"></param>
- public void InitXdata (List<string> xData)
+ public string XvalueText = "";
+
+ /// <summary>
+ /// Y杞存暟鎹�
+ /// </summary>
+ public string YvalueText = "";
+ /// <summary>
+ /// x杞存爣棰�
+ /// </summary>
+ public string xTitle = "";
+ /// <summary>
+ /// y杞存爣棰�
+ /// </summary>
+ public string yTitle = "";
+
+
+ /// <summary>
+ /// 缁勮Option鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ public string InitOption()
{
//缁勮Value
- string valueText = string.Empty;
- foreach (var data in xData)
- {
- valueText += "'" + data + "',";
- }
- optionString = optionString.Replace("{0}", valueText);
+ var newstring = optionString.Replace("{0}", XvalueText);
+ newstring = newstring.Replace("{1}", YvalueText);
+ newstring = newstring.Replace("{10}", xTitle);
+ newstring = newstring.Replace("{20}", yTitle);
+ newstring = newstring.Replace(",,",",");
+ return newstring;
}
/// <summary>
- ///
+ /// 缁勮x杞存枃鏈�
+ /// </summary>
+ /// <param name="xData"></param>
+ public void InitXdataText(List<string> xData)
+ {
+ XvalueText = "";
+ foreach (var data in xData)
+ {
+ XvalueText += "'" + data + "',";
+ }
+ }
+
+ /// <summary>
+ /// 缁勮y杞存枃鏈�
/// </summary>
/// <param name="yData"></param>
- public string GetYdata(string name, List<EnvironmentalSensorHistor> yData, string color)
+ public string InitYdataText(string name, List<EnvironmentalSensorHistor> yData, string color)
{
//缁勮Value
string valueText = string.Empty;
- var yAxisValue = @"{name:'{0}',
+ var YvalueTextItem = @"{name:'{0}',
data:[{1}],
type:'line',
smooth:0.6,
symbol:'none',
color:'{2}'}
";
- yAxisValue = yAxisValue.Replace("{0}", name);
+ YvalueTextItem = YvalueTextItem.Replace("{0}", name);
foreach (var data in yData)
{
valueText += "'" + data.fieldValue + "',";
}
- yAxisValue = yAxisValue.Replace("{1}", valueText);
- yAxisValue = yAxisValue.Replace("{2}", color);
- return yAxisValue;
- }
+ YvalueTextItem = YvalueTextItem.Replace("{1}", valueText);
+ YvalueTextItem = YvalueTextItem.Replace("{2}", color);
- public void InitYdataString(string yData)
- {
- //缁勮Value
- optionString = optionString.Replace("{1}", yData);
+ if (YvalueText == "")
+ {
+ YvalueText = YvalueTextItem;
+ }
+ else
+ {
+ YvalueText += "," + YvalueTextItem;
+ }
+
+ return YvalueTextItem;
}
- public string optionString = @"{
+#if __IOS__
+ public string optionString = @"{
tooltip: {
trigger: 'axis'
},
grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
+ top: '10%',
+ left: '10%',
+ right: '10%',
+ bottom: '10%',
+ },
+ xAxis: {
+ name: '{10}',
+ type: 'category',
+ boundaryGap: false,
+ data: [{0}],
+ axisLabel : {
+ fontSize:30,
+ },
+ },
+ yAxis: {
+ name: '{20}',
+ type: 'value',
+ axisLabel : {
+ fontSize:30,
+ },
+ },
+ series: [
+ {1}
+ ]
+ }";
+#else
+ public string optionString = @"{
+ tooltip: {
+ trigger: 'axis'
+ },
+ grid: {
+ top: '10%',
+ left: '10%',
+ right: '10%',
+ bottom: '10%',
},
xAxis: {
type: 'category',
boundaryGap: false,
- data: [{0}]
+ data: [{0}],
},
yAxis: {
type: 'value',
@@ -77,18 +146,17 @@
{1}
]
}";
+#endif
/// <summary>
/// 棰滆壊鍒楄〃
/// </summary>
/// <returns></returns>
- public List<string> ColorList ()
+ public List<string> ColorList()
{
var list = new List<string>();
return list;
}
}
-
-
}
\ No newline at end of file
--
Gitblit v1.8.0