首页 > 代码库 > Devexpress web图表 柱状图 竖排

Devexpress web图表 柱状图 竖排

 1  var lookup = list.ToLookup(x => x.FULLNAME); 2             if (lookup.Count > 0) 3             { 4                 webChartControl.Height = new Unit(lookup.Count * 200); 5             } 6             XYDiagram diagram = (XYDiagram)webChartControl.Diagram; 7             diagram.DefaultPane.Visible = false; 8             int i = 0; 9             foreach (var item in lookup)10             {11                 var pane = new XYDiagramPane();12                 diagram.Panes.Add(pane);13                 var temp = webChartControl.Series[0].Clone() as Series;14                 15                 var view = temp.View as SideBySideBarSeriesView;16                 17                 view.Pane = pane;18                 var sums = from l in item group l by l.SPENT_ON into g select new { SPENT_ON = g.Key, HOURS = g.Sum(x => x.HOURS) };19                 temp.DataSource = sums;20                 temp.LegendText = item.Key;21                 webChartControl.Series.Add(temp);22                 23             }

 

Devexpress web图表 柱状图 竖排