Exemplo n.º 1
0
        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;
            }
        }
Exemplo n.º 2
0
        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;
            }
        }