Exemple #1
0
        public static ChartSerie CreateChartSerie(ExcelChart chart, bool isPivot, Range seriesAddress, Range xSeriesAddress)
        {
            ChartSerie result = null;

            switch (chart.ChartType)
            {
            case ExcelChartType.XYScatter:
            case ExcelChartType.XYScatterLines:
            case ExcelChartType.XYScatterLinesNoMarkers:
            case ExcelChartType.XYScatterSmooth:
            case ExcelChartType.XYScatterSmoothNoMarkers:
                result = new ScatterChartSerie(chart, isPivot);
                break;

            case ExcelChartType.Pie:
            case ExcelChartType.Pie3D:
            case ExcelChartType.PieExploded:
            case ExcelChartType.PieExploded3D:
            case ExcelChartType.PieOfPie:
            case ExcelChartType.Doughnut:
            case ExcelChartType.DoughnutExploded:
            case ExcelChartType.BarOfPie:
                result = new PieChartSerie(chart, isPivot);
                break;

            case ExcelChartType.Line:
            case ExcelChartType.LineMarkers:
            case ExcelChartType.LineMarkersStacked:
            case ExcelChartType.LineMarkersStacked100:
            case ExcelChartType.LineStacked:
            case ExcelChartType.LineStacked100:
                result = new LineChartSerie(chart, isPivot);
                if (chart.ChartType == ExcelChartType.LineMarkers ||
                    chart.ChartType == ExcelChartType.LineMarkersStacked ||
                    chart.ChartType == ExcelChartType.LineMarkersStacked100)
                {
                    ((LineChartSerie)result).Marker = ExcelMarkerStyle.Square;
                }
                ((LineChartSerie)result).Smooth = ((ExcelLineChart)chart).Smooth;
                break;

            default:
                result = new ChartSerie(chart, isPivot);
                break;
            }
            result.Series  = seriesAddress;
            result.XSeries = xSeriesAddress;

            return(result);
        }
 public ChartTrendlineCollection(ChartSerie serie)
 {
     this._Serie = serie;
 }