當前位置: 首頁>>代碼示例>>C#>>正文


C# Chart.GetAllLabels方法代碼示例

本文整理匯總了C#中Chart.GetAllLabels方法的典型用法代碼示例。如果您正苦於以下問題:C# Chart.GetAllLabels方法的具體用法?C# Chart.GetAllLabels怎麽用?C# Chart.GetAllLabels使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Chart的用法示例。


在下文中一共展示了Chart.GetAllLabels方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: populateChart

    private void populateChart()
    {
        Chart chrt = new Chart();
        chrt = chrt.GetAllLabels();
        if (chrt!=null)
        {
        Chart1.Series["HPrealgebra"].Label = chrt .Label1;
        Chart1.Series["LPrealgebra"].Label = chrt.Label2;
        string strPre = "0";
        if (chrt.Label3 != "" && chrt.Label3 != null)
        {
            strPre = chrt.Label3.Substring(0, 5);
        }
        Chart1.Series["APrealgebra"].Label = strPre;

        Chart1.Series["HAlgebra"].Label = chrt.Label4;
        Chart1.Series["LAlgebra"].Label = chrt.Label5;
           // string strPre1 = chrt.Label6.Substring(0, 5);
        string strPre1 = "0";
        if (chrt.Label6 != "" && chrt.Label6 != null)
        {
            strPre1 = chrt.Label6.Substring(0, 5);
        }
        Chart1.Series["AAlgebra"].Label = strPre1;

        Chart1.Series["HWritting"].Label = chrt.Label7;
        Chart1.Series["LWritting"].Label = chrt.Label8;
        //string strPre2 = chrt.Label9.Substring(0, 5);
        string strPre2 = "0";
        if (chrt.Label9 != "" && chrt.Label9 != null)
        {
            strPre2 = chrt.Label9.Substring(0, 5);
        }
        Chart1.Series["AWritting"].Label = strPre2;

        Chart1.Series["HReading"].Label = chrt.Label10;
        Chart1.Series["LReading"].Label = chrt.Label11;
        //string strPre3 = chrt.Label12.Substring(0, 5);
        string strPre3 = "0";
        if (chrt.Label12 != "" && chrt.Label12 != null)
        {
            strPre3 = chrt.Label12.Substring(0, 5);
        }
        Chart1.Series["AReading"].Label = strPre3;

        Chart1.Series["HEnglish"].Label = chrt.Label13;
        Chart1.Series["LEnglish"].Label = chrt.Label14;
        //string strPre4 = chrt.Label15.Substring(0, 5);
        string strPre4 = "0";
        if (chrt.Label15 != "" && chrt.Label15 != null)
        {
            strPre4 = chrt.Label15.Substring(0, 5);
        }
        Chart1.Series["AEnglish"].Label = strPre4;

        Chart1.Series["HMath"].Label = chrt.Label16;
        Chart1.Series["LMath"].Label = chrt.Label17;
        //string strPre5 = chrt.Label18.Substring(0, 5);
        string strPre5 = "0";
        if (chrt.Label18 != "" && chrt.Label18 != null)
        {
            strPre5 = chrt.Label18.Substring(0, 5);
        }
        Chart1.Series["AMath"].Label = strPre5;

        Chart1.Series["HReadingAssessment"].Label = chrt.Label19;
        Chart1.Series["LReadingAssessment"].Label = chrt.Label20;
        //string strPre6 = chrt.Label21.Substring(0, 5);
        string strPre6 = "0";
        if (chrt.Label21 != "" && chrt.Label21 != null)
        {
            strPre6 = chrt.Label21.Substring(0, 5);
        }
        Chart1.Series["AReadingAssessment"].Label = strPre6;

        Chart1.Series["HScienceAssessment"].Label = chrt.Label22;
        Chart1.Series["LScienceAssessment"].Label = chrt.Label23;
        //string strPre7 = chrt.Label24.Substring(0, 5);
        string strPre7 = "0";
        if (chrt.Label24 != "" && chrt.Label24 != null)
        {
            strPre7 = chrt.Label24.Substring(0, 5);
        }
        Chart1.Series["AScienceAssessment"].Label = strPre7;
        }
    }
開發者ID:mominbd,項目名稱:testing,代碼行數:86,代碼來源:home.aspx.cs


注:本文中的Chart.GetAllLabels方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。