Esempio n. 1
0
        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_LineChart lineChart      = plotArea.AddNewLineChart();

            lineChart.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(lineChart);
            }

            foreach (IChartAxis ax in axis)
            {
                lineChart.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();
            }
        }