改变坐标显示内容的代码如下,主要是设置CategoryNames属性:
- FarPoint.Win.Spread.Chart.SpreadChart chart = fpSpread1.Sheets[0].AddChart(new FarPoint.Win.Spread.Model.CellRange(0, 0, 5, 6), typeof(FarPoint.Win.Chart.StackedBarSeries), 300, 200, 0, 0);
- YPlotArea plot = chart.Model.PlotAreas[0] as YPlotArea;
- plot.Vertical = false;
- foreach (StackedBarSeries group in chart.Model.PlotAreas[0].Series)
- {
- foreach (BarSeries series in group.Series)
- {
- series.CategoryNames.DataSource = null;
- series.CategoryNames.AddRange(new string[] { "AAA", "BBB", "CCC", "DDD", "EEE" });
- }
- }
复制代码 |