Пример #1
0
        protected DateAxis GenerateDateAxis(AxisId axisId, AxisPositionValues axisPosition, AxisId crossingAxisId, TickLabelPositionValues tickLabelPosition)
        {
            DateAxis dateAxis1 = new DateAxis();
            AxisId axisId3 = new AxisId() { Val = axisId.Val };

            Scaling scaling1 = new Scaling();
            Orientation orientation1 = new Orientation() { Val = OrientationValues.MinMax };

            scaling1.Append(orientation1);
            AxisPosition axisPosition1 = new AxisPosition() { Val = AxisPositionValues.Bottom };
            NumberingFormat numberingFormat1 = new NumberingFormat() { FormatCode = dateAxisFormat, SourceLinked = true };
            MajorTickMark majorTickMark1 = new MajorTickMark() { Val = TickMarkValues.None };
            TickLabelPosition tickLabelPosition1 = new TickLabelPosition() { Val = tickLabelPosition };

            TextProperties textProperties1 = new TextProperties();
            A::BodyProperties bodyProperties2 = new A::BodyProperties() { Rotation = -5400000, Vertical = A::TextVerticalValues.Horizontal };
            A::ListStyle listStyle2 = new A::ListStyle();

            A::Paragraph paragraph2 = new A::Paragraph();

            A::ParagraphProperties paragraphProperties2 = new A::ParagraphProperties();
            A::DefaultRunProperties defaultRunProperties2 = new A::DefaultRunProperties() { Language = DEFAULT_LANG };

            paragraphProperties2.Append(defaultRunProperties2);
            A::EndParagraphRunProperties endParagraphRunProperties1 = new A::EndParagraphRunProperties() { Language = DEFAULT_LANG };

            paragraph2.Append(paragraphProperties2);
            paragraph2.Append(endParagraphRunProperties1);

            textProperties1.Append(bodyProperties2);
            textProperties1.Append(listStyle2);
            textProperties1.Append(paragraph2);
            CrossingAxis crossingAxis1 = new CrossingAxis() { Val = crossingAxisId.Val };
            Crosses crosses1 = new Crosses() { Val = CrossesValues.AutoZero };
            AutoLabeled autoLabeled1 = new AutoLabeled() { Val = true };
            LabelOffset labelOffset1 = new LabelOffset() { Val = (UInt16Value)100U };

            dateAxis1.Append(axisId3);
            dateAxis1.Append(scaling1);
            dateAxis1.Append(axisPosition1);
            dateAxis1.Append(numberingFormat1);
            dateAxis1.Append(majorTickMark1);
            dateAxis1.Append(tickLabelPosition1);
            dateAxis1.Append(textProperties1);
            dateAxis1.Append(crossingAxis1);
            dateAxis1.Append(crosses1);
            dateAxis1.Append(autoLabeled1);
            dateAxis1.Append(labelOffset1);

            return dateAxis1;
        }
Пример #2
0
        internal C.DateAxis ToDateAxis(bool IsStylish = false)
        {
            C.DateAxis da = new C.DateAxis();
            da.AxisId = new C.AxisId() { Val = this.AxisId };

            da.Scaling = new C.Scaling();
            da.Scaling.Orientation = new C.Orientation() { Val = this.Orientation };
            if (this.LogBase != null) da.Scaling.LogBase = new C.LogBase() { Val = this.LogBase.Value };
            if (this.MaxAxisValue != null) da.Scaling.MaxAxisValue = new C.MaxAxisValue() { Val = this.MaxAxisValue.Value };
            if (this.MinAxisValue != null) da.Scaling.MinAxisValue = new C.MinAxisValue() { Val = this.MinAxisValue.Value };

            da.Delete = new C.Delete() { Val = this.Delete };

            C.AxisPositionValues axpos = this.AxisPosition;
            if (!this.ForceAxisPosition)
            {
                if (this.OtherAxisIsInReverseOrder) axpos = SLChartTool.GetOppositePosition(axpos);
                if (this.OtherAxisCrossedAtMaximum) axpos = SLChartTool.GetOppositePosition(axpos);
            }
            da.AxisPosition = new C.AxisPosition() { Val = axpos };

            if (this.ShowMajorGridlines)
            {
                da.MajorGridlines = this.MajorGridlines.ToMajorGridlines(IsStylish);
            }

            if (this.ShowMinorGridlines)
            {
                da.MinorGridlines = this.MinorGridlines.ToMinorGridlines(IsStylish);
            }

            if (this.ShowTitle)
            {
                da.Title = this.Title.ToTitle(IsStylish);
            }

            if (this.HasNumberingFormat)
            {
                da.NumberingFormat = new C.NumberingFormat()
                {
                    FormatCode = this.FormatCode,
                    SourceLinked = this.SourceLinked
                };
            }

            da.MajorTickMark = new C.MajorTickMark() { Val = this.MajorTickMark };
            da.MinorTickMark = new C.MinorTickMark() { Val = this.MinorTickMark };
            da.TickLabelPosition = new C.TickLabelPosition() { Val = this.TickLabelPosition };

            if (this.ShapeProperties.HasShapeProperties) da.ChartShapeProperties = this.ShapeProperties.ToChartShapeProperties(IsStylish);

            if (this.Rotation != null || this.Vertical != null || this.Anchor != null || this.AnchorCenter != null)
            {
                da.TextProperties = new C.TextProperties();
                da.TextProperties.BodyProperties = new A.BodyProperties();
                if (this.Rotation != null) da.TextProperties.BodyProperties.Rotation = (int)(this.Rotation.Value * SLConstants.DegreeToAngleRepresentation);
                if (this.Vertical != null) da.TextProperties.BodyProperties.Vertical = this.Vertical.Value;
                if (this.Anchor != null) da.TextProperties.BodyProperties.Anchor = this.Anchor.Value;
                if (this.AnchorCenter != null) da.TextProperties.BodyProperties.AnchorCenter = this.AnchorCenter.Value;

                da.TextProperties.ListStyle = new A.ListStyle();

                A.Paragraph para = new A.Paragraph();
                para.ParagraphProperties = new A.ParagraphProperties();
                para.ParagraphProperties.Append(new A.DefaultRunProperties());
                da.TextProperties.Append(para);
            }
            else if (IsStylish)
            {
                da.TextProperties = new C.TextProperties();
                da.TextProperties.BodyProperties = new A.BodyProperties()
                {
                    Rotation = -60000000,
                    UseParagraphSpacing = true,
                    VerticalOverflow = A.TextVerticalOverflowValues.Ellipsis,
                    Vertical = A.TextVerticalValues.Horizontal,
                    Wrap = A.TextWrappingValues.Square,
                    Anchor = A.TextAnchoringTypeValues.Center,
                    AnchorCenter = true
                };
                da.TextProperties.ListStyle = new A.ListStyle();

                A.Paragraph para = new A.Paragraph();
                para.ParagraphProperties = new A.ParagraphProperties();

                A.DefaultRunProperties defrunprops = new A.DefaultRunProperties();
                defrunprops.FontSize = 900;
                defrunprops.Bold = false;
                defrunprops.Italic = false;
                defrunprops.Underline = A.TextUnderlineValues.None;
                defrunprops.Strike = A.TextStrikeValues.NoStrike;
                defrunprops.Kerning = 1200;
                defrunprops.Baseline = 0;

                A.SchemeColor schclr = new A.SchemeColor() { Val = A.SchemeColorValues.Text1 };
                schclr.Append(new A.LuminanceModulation() { Val = 65000 });
                schclr.Append(new A.LuminanceOffset() { Val = 35000 });
                defrunprops.Append(new A.SolidFill()
                {
                    SchemeColor = schclr
                });

                defrunprops.Append(new A.LatinFont() { Typeface = "+mn-lt" });
                defrunprops.Append(new A.EastAsianFont() { Typeface = "+mn-ea" });
                defrunprops.Append(new A.ComplexScriptFont() { Typeface = "+mn-cs" });

                para.ParagraphProperties.Append(defrunprops);
                para.Append(new A.EndParagraphRunProperties() { Language = System.Globalization.CultureInfo.CurrentCulture.Name });

                da.TextProperties.Append(para);
            }

            da.CrossingAxis = new C.CrossingAxis() { Val = this.CrossingAxis };

            if (this.IsCrosses != null)
            {
                if (this.IsCrosses.Value)
                {
                    da.Append(new C.Crosses() { Val = this.Crosses });
                }
                else
                {
                    da.Append(new C.CrossesAt() { Val = this.CrossesAt });
                }
            }

            da.Append(new C.AutoLabeled() { Val = this.AutoLabeled });
            da.Append(new C.LabelOffset() { Val = this.LabelOffset });

            if (this.BaseUnit != null) da.Append(new C.BaseTimeUnit() { Val = this.BaseUnit.Value });

            if (this.iMajorUnit != null)
            {
                da.Append(new C.MajorUnit() { Val = this.iMajorUnit.Value });
                da.Append(new C.MajorTimeUnit() { Val = this.vMajorTimeUnit });
            }

            if (this.iMinorUnit != null)
            {
                da.Append(new C.MinorUnit() { Val = this.iMinorUnit.Value });
                da.Append(new C.MinorTimeUnit() { Val = this.vMinorTimeUnit });
            }

            return da;
        }
        internal C.DateAxis ToDateAxis(bool IsStylish)
        {
            C.DateAxis da = new C.DateAxis();
            da.AxisId = new C.AxisId()
            {
                Val = this.AxisId
            };

            da.Scaling             = new C.Scaling();
            da.Scaling.Orientation = new C.Orientation()
            {
                Val = this.Orientation
            };
            if (this.LogBase != null)
            {
                da.Scaling.LogBase = new C.LogBase()
                {
                    Val = this.LogBase.Value
                }
            }
            ;
            if (this.MaxAxisValue != null)
            {
                da.Scaling.MaxAxisValue = new C.MaxAxisValue()
                {
                    Val = this.MaxAxisValue.Value
                }
            }
            ;
            if (this.MinAxisValue != null)
            {
                da.Scaling.MinAxisValue = new C.MinAxisValue()
                {
                    Val = this.MinAxisValue.Value
                }
            }
            ;

            da.Delete = new C.Delete()
            {
                Val = this.Delete
            };

            C.AxisPositionValues axpos = this.AxisPosition;
            if (!this.ForceAxisPosition)
            {
                if (this.OtherAxisIsInReverseOrder)
                {
                    axpos = SLChartTool.GetOppositePosition(axpos);
                }
                if (this.OtherAxisCrossedAtMaximum)
                {
                    axpos = SLChartTool.GetOppositePosition(axpos);
                }
            }
            da.AxisPosition = new C.AxisPosition()
            {
                Val = axpos
            };

            if (this.ShowMajorGridlines)
            {
                da.MajorGridlines = this.MajorGridlines.ToMajorGridlines(IsStylish);
            }

            if (this.ShowMinorGridlines)
            {
                da.MinorGridlines = this.MinorGridlines.ToMinorGridlines(IsStylish);
            }

            if (this.ShowTitle)
            {
                da.Title = this.Title.ToTitle(IsStylish);
            }

            if (this.HasNumberingFormat)
            {
                da.NumberingFormat = new C.NumberingFormat()
                {
                    FormatCode   = this.FormatCode,
                    SourceLinked = this.SourceLinked
                };
            }

            da.MajorTickMark = new C.MajorTickMark()
            {
                Val = this.MajorTickMark
            };
            da.MinorTickMark = new C.MinorTickMark()
            {
                Val = this.MinorTickMark
            };
            da.TickLabelPosition = new C.TickLabelPosition()
            {
                Val = this.TickLabelPosition
            };

            if (this.ShapeProperties.HasShapeProperties)
            {
                da.ChartShapeProperties = this.ShapeProperties.ToChartShapeProperties(IsStylish);
            }

            if (this.Rotation != null || this.Vertical != null || this.Anchor != null || this.AnchorCenter != null)
            {
                da.TextProperties = new C.TextProperties();
                da.TextProperties.BodyProperties = new A.BodyProperties();
                if (this.Rotation != null)
                {
                    da.TextProperties.BodyProperties.Rotation = (int)(this.Rotation.Value * SLConstants.DegreeToAngleRepresentation);
                }
                if (this.Vertical != null)
                {
                    da.TextProperties.BodyProperties.Vertical = this.Vertical.Value;
                }
                if (this.Anchor != null)
                {
                    da.TextProperties.BodyProperties.Anchor = this.Anchor.Value;
                }
                if (this.AnchorCenter != null)
                {
                    da.TextProperties.BodyProperties.AnchorCenter = this.AnchorCenter.Value;
                }

                da.TextProperties.ListStyle = new A.ListStyle();

                A.Paragraph para = new A.Paragraph();
                para.ParagraphProperties = new A.ParagraphProperties();
                para.ParagraphProperties.Append(new A.DefaultRunProperties());
                da.TextProperties.Append(para);
            }
            else if (IsStylish)
            {
                da.TextProperties = new C.TextProperties();
                da.TextProperties.BodyProperties = new A.BodyProperties()
                {
                    Rotation            = -60000000,
                    UseParagraphSpacing = true,
                    VerticalOverflow    = A.TextVerticalOverflowValues.Ellipsis,
                    Vertical            = A.TextVerticalValues.Horizontal,
                    Wrap         = A.TextWrappingValues.Square,
                    Anchor       = A.TextAnchoringTypeValues.Center,
                    AnchorCenter = true
                };
                da.TextProperties.ListStyle = new A.ListStyle();

                A.Paragraph para = new A.Paragraph();
                para.ParagraphProperties = new A.ParagraphProperties();

                A.DefaultRunProperties defrunprops = new A.DefaultRunProperties();
                defrunprops.FontSize  = 900;
                defrunprops.Bold      = false;
                defrunprops.Italic    = false;
                defrunprops.Underline = A.TextUnderlineValues.None;
                defrunprops.Strike    = A.TextStrikeValues.NoStrike;
                defrunprops.Kerning   = 1200;
                defrunprops.Baseline  = 0;

                A.SchemeColor schclr = new A.SchemeColor()
                {
                    Val = A.SchemeColorValues.Text1
                };
                schclr.Append(new A.LuminanceModulation()
                {
                    Val = 65000
                });
                schclr.Append(new A.LuminanceOffset()
                {
                    Val = 35000
                });
                defrunprops.Append(new A.SolidFill()
                {
                    SchemeColor = schclr
                });

                defrunprops.Append(new A.LatinFont()
                {
                    Typeface = "+mn-lt"
                });
                defrunprops.Append(new A.EastAsianFont()
                {
                    Typeface = "+mn-ea"
                });
                defrunprops.Append(new A.ComplexScriptFont()
                {
                    Typeface = "+mn-cs"
                });

                para.ParagraphProperties.Append(defrunprops);
                para.Append(new A.EndParagraphRunProperties()
                {
                    Language = System.Globalization.CultureInfo.CurrentCulture.Name
                });

                da.TextProperties.Append(para);
            }

            da.CrossingAxis = new C.CrossingAxis()
            {
                Val = this.CrossingAxis
            };

            if (this.IsCrosses != null)
            {
                if (this.IsCrosses.Value)
                {
                    da.Append(new C.Crosses()
                    {
                        Val = this.Crosses
                    });
                }
                else
                {
                    da.Append(new C.CrossesAt()
                    {
                        Val = this.CrossesAt
                    });
                }
            }

            da.Append(new C.AutoLabeled()
            {
                Val = this.AutoLabeled
            });
            da.Append(new C.LabelOffset()
            {
                Val = this.LabelOffset
            });

            if (this.BaseUnit != null)
            {
                da.Append(new C.BaseTimeUnit()
                {
                    Val = this.BaseUnit.Value
                });
            }

            if (this.iMajorUnit != null)
            {
                da.Append(new C.MajorUnit()
                {
                    Val = this.iMajorUnit.Value
                });
                da.Append(new C.MajorTimeUnit()
                {
                    Val = this.vMajorTimeUnit
                });
            }

            if (this.iMinorUnit != null)
            {
                da.Append(new C.MinorUnit()
                {
                    Val = this.iMinorUnit.Value
                });
                da.Append(new C.MinorTimeUnit()
                {
                    Val = this.vMinorTimeUnit
                });
            }

            return(da);
        }
Пример #4
0
        internal C.DateAxis ToDateAxis()
        {
            C.DateAxis da = new C.DateAxis();
            da.AxisId = new C.AxisId() { Val = this.AxisId };

            da.Scaling = new C.Scaling();
            da.Scaling.Orientation = new C.Orientation() { Val = this.Orientation };
            if (this.LogBase != null) da.Scaling.LogBase = new C.LogBase() { Val = this.LogBase.Value };
            if (this.MaxAxisValue != null) da.Scaling.MaxAxisValue = new C.MaxAxisValue() { Val = this.MaxAxisValue.Value };
            if (this.MinAxisValue != null) da.Scaling.MinAxisValue = new C.MinAxisValue() { Val = this.MinAxisValue.Value };

            da.Delete = new C.Delete() { Val = this.Delete };

            C.AxisPositionValues axpos = this.AxisPosition;
            if (this.OtherAxisIsInReverseOrder) axpos = SLChartTool.GetOppositePosition(axpos);
            if (this.OtherAxisCrossedAtMaximum) axpos = SLChartTool.GetOppositePosition(axpos);
            da.AxisPosition = new C.AxisPosition() { Val = axpos };

            if (this.ShowMajorGridlines)
            {
                da.MajorGridlines = this.MajorGridlines.ToMajorGridlines();
            }

            if (this.ShowMinorGridlines)
            {
                da.MinorGridlines = this.MinorGridlines.ToMinorGridlines();
            }

            if (this.ShowTitle)
            {
                da.Title = this.Title.ToTitle();
            }

            if (this.HasNumberingFormat)
            {
                da.NumberingFormat = new C.NumberingFormat()
                {
                    FormatCode = this.FormatCode,
                    SourceLinked = this.SourceLinked
                };
            }

            da.MajorTickMark = new C.MajorTickMark() { Val = this.MajorTickMark };
            da.MinorTickMark = new C.MinorTickMark() { Val = this.MinorTickMark };
            da.TickLabelPosition = new C.TickLabelPosition() { Val = this.TickLabelPosition };

            if (this.ShapeProperties.HasShapeProperties) da.ChartShapeProperties = this.ShapeProperties.ToChartShapeProperties();

            if (this.Rotation != null || this.Vertical != null || this.Anchor != null || this.AnchorCenter != null)
            {
                da.TextProperties = new C.TextProperties();
                da.TextProperties.BodyProperties = new A.BodyProperties();
                if (this.Rotation != null) da.TextProperties.BodyProperties.Rotation = (int)(this.Rotation.Value * SLConstants.DegreeToAngleRepresentation);
                if (this.Vertical != null) da.TextProperties.BodyProperties.Vertical = this.Vertical.Value;
                if (this.Anchor != null) da.TextProperties.BodyProperties.Anchor = this.Anchor.Value;
                if (this.AnchorCenter != null) da.TextProperties.BodyProperties.AnchorCenter = this.AnchorCenter.Value;

                da.TextProperties.ListStyle = new A.ListStyle();

                A.Paragraph para = new A.Paragraph();
                para.ParagraphProperties = new A.ParagraphProperties();
                para.ParagraphProperties.Append(new A.DefaultRunProperties());
                da.TextProperties.Append(para);
            }

            da.CrossingAxis = new C.CrossingAxis() { Val = this.CrossingAxis };

            if (this.IsCrosses != null)
            {
                if (this.IsCrosses.Value)
                {
                    da.Append(new C.Crosses() { Val = this.Crosses });
                }
                else
                {
                    da.Append(new C.CrossesAt() { Val = this.CrossesAt });
                }
            }

            da.Append(new C.AutoLabeled() { Val = true });
            da.Append(new C.LabelOffset() { Val = this.LabelOffset });

            if (this.BaseUnit != null) da.Append(new C.BaseTimeUnit() { Val = this.BaseUnit.Value });

            if (this.iMajorUnit != null)
            {
                da.Append(new C.MajorUnit() { Val = this.iMajorUnit.Value });
                da.Append(new C.MajorTimeUnit() { Val = this.vMajorTimeUnit });
            }

            if (this.iMinorUnit != null)
            {
                da.Append(new C.MinorUnit() { Val = this.iMinorUnit.Value });
                da.Append(new C.MinorTimeUnit() { Val = this.vMinorTimeUnit });
            }

            return da;
        }