void MapObject(Axis axis, MigraDoc.DocumentObjectModel.Shapes.Charts.Axis domAxis) { if (!domAxis.IsNull("TickLabels.Format")) axis.TickLabels.Format = domAxis.TickLabels.Format; if (!domAxis.IsNull("TickLabels.Style")) FontMapper.Map(axis.TickLabels.Font, domAxis.TickLabels.Document, domAxis.TickLabels.Style); if (!domAxis.IsNull("TickLabels.Font")) FontMapper.Map(axis.TickLabels.Font, domAxis.TickLabels.Font); if (!domAxis.IsNull("MajorTickMark")) axis.MajorTickMark = (TickMarkType)domAxis.MajorTickMark; if (!domAxis.IsNull("MinorTickMark")) axis.MinorTickMark = (TickMarkType)domAxis.MinorTickMark; if (!domAxis.IsNull("MajorTick")) axis.MajorTick = domAxis.MajorTick; if (!domAxis.IsNull("MinorTick")) axis.MinorTick = domAxis.MinorTick; if (!domAxis.IsNull("Title")) { axis.Title.Caption = domAxis.Title.Caption; if (!domAxis.IsNull("Title.Style")) FontMapper.Map(axis.Title.Font, domAxis.Title.Document, domAxis.Title.Style); if (!domAxis.IsNull("Title.Font")) FontMapper.Map(axis.Title.Font, domAxis.Title.Font); axis.Title.Orientation = domAxis.Title.Orientation.Value; axis.Title.Alignment = (HorizontalAlignment)domAxis.Title.Alignment; axis.Title.VerticalAlignment = (VerticalAlignment)domAxis.Title.VerticalAlignment; } axis.HasMajorGridlines = domAxis.HasMajorGridlines; axis.HasMinorGridlines = domAxis.HasMinorGridlines; if (!domAxis.IsNull("MajorGridlines") && !domAxis.MajorGridlines.IsNull("LineFormat")) LineFormatMapper.Map(axis.MajorGridlines.LineFormat, domAxis.MajorGridlines.LineFormat); if (!domAxis.IsNull("MinorGridlines") && !domAxis.MinorGridlines.IsNull("LineFormat")) LineFormatMapper.Map(axis.MinorGridlines.LineFormat, domAxis.MinorGridlines.LineFormat); if (!domAxis.IsNull("MaximumScale")) axis.MaximumScale = domAxis.MaximumScale; if (!domAxis.IsNull("MinimumScale")) axis.MinimumScale = domAxis.MinimumScale; if (!domAxis.IsNull("LineFormat")) LineFormatMapper.Map(axis.LineFormat, domAxis.LineFormat); }
/// <summary> /// Determines the type of the given axis. /// </summary> internal string CheckAxis (Axis axis) { if ((this.xAxis != null) && (axis == this.xAxis)) return "xaxis"; if ((this.yAxis != null) && (axis == this.yAxis)) return "yaxis"; if ((this.zAxis != null) && (axis == this.zAxis)) return "zaxis"; return ""; }
internal static void Map(Axis axis, MigraDoc.DocumentObjectModel.Shapes.Charts.Axis domAxis) { AxisMapper mapper = new AxisMapper(); mapper.MapObject(axis, domAxis); }