ASP.Net Chart Control -----Bar and Column Charts

2020-12-13 02:34

阅读:461

soscw.com,搜素材
            // Populate series data
            Random    random = new Random();
            for(int pointIndex = 0; pointIndex 10; pointIndex++)
            {
                Chart1.Series["Series1"].Points.AddY(Math.Round((double)random.Next(45, 95),0));
                Chart1.Series["Series2"].Points.AddY(Math.Round((double)random.Next(5, 75),0));
                Chart1.Series["Series3"].Points.AddY(Math.Round((double)random.Next(5, 95),0));
                Chart1.Series["Series4"].Points.AddY(Math.Round((double)random.Next(35, 95),0));
            }    

      string chartTypeName == "StackedArea"//"StackedArea100"//"StackedColumn"/"StackedColumn100"/"StackedBar"/"StackedBar100"
      

       Chart1.Series["Series1"].ChartType = (SeriesChartType) Enum.Parse( typeof(SeriesChartType), chartTypeName, true );
       Chart1.Series["Series2"].ChartType = (SeriesChartType) Enum.Parse( typeof(SeriesChartType), chartTypeName, true );
       Chart1.Series["Series3"].ChartType = (SeriesChartType) Enum.Parse( typeof(SeriesChartType), chartTypeName, true );
       Chart1.Series["Series4"].ChartType = (SeriesChartType) Enum.Parse( typeof(SeriesChartType), chartTypeName, true );

 
soscw.com,搜素材


评论


亲,登录后才可以留言!