【.net core】大数据页面,类声明和数据插入模板

/// 
/// 图表数据配置类
/// 
public class EchartOption
{
    public EchartOption()
    {
        this.xAxis = new List();
        this.yAxis1 = new List();
        this.yAxis2 = new List();
        this.yAxis3 = new List();
        this.yAxis4 = new List();
        this.yAxis = new List>();
        this.valueNames = new List();
    }
    //适用柱图、折线图
    public List xAxis { get; set; }//横轴
    public List yAxis1 { get; set; }//纵轴1
    public List yAxis2 { get; set; }//纵轴2
    public List yAxis3 { get; set; }//纵轴3
    public List yAxis4 { get; set; }//纵轴4
    public List> yAxis { get; set; }//多柱图集合
    
    //适用饼图
    public List valueNames { get; set; }
    
    public List legend { get; set; }

}
/// 
/// 图表数据配置类
/// 
public class ValueNameClass
{
    public object value { get; set; }
    public string name { get; set; }
}
/// 
/// 静态数据类
/// 
public static class StaticDataClass { 
    public static List QuarterList { get; set; } = new List { "第一季度", "第二季度", "第三季度", "第四季度" };
}
public class EchartDataModel{
    public string Year {get;set;}
    public decimal Value {get;set;}
}

EchartOption  echartData = new EchartOption();//

List dataList = new List(){
    new EchartDataModel(){Year="2024",Value=20.8},
    new EchartDataModel(){Year="2025",Value=21.8},
}

foreach (var item in dataList)
{
    echartData.xAxis.Add(item.Year + "年");
    echartData.yAxis1.Add(item.Value);
}

你可能感兴趣的:(.netcore,大数据,windows)