我想找一个绘制柱形图的DEMO,不知BZ能不能给我提供一个。
现在我只找到了绘制饼图的DEMO,我现在参考它来绘制柱形图
参考代码:
- string colors = "#ffbb22,#ff9911,#aacc33,#aabbbb,#bb0033,#00cc33,#990099,#0011aa,#14D0EE,#B17EC3,#E67F16,#EE5907,#6A2DA1,#0A35F0,#A816D7,#D218AD,#EE0A96,#5A4DAE,#ACE9D9";
- PieSeries pseries = new PieSeries();
- pseries.Values.AddRange(new double[] { 0.2, 0.3, 0.1, 0.2, 0.2 });
- pseries.LabelVisible = true;
- pseries.LabelFormatter = new FarPoint.Win.Spread.Model.GeneralFormatter("0.00%", false);
- FillCollection fc = pseries.PieFills;
- List<SolidFill> list = new List<SolidFill>();
- foreach (string color in colors.Split(new char[] { ',' }))
- {
- list.Add(new SolidFill(ColorTranslator.FromHtml(color)));
- }
- fc.Clear();
- fc.AddRange(list.ToArray());
- PiePlotArea plotArea = new PiePlotArea();
- plotArea.Location = new PointF(0.2f, 0.2f);
- plotArea.Size = new SizeF(0.6f, 0.6f);
- plotArea.Series.Add(pseries);
- ChartModel model = new ChartModel();
- model.PlotAreas.Add(plotArea);
- //FarPoint.Win.Spread.Chart.SpreadChart char000 = new FarPoint.Win.Spread.Chart.SpreadChart();
- //char000.Top = 0;
- //char000.Left = 0;
- //char000.Width = 100;
- //char000.Height = 100;
- fpSpread1.ActiveSheet.AddChart(0, 0, typeof(PieSeries), 400, 400, 10, 1);
- fpSpread1.ActiveSheet.Charts[0].Model = model;
复制代码
但是我现在对spread中,绘制柱形使用的类不是很清楚,
Series是用FarPoint.Win.Chart.ClusteredBarSeries这个类吗?
Area用那个类,我在帮助上面没有找到....
最好有个DEMO....谢谢 |
|