Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        internal static void Map(Axis axis, DocumentObjectModel.Shapes.Charts.Axis domAxis)
        {
            AxisMapper mapper = new AxisMapper();

            MapObject(axis, domAxis);
        }
Ejemplo n.º 3
0
 internal static void Map(Axis axis, MigraDoc.DocumentObjectModel.Shapes.Charts.Axis domAxis)
 {
   AxisMapper mapper = new AxisMapper();
   mapper.MapObject(axis, domAxis);
 }