Ejemplo n.º 1
0
    protected void DPLSELECTVENDOR_SelectedIndexChanged1(object sender, EventArgs e)
    {
        ArrayList ColorGuider = new ArrayList();

        ArrayList[] DataArray = { new ArrayList(), new ArrayList(), new ArrayList() };
        ArrayList   XLabel    = new ArrayList();

        ColorGuider.Add("unit rate");
        ColorGuider.Add("travel time");
        ColorGuider.Add("travel cost");


        cmd.CommandText = "select pricepercomponent from quatation where vendorname='" + DPLSELECTVENDOR.SelectedItem.Text + "'and componentname='" + Session["component"] + "'";
        DataArray[0].Add(Convert.ToInt32(cmd.ExecuteScalar()));


        cmd.CommandText = "select traveltime from quatation where vendorname='" + DPLSELECTVENDOR.SelectedItem.Text + "'and componentname='" + Session["component"] + "'";
        DataArray[1].Add(Convert.ToInt32(cmd.ExecuteScalar()));



        cmd.CommandText = "select travelcost from quatation where vendorname='" + DPLSELECTVENDOR.SelectedItem.Text + "'and componentname='" + Session["component"] + "'";
        DataArray[2].Add(Convert.ToInt32(cmd.ExecuteScalar()));

        Chartlet1.ChartTitle.Text  = "VENDOR STATUS";
        Chartlet1.XLabels.UnitText = "VENDOR";
        Chartlet1.YLabels.UnitText = "RUPEES";
        Chartlet1.InitializeData(DataArray, XLabel, ColorGuider);
        XLabel.Add("status");
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //X坐标轴标识数组
        //Labels on X Axis
        ArrayList XTitle = new ArrayList();

        XTitle.Add("East");
        XTitle.Add("South");
        XTitle.Add("West");
        XTitle.Add("North");
        XTitle.Add("NorthEast");
        XTitle.Add("SouthWest");
        XTitle.Add("NorthWest");

        //图表数据(1组)
        //Chart Data
        ArrayList[] ChartData = new ArrayList[1];

        ChartData[0] = new ArrayList();
        ChartData[0].Add(80);
        ChartData[0].Add(40);
        ChartData[0].Add(30);
        ChartData[0].Add(24);
        ChartData[0].Add(22);
        ChartData[0].Add(20);
        ChartData[0].Add(16);


        Chartlet1.InitializeData(ChartData, XTitle, null);
        Chartlet1.ChartTitle = "nihao";
    }
Ejemplo n.º 3
0
    private void init()
    {
        string id = Request.QueryString["ProductsID"];

        if (id == null)
        {
            Response.End();
            return;
        }

        int ids = int.Parse(id);

        DataSet ds = new DataSet();

        ds = Leyp.SQLServerDAL.Factory.getProductsStockDAL().getDataSetByProductsID(ids);
        DataTable dd     = ds.Tables["dd"];
        ArrayList XTitle = new ArrayList();

        ArrayList[] ChartData = new ArrayList[1];

        ChartData[0] = new ArrayList();

        if (dd != null)
        {
            foreach (DataRow dr in dd.Rows)
            {
                XTitle.Add(dr[6].ToString().Substring(0, 4) + "-" + dr[5].ToString());
                ChartData[0].Add(Int32.Parse(dr[4].ToString()));
            }


            Chartlet1.InitializeData(ChartData, XTitle, null);
            Chartlet1.ChartTitle = "商品分布图";
        }
    }
Ejemplo n.º 4
0
    public void LoadData()
    {
        /***
         * 这里就不用数据库了,手动添加一些数据。你正式使用时,是不需要这么繁琐的,只要绑定一个数据源既可。
         * 数据库绑定请参看下面的四个构造函数
         * void BindChartData(SqlDataSource)
         * void BindChartData(DataSet)
         * void BindChartData(DataView)
         * void BindChartData(DataTable)
         * ****/



        ArrayList ColorGuider = new ArrayList();

        ArrayList[] DataArray = { new ArrayList(), new ArrayList(), new ArrayList() };
        ArrayList   XLabel    = new ArrayList();

        //1.Set data by manual, you can read data from database use below statements
        //手动添加数据,你也可以使用下面的代码从数据库中读取数据
        ColorGuider.Add("cost/sample");
        ColorGuider.Add("travel time");
        ColorGuider.Add("trevel cost");


        XLabel.Add("East");
        XLabel.Add("South");
        XLabel.Add("West");
        XLabel.Add("North");

        //Chartlet1.TipsShow = false;
        DataArray[0].Add(200);
        DataArray[0].Add(45.2);
        DataArray[0].Add(33.69);
        DataArray[0].Add(60.20);


        DataArray[1].Add(76.1);
        DataArray[1].Add(68);
        DataArray[1].Add(43);
        DataArray[1].Add(10);

        DataArray[2].Add(10);
        DataArray[2].Add(77);
        DataArray[2].Add(15);
        DataArray[2].Add(79);

        Chartlet1.ChartTitle.Text  = "vipin chandran p";
        Chartlet1.XLabels.UnitText = "Region";
        Chartlet1.YLabels.UnitText = "Yield / %";
        Chartlet1.InitializeData(DataArray, XLabel, ColorGuider);
    }
Ejemplo n.º 5
0
    /**** 请用BindChartData()方法绑定数据 ****/
    public void LoadData(string cs)
    {
        ArrayList ColorGuider = new ArrayList();

        ArrayList[] DataArray = { new ArrayList(), new ArrayList(), new ArrayList() };
        ArrayList   XLabel    = new ArrayList();

        //1.Set data by manual, you can read data from database use below statements
        //手动添加数据,你也可以使用下面的代码从数据库中读取数据
        ColorGuider.Add("Laura");
        ColorGuider.Add("Jesy");
        ColorGuider.Add("Linda");

        XLabel.Add("East");
        XLabel.Add("South");
        XLabel.Add("West");
        XLabel.Add("North");

        //Chartlet1.TipsShow = false;
        DataArray[0].Add(98.9);
        DataArray[0].Add(45.2);
        DataArray[0].Add(33.69);
        DataArray[0].Add(60.20);


        DataArray[1].Add(76.1);
        DataArray[1].Add(68);
        DataArray[1].Add(43);
        DataArray[1].Add(10);

        DataArray[2].Add(10);
        DataArray[2].Add(77);
        DataArray[2].Add(15);
        DataArray[2].Add(79);

        Chartlet1.ChartTitle.Text  = "Chartlet Demo";
        Chartlet1.XLabels.UnitText = "Region";
        Chartlet1.YLabels.UnitText = "Yield / %";
        Chartlet1.InitializeData(DataArray, XLabel, ColorGuider);
    }
Ejemplo n.º 6
0
    public void LoadData()
    {
        /****
         * void BindChartData(SqlDataSource)
         * void BindChartData(DataSet)
         * void BindChartData(DataView)
         * void BindChartData(DataTable)
         * ****/

        cmd.CommandText = "select count(*) from quatation where componentname='" + Session["component"].ToString() + "'";
        int count = Convert.ToInt32(cmd.ExecuteScalar());


        ArrayList ColorGuider = new ArrayList();

        ArrayList[] DataArray = { new ArrayList(), new ArrayList(), new ArrayList() };
        ArrayList   XLabel    = new ArrayList();

        //1.Set data by manual, you can read data from database use below statements
        ColorGuider.Add("unit rate");
        ColorGuider.Add("travel time");
        ColorGuider.Add("travel cost");


        //DPLORDEREDCOMPONENTS.Items.Insert(0, "COMPONENTS");



        XLabel.Add("VENDOR");



        //Chartlet1.TipsShow = false;

        //ok

        /*
         * DataArray[0].Add(200);
         * DataArray[0].Add(45.2);
         * DataArray[0].Add(33.69);
         * DataArray[0].Add(60.20);
         * DataArray[0].Add(34);
         *
         *
         * DataArray[1].Add(76.1);
         * DataArray[1].Add(68);
         * DataArray[1].Add(43);
         * DataArray[1].Add(10);
         * DataArray[1].Add(167);
         *
         * DataArray[2].Add(10);
         * DataArray[2].Add(77);
         * DataArray[2].Add(15);
         * DataArray[2].Add(79);
         * DataArray[2].Add(56);
         */
        //ok



        cmd.CommandText = "select pricepercomponent from quatation where vendorname='" + DPLSELECTVENDOR.SelectedItem.Text + "' and componentname='" + Session["component"] + "'";
        DataArray[0].Add(Convert.ToInt32(cmd.ExecuteScalar()));


        cmd.CommandText = "select traveltime from quatation where vendorname='" + DPLSELECTVENDOR.SelectedItem.Text + "'and componentname='" + Session["component"] + "'";
        DataArray[1].Add(Convert.ToInt32(cmd.ExecuteScalar()));



        cmd.CommandText = "select travelcost from quatation where vendorname='" + DPLSELECTVENDOR.SelectedItem.Text + "'and componentname='" + Session["component"] + "'";
        DataArray[2].Add(Convert.ToInt32(cmd.ExecuteScalar()));



        Chartlet1.ChartTitle.Text  = "VENDOR STATUS";
        Chartlet1.XLabels.UnitText = "VENDOR";
        Chartlet1.YLabels.UnitText = "RUPEES";
        Chartlet1.InitializeData(DataArray, XLabel, ColorGuider);
        XLabel.Add("status");
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 绑定图表
    /// </summary>
    /// <param name="whereStr">当前筛选条件</param>
    /// <param name="type">1表示试卷名或姓名,2表示专业名,3表示科目名</param>
    public void LoadData(string whereStr, int type)
    {
        if (scoreList.Rows.Count > 0)
        {
            Chartlet1.AppearanceStyle = (FanG.Chartlet.AppearanceStyles)System.Enum.Parse(typeof(FanG.Chartlet.AppearanceStyles), "Bar_3D_Aurora_NoCrystal_NoGlow_NoBorder", true);
            DataTable classListTable = TbScoreManager.GetClassList(whereStr, type);
            ArrayList classList      = new ArrayList();
            foreach (DataRow classRow in classListTable.Rows)
            {
                classList.Add(classRow["BjName"]);
            }
            DataTable testpaperListTable = TbScoreManager.GetTestPaperList(whereStr, type);
            ArrayList testpaperList      = new ArrayList();
            foreach (DataRow testRow in testpaperListTable.Rows)
            {
                testpaperList.Add(testRow["SjName"]);
            }

            ArrayList[] DataArray = new ArrayList[testpaperList.Count];
            for (int i = 0; i < DataArray.Length; i++)
            {
                DataArray[i] = new ArrayList();
                int   sjid        = int.Parse(testpaperListTable.Rows[i]["SjiD"].ToString());
                float sjZongScore = TbQuestionTypesManager.GetSumScoreBySjid(sjid);
                for (int j = 0; j < classList.Count; j++)
                {
                    string    nowClassName = classList[j].ToString();
                    float     sumScore     = 0;
                    DataTable dtScorelist  = TbScoreManager.GetScoreListBySjidAndClassname(sjid, nowClassName);
                    if (dtScorelist.Rows.Count > 0)
                    {
                        foreach (DataRow row in dtScorelist.Rows)
                        {
                            float score = 0;
                            if (float.Parse(row["DxtScore"].ToString()) > 0)
                            {
                                score += float.Parse(row["DxtScore"].ToString());
                            }
                            if (float.Parse(row["DuoxtScore"].ToString()) > 0)
                            {
                                score += float.Parse(row["DuoxtScore"].ToString());
                            }
                            if (float.Parse(row["PdtScore"].ToString()) > 0)
                            {
                                score += float.Parse(row["PdtScore"].ToString());
                            }
                            if (float.Parse(row["ZgtScore"].ToString()) > 0)
                            {
                                score += float.Parse(row["ZgtScore"].ToString());
                            }
                            sumScore += score;
                        }
                        float avgScore = sumScore / dtScorelist.Rows.Count;
                        DataArray[i].Add(avgScore / sjZongScore * 100);
                    }
                }
            }
            string title = "";
            switch (type)
            {
            case 1:
                if (whereStr == "")
                {
                    title = "全部";
                }
                else
                {
                    title = "筛选:" + whereStr;
                }
                break;

            case 2: title = "专业:" + whereStr; break;

            case 3: title = "科目:" + whereStr; break;
            }
            Chartlet1.ChartTitle.Text  = title;
            Chartlet1.XLabels.UnitText = "班级/平均分";
            Chartlet1.YLabels.UnitText = "总分";
            Chartlet1.MaxValueY        = 100;
            Chartlet1.InitializeData(DataArray, classList, testpaperList);
        }
    }