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

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

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

EchartOption  echartData = new EchartOption();//

List<EchartDataModel> dataList = new List<EchartDataModel>(){
    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);
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值