private ChartFrame MapObject(DocumentObjectModel.Shapes.Charts.Chart domChart)
        {
            ChartFrame chartFrame = new ChartFrame();

            chartFrame.Size     = new XSize(domChart.Width.Point, domChart.Height.Point);
            chartFrame.Location = new XPoint(domChart.Left.Position.Point, domChart.Top.Position.Point);

            Chart chart = new Chart((ChartType)domChart.Type);

            if (!domChart.IsNull("XAxis"))
            {
                AxisMapper.Map(chart.XAxis, domChart.XAxis);
            }
            if (!domChart.IsNull("YAxis"))
            {
                AxisMapper.Map(chart.YAxis, domChart.YAxis);
            }

            PlotAreaMapper.Map(chart.PlotArea, domChart.PlotArea);

            SeriesCollectionMapper.Map(chart.SeriesCollection, domChart.SeriesCollection);

            LegendMapper.Map(chart, domChart);

            chart.DisplayBlanksAs = (BlankType)domChart.DisplayBlanksAs;
            chart.HasDataLabel    = domChart.HasDataLabel;
            if (!domChart.IsNull("DataLabel"))
            {
                DataLabelMapper.Map(chart.DataLabel, domChart.DataLabel);
            }

            if (!domChart.IsNull("Style"))
            {
                FontMapper.Map(chart.Font, domChart.Document, domChart.Style);
            }
            if (!domChart.IsNull("Format.Font"))
            {
                FontMapper.Map(chart.Font, domChart.Format.Font);
            }
            if (!domChart.IsNull("XValues"))
            {
                XValuesMapper.Map(chart.XValues, domChart.XValues);
            }

            chartFrame.Add(chart);
            return(chartFrame);
        }
Exemple #2
0
        internal static void Map(XValues xValues, DocumentObjectModel.Shapes.Charts.XValues domXValues)
        {
            XValuesMapper mapper = new XValuesMapper();

            mapper.MapObject(xValues, domXValues);
        }