using System;
using System.Collections.Generic;
namespace HDL_ON.UI
{
///
/// 饼图
///
public class EchartsOption_BrokenLine
{
///
///
///
///
public void InitXdata (List xData)
{
//组装Value
string valueText = string.Empty;
foreach (var data in xData)
{
valueText += "'" + data + "',";
}
optionString = optionString.Replace("{0}", valueText);
}
///
///
///
///
public string GetYdata(string name, List yData, string color)
{
//组装Value
string valueText = string.Empty;
var yAxisValue = @"{name:'{0}',
data:[{1}],
type:'line',
smooth:0.6,
symbol:'none',
color:'{2}'}
";
yAxisValue = yAxisValue.Replace("{0}", name);
foreach (var data in yData)
{
valueText += "'" + data.fieldValue + "',";
}
yAxisValue = yAxisValue.Replace("{1}", valueText);
yAxisValue = yAxisValue.Replace("{2}", color);
return yAxisValue;
}
public void InitYdataString(string yData)
{
//组装Value
optionString = optionString.Replace("{1}", yData);
}
public string optionString = @"{
tooltip: {
trigger: 'axis'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
},
xAxis: {
type: 'category',
boundaryGap: false,
data: [{0}]
},
yAxis: {
type: 'value',
},
series: [
{1}
]
}";
///
/// 颜色列表
///
///
public List ColorList ()
{
var list = new List();
return list;
}
}
}