• 【Vegas原创】ComponentArt经典使用(饼图)


    void chartbind(string strDept)
            {
                DataSet ds 
    = new DataSet();
                
    for (int i = 1; i <= 3; i++)
                {
                    
    //连接数据库,并插入数据
                    SqlParameter[] sqlParam = new SqlParameter[4];

                    sqlParam[
    0= new SqlParameter("@i", SqlDbType.Int, 20, ParameterDirection.Input, false00"@i", DataRowVersion.Default, i);
                    sqlParam[
    1= new SqlParameter("@j", SqlDbType.NVarChar, 20, ParameterDirection.Input, false00"@j", DataRowVersion.Default, strDept);
                    sqlParam[
    2= new SqlParameter("@year", SqlDbType.NVarChar, 20, ParameterDirection.Input, false00"@year", DataRowVersion.Default, drpYear.SelectedValue.Trim());
                    sqlParam[
    3= new SqlParameter("@pa", SqlDbType.NVarChar, 20, ParameterDirection.Input, false00"@pa", DataRowVersion.Default, drpPa.SelectedValue.Trim());
        
                    
    try
                    {
                        
    if (i == 1)
                        {
                            DataSet ds1 
    = db.GetDataSet("pms_potential_chart", sqlParam);
                            ds.Merge(ds1);
                        }
                        
    else if (i == 2)
                        {
                            DataSet ds2 
    = db.GetDataSet("pms_potential_chart", sqlParam);
                            ds.Merge(ds2);
                        }
                        
    else if (i == 3)
                        {
                            DataSet ds3 
    = db.GetDataSet("pms_potential_chart", sqlParam);
                            ds.Merge(ds3);
                        }
                    }
                    
    catch
                    {
                        
    return;
                    }
                }
                
    double[] y = new double[10];
                
    string[] x = new string[10];

                
    for(int i=0;i<ds.Tables[0].Rows.Count;i++)
                {
                    x[i]
    =ds.Tables[0].Rows[i][0].ToString();
                    y[i]
    =double.Parse(ds.Tables[0].Rows[i][1].ToString());
                }
                targetChart.DataSource 
    = ds.Tables[0].DefaultView;
                targetChart.Series[
    "S0"].Parameters["x"= x;
                targetChart.Series[
    "S0"].Parameters["y"= y;
                targetChart.DataBind();
                targetChart.Draw();

            }
  • 相关阅读:
    Chrome即将封杀Google Earth、Google Talk等插件
    诗情画意
    奇联妙对
    理解大型分布式网站你必须知道这些概念 (转)
    RESTful API
    什么是微服务?
    Spring Cloud与Spring Boot的关系
    springboot定时任务
    SpringBoot工程目录配置
    Spring Boot中配置文件application.properties使用
  • 原文地址:https://www.cnblogs.com/amadeuslee/p/3744624.html
Copyright © 2020-2023  润新知