public void FillChart(IChart chart, IChartAxis[] axis) { if (!(chart is XSSFChart)) { throw new ArgumentException("Chart must be instance of XSSFChart"); } XSSFChart xssfChart = (XSSFChart)chart; CT_PlotArea plotArea = xssfChart.GetCTChart().plotArea; int allSeriesCount = plotArea.GetAllSeriesCount(); CT_ScatterChart scatterChart = plotArea.AddNewScatterChart(); AddStyle(scatterChart); for (int i = 0; i < series.Count; ++i) { Series s = (Series)series[i]; s.SetId(allSeriesCount + i); s.SetOrder(allSeriesCount + i); s.AddToChart(scatterChart); } foreach (IChartAxis ax in axis) { scatterChart.AddNewAxId().val = (uint)ax.Id; } }
public void FillChart(SS.UserModel.IChart chart, params IChartAxis[] axis) { if (!(chart is XSSFChart)) { throw new ArgumentException("Chart must be instance of XSSFChart"); } XSSFChart xssfChart = (XSSFChart)chart; CT_PlotArea plotArea = xssfChart.GetCTChart().plotArea; int allSeriesCount = plotArea.GetAllSeriesCount(); CT_BarChart barChart = plotArea.AddNewBarChart(); barChart.AddNewVaryColors().val = 0; for (int i = 0; i < series.Count; ++i) { Series s = (Series)series[i]; s.SetId(allSeriesCount + i); s.SetOrder(allSeriesCount + i); s.AddToChart(barChart); } foreach (IChartAxis ax in axis) { barChart.AddNewAxId().val = (uint)ax.Id; } }
/** * Create a new SpreadsheetML manual layout for chart. * @param chart a chart to create layout for. */ public XSSFManualLayout(XSSFChart chart) { CT_PlotArea ctPlotArea = chart.GetCTChart().plotArea; CT_Layout ctLayout = ctPlotArea.IsSetLayout() ? ctPlotArea.layout : ctPlotArea.AddNewLayout(); InitLayout(ctLayout); }
private bool HasAxis() { CT_PlotArea ctPlotArea = chart.plotArea; int totalAxisCount = ctPlotArea.sizeOfValAxArray() + ctPlotArea.sizeOfCatAxArray() + ctPlotArea.sizeOfDateAxArray() + ctPlotArea.sizeOfSerAxArray(); return(totalAxisCount > 0); }
private bool HasAxis() { CT_PlotArea ctPlotArea = chart.plotArea; int totalAxisCount = (ctPlotArea.valAx == null ? 0 : ctPlotArea.valAx.Count) + (ctPlotArea.catAx == null ? 0 : ctPlotArea.catAx.Count) + (ctPlotArea.dateAx == null ? 0 : ctPlotArea.dateAx.Count) + (ctPlotArea.serAx == null ? 0 : ctPlotArea.serAx.Count); return(totalAxisCount > 0); }
private bool HasAxis() { CT_PlotArea ctPlotArea = chart.plotArea; int totalAxisCount = 0; //ctPlotArea.sizeOfValAxArray() + //ctPlotArea.sizeOfCatAxArray() + //ctPlotArea.sizeOfDateAxArray() + //ctPlotArea.sizeOfSerAxArray(); throw new NotImplementedException(); return(totalAxisCount > 0); }
/** * Construct a new CTChartSpace bean. * By default, it's just an empty placeholder for chart objects. * * @return a new CTChartSpace bean */ private void CreateChart() { chartSpaceDocument = new ChartSpaceDocument(); chart = chartSpaceDocument.GetChartSpace().AddNewChart(); CT_PlotArea plotArea = chart.AddNewPlotArea(); plotArea.AddNewLayout(); chart.AddNewPlotVisOnly().val = 1; CT_PrintSettings printSettings = chartSpaceDocument.GetChartSpace().AddNewPrintSettings(); printSettings.AddNewHeaderFooter(); CT_PageMargins pageMargins = printSettings.AddNewPageMargins(); pageMargins.b = 0.75; pageMargins.l = 0.70; pageMargins.r = 0.70; pageMargins.t = 0.75; pageMargins.header = 0.30; pageMargins.footer = 0.30; printSettings.AddNewPageSetup(); }
public void FillChart(IChart chart, IChartAxis[] axis) { if (!(chart is XSSFChart)) { throw new ArgumentException("Chart must be instance of XSSFChart"); } XSSFChart xssfChart = (XSSFChart)chart; CT_PlotArea plotArea = xssfChart.GetCTChart().plotArea; CT_ScatterChart scatterChart = plotArea.AddNewScatterChart(); AddStyle(scatterChart); foreach (Series s in series) { s.AddToChart(scatterChart); } foreach (IChartAxis ax in axis) { scatterChart.AddNewAxId().val = (uint)ax.Id; } }
public void FillChart(SS.UserModel.IChart chart, params IChartAxis[] axis) { if (!(chart is XSSFChart)) { throw new ArgumentException("Chart must be instance of XSSFChart"); } XSSFChart xssfChart = (XSSFChart)chart; CT_PlotArea plotArea = xssfChart.GetCTChart().plotArea; CT_LineChart lineChart = plotArea.AddNewLineChart(); lineChart.AddNewVaryColors().val = 0; foreach (Serie s in series) { s.AddToChart(lineChart); } foreach (IChartAxis ax in axis) { lineChart.AddNewAxId().val = (uint)ax.GetId(); } }
private bool HasAxis() { CT_PlotArea plotArea = this.chart.plotArea; throw new NotImplementedException(); }
public XSSFManualLayout(XSSFChart chart) { CT_PlotArea plotArea = chart.GetCTChart().plotArea; this.InitLayout(plotArea.IsSetLayout() ? plotArea.layout : plotArea.AddNewLayout()); }