0

テーブル内のデータからグラフを視覚化しようとしていますが、arraylist(arlData) を作成しましたが、この例外を回避しています 'このデータ ポイントには 1 つの Y 値しか設定できません。パラメータ名: yValue' どうすればいいですか?

        chart1.Series.Add("W1 Electricity");
        chart1.Series.Add("W2 Electricity");
        chart1.Series.Add("W1 Gas");
        chart1.Series.Add("W2 Gas");

        chart1.Series["W1 Electricity"].Color = Color.Red;
        chart1.Series["W2 Electricity"].Color = Color.Blue;

        chart1.Series["W1 Gas"].Color = Color.Green;
        chart1.Series["W2 Gas"].Color = Color.Green;

        foreach (UsageWeek objCurrEntry in arlData)
        {
            chart1.Series["W1 Electricity"].Points.AddXY(1, objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W1 Electricity"].Points.AddXY(2, objCurrEntry.StartDate,objCurrEntry.EndDate);
            chart1.Series["W1 Electricity"].Points.AddXY(3, objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W1 Electricity"].Points.AddXY(4, objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W1 Electricity"].Points.AddXY(5, objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W1 Electricity"].Points.AddXY(6, objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W1 Electricity"].Points.AddXY(7, objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W Electricity"].Points.AddXY(objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W1 Gas"].Points.AddXY(objCurrEntry.StartDate, objCurrEntry.EndDate);
            chart1.Series["W2 Gas"].Points.AddXY(objCurrEntry.StartDate, objCurrEntry.EndDate);

        }

         //X-axis labels 
        chart1.Series["W1 Electricity"].Points[0].AxisLabel = "Monday";
        chart1.Series["W1 Electricity"].Points[1].AxisLabel = "Tuesday";
        chart1.Series["W1 Electricity"].Points[2].AxisLabel = "Wednesday";
        chart1.Series["W1 Electricity"].Points[3].AxisLabel = "Thursday"; 
        chart1.Series["W1 Electricity"].Points[4].AxisLabel = "Friday";
        chart1.Series["W1 Electricity"].Points[5].AxisLabel = "Saturday";
        chart1.Series["W1 Electricity"].Points[6].AxisLabel = "Sunday";

        //X-axis labels 
        chart1.Series["W2 Electricity"].Points[0].AxisLabel = "Monday";
        chart1.Series["W2 Electricity"].Points[1].AxisLabel = "Tuesday";
        chart1.Series["W2 Electricity"].Points[2].AxisLabel = "Wednesday";
        chart1.Series["W2 Electricity"].Points[3].AxisLabel = "Thursday";
        chart1.Series["W2 Electricity"].Points[4].AxisLabel = "Friday";
        chart1.Series["W2 Electricity"].Points[5].AxisLabel = "Saturday";
        chart1.Series["W2 Electricity"].Points[6].AxisLabel = "Sunday";


    }

`

4

0 に答える 0