Ejemplo n.º 1
0
        internal SLTextAxis Clone()
        {
            var ta = new SLTextAxis(ShapeProperties.listThemeColors, Date1904);

            ta.Rotation     = Rotation;
            ta.Vertical     = Vertical;
            ta.Anchor       = Anchor;
            ta.AnchorCenter = AnchorCenter;
            ta.AxisId       = AxisId;
            ta.fLogBase     = fLogBase;
            ta.Orientation  = Orientation;
            ta.MaxAxisValue = MaxAxisValue;
            ta.MinAxisValue = MinAxisValue;
            ta.OtherAxisIsInReverseOrder = OtherAxisIsInReverseOrder;
            ta.OtherAxisCrossedAtMaximum = OtherAxisCrossedAtMaximum;
            ta.Delete             = Delete;
            ta.ForceAxisPosition  = ForceAxisPosition;
            ta.AxisPosition       = AxisPosition;
            ta.ShowMajorGridlines = ShowMajorGridlines;
            ta.MajorGridlines     = MajorGridlines.Clone();
            ta.ShowMinorGridlines = ShowMinorGridlines;
            ta.MinorGridlines     = MinorGridlines.Clone();
            ta.ShowTitle          = ShowTitle;
            ta.Title = Title.Clone();
            ta.HasNumberingFormat = HasNumberingFormat;
            ta.sFormatCode        = sFormatCode;
            ta.bSourceLinked      = bSourceLinked;
            ta.MajorTickMark      = MajorTickMark;
            ta.MinorTickMark      = MinorTickMark;
            ta.TickLabelPosition  = TickLabelPosition;
            ta.ShapeProperties    = ShapeProperties.Clone();
            ta.CrossingAxis       = CrossingAxis;
            ta.IsCrosses          = IsCrosses;
            ta.Crosses            = Crosses;
            ta.CrossesAt          = CrossesAt;
            ta.OtherAxisIsCrosses = OtherAxisIsCrosses;
            ta.OtherAxisCrosses   = OtherAxisCrosses;
            ta.OtherAxisCrossesAt = OtherAxisCrossesAt;

            ta.Date1904              = Date1904;
            ta.AxisType              = AxisType;
            ta.AutoLabeled           = AutoLabeled;
            ta.iTickLabelSkip        = iTickLabelSkip;
            ta.iTickMarkSkip         = iTickMarkSkip;
            ta.LabelAlignment        = LabelAlignment;
            ta.iLabelOffset          = iLabelOffset;
            ta.ValueMajorUnit        = ValueMajorUnit;
            ta.ValueMinorUnit        = ValueMinorUnit;
            ta.BuiltInUnitValues     = BuiltInUnitValues;
            ta.ShowDisplayUnitsLabel = ShowDisplayUnitsLabel;
            ta.BaseUnit              = BaseUnit;
            ta.iMajorUnit            = iMajorUnit;
            ta.vMajorTimeUnit        = vMajorTimeUnit;
            ta.iMinorUnit            = iMinorUnit;
            ta.vMinorTimeUnit        = vMinorTimeUnit;
            ta.CrossBetween          = CrossBetween;
            ta.NoMultiLevelLabels    = NoMultiLevelLabels;

            return(ta);
        }
        public MajorGridlines Build()
        {
            var majorGridlines = new MajorGridlines();

            if (this.Options.HasChartShapeProperties)
            {
                var chartShapePropertiesBuilder = new ChartShapePropertiesBuilder(this.Options.ChartShapePropertiesOptions);

                majorGridlines.ChartShapeProperties = chartShapePropertiesBuilder.Build();
            }

            return(majorGridlines);
        }
Ejemplo n.º 3
0
        internal SLValueAxis Clone()
        {
            var va = new SLValueAxis(ShapeProperties.listThemeColors);

            va.Rotation     = Rotation;
            va.Vertical     = Vertical;
            va.Anchor       = Anchor;
            va.AnchorCenter = AnchorCenter;
            va.AxisId       = AxisId;
            va.fLogBase     = fLogBase;
            va.Orientation  = Orientation;
            va.MaxAxisValue = MaxAxisValue;
            va.MinAxisValue = MinAxisValue;
            va.OtherAxisIsInReverseOrder = OtherAxisIsInReverseOrder;
            va.OtherAxisCrossedAtMaximum = OtherAxisCrossedAtMaximum;
            va.Delete             = Delete;
            va.ForceAxisPosition  = ForceAxisPosition;
            va.AxisPosition       = AxisPosition;
            va.ShowMajorGridlines = ShowMajorGridlines;
            va.MajorGridlines     = MajorGridlines.Clone();
            va.ShowMinorGridlines = ShowMinorGridlines;
            va.MinorGridlines     = MinorGridlines.Clone();
            va.ShowTitle          = ShowTitle;
            va.Title = Title.Clone();
            va.HasNumberingFormat = HasNumberingFormat;
            va.sFormatCode        = sFormatCode;
            va.bSourceLinked      = bSourceLinked;
            va.MajorTickMark      = MajorTickMark;
            va.MinorTickMark      = MinorTickMark;
            va.TickLabelPosition  = TickLabelPosition;
            va.ShapeProperties    = ShapeProperties.Clone();
            va.CrossingAxis       = CrossingAxis;
            va.IsCrosses          = IsCrosses;
            va.Crosses            = Crosses;
            va.CrossesAt          = CrossesAt;
            va.OtherAxisIsCrosses = OtherAxisIsCrosses;
            va.OtherAxisCrosses   = OtherAxisCrosses;
            va.OtherAxisCrossesAt = OtherAxisCrossesAt;

            va.CrossBetween          = CrossBetween;
            va.MajorUnit             = MajorUnit;
            va.MinorUnit             = MinorUnit;
            va.BuiltInUnitValues     = BuiltInUnitValues;
            va.ShowDisplayUnitsLabel = ShowDisplayUnitsLabel;

            return(va);
        }
Ejemplo n.º 4
0
        internal SLSeriesAxis Clone()
        {
            var sa = new SLSeriesAxis(ShapeProperties.listThemeColors);

            sa.Rotation     = Rotation;
            sa.Vertical     = Vertical;
            sa.Anchor       = Anchor;
            sa.AnchorCenter = AnchorCenter;
            sa.AxisId       = AxisId;
            sa.fLogBase     = fLogBase;
            sa.Orientation  = Orientation;
            sa.MaxAxisValue = MaxAxisValue;
            sa.MinAxisValue = MinAxisValue;
            sa.OtherAxisIsInReverseOrder = OtherAxisIsInReverseOrder;
            sa.OtherAxisCrossedAtMaximum = OtherAxisCrossedAtMaximum;
            sa.Delete             = Delete;
            sa.ForceAxisPosition  = ForceAxisPosition;
            sa.AxisPosition       = AxisPosition;
            sa.ShowMajorGridlines = ShowMajorGridlines;
            sa.MajorGridlines     = MajorGridlines.Clone();
            sa.ShowMinorGridlines = ShowMinorGridlines;
            sa.MinorGridlines     = MinorGridlines.Clone();
            sa.ShowTitle          = ShowTitle;
            sa.Title = Title.Clone();
            sa.HasNumberingFormat = HasNumberingFormat;
            sa.sFormatCode        = sFormatCode;
            sa.bSourceLinked      = bSourceLinked;
            sa.MajorTickMark      = MajorTickMark;
            sa.MinorTickMark      = MinorTickMark;
            sa.TickLabelPosition  = TickLabelPosition;
            sa.ShapeProperties    = ShapeProperties.Clone();
            sa.CrossingAxis       = CrossingAxis;
            sa.IsCrosses          = IsCrosses;
            sa.Crosses            = Crosses;
            sa.CrossesAt          = CrossesAt;
            sa.OtherAxisIsCrosses = OtherAxisIsCrosses;
            sa.OtherAxisCrosses   = OtherAxisCrosses;
            sa.OtherAxisCrossesAt = OtherAxisCrossesAt;

            sa.iTickLabelSkip = iTickLabelSkip;
            sa.iTickMarkSkip  = iTickMarkSkip;

            return(sa);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Design settings for Y axis.
        /// </summary>
        public ValueAxis SetGanttValueAxis(PlotArea plotArea, TimeSpan minSpan, TimeSpan maxSpan)
        {
            MajorGridlines       majorGridlines1       = new MajorGridlines();
            ChartShapeProperties chartShapeProperties2 = new ChartShapeProperties();
            Outline     outline2     = new Outline();
            SolidFill   solidFill2   = new SolidFill();
            SchemeColor schemeColor2 = new SchemeColor()
            {
                Val = SchemeColorValues.Accent1
            };
            Alpha alpha1 = new Alpha()
            {
                Val = 10000
            };

            schemeColor2.Append(alpha1);
            solidFill2.Append(schemeColor2);
            outline2.Append(solidFill2);
            chartShapeProperties2.Append(outline2);
            majorGridlines1.Append(chartShapeProperties2);

            return(plotArea.AppendChild <ValueAxis>(new ValueAxis(new AxisId()
            {
                Val = new UInt32Value(48672768u)
            },
                                                                  new Scaling(new Orientation()
            {
                Val = new EnumValue <DocumentFormat.OpenXml.Drawing.Charts.OrientationValues>(
                    DocumentFormat.OpenXml.Drawing.Charts.OrientationValues.MinMax)
            }, new MinAxisValue()
            {
                Val = 0
            }, new MaxAxisValue()
            {
                Val = 0.99
            }),
                                                                  new Delete()
            {
                Val = false
            },
                                                                  new AxisPosition()
            {
                Val = new EnumValue <AxisPositionValues>(AxisPositionValues.Left)
            },
                                                                  majorGridlines1,
                                                                  new MajorTickMark()
            {
                Val = TickMarkValues.None
            },
                                                                  new MinorTickMark()
            {
                Val = TickMarkValues.None
            },
                                                                  new MajorUnit()
            {
                Val = 4.1666666666666713E-2D
            },
                                                                  new DocumentFormat.OpenXml.Drawing.Charts.NumberingFormat()
            {
                FormatCode = "h:mm;@", SourceLinked = false
            },
                                                                  new TickLabelPosition()
            {
                Val = new EnumValue <TickLabelPositionValues>
                          (TickLabelPositionValues.NextTo)
            }, new CrossingAxis()
            {
                Val = new UInt32Value(48650112U)
            },
                                                                  new Crosses()
            {
                Val = new EnumValue <CrossesValues>(CrossesValues.AutoZero)
            },
                                                                  new CrossBetween()
            {
                Val = new EnumValue <CrossBetweenValues>(CrossBetweenValues.Between)
            })));
        }
Ejemplo n.º 6
0
        internal C.ValueAxis ToValueAxis(bool IsStylish = false)
        {
            var va = new C.ValueAxis();

            va.AxisId = new C.AxisId {
                Val = AxisId
            };

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

            va.Delete = new C.Delete {
                Val = Delete
            };

            var axpos = AxisPosition;

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

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

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

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

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

            va.MajorTickMark = new C.MajorTickMark {
                Val = MajorTickMark
            };
            va.MinorTickMark = new C.MinorTickMark {
                Val = MinorTickMark
            };
            va.TickLabelPosition = new C.TickLabelPosition {
                Val = TickLabelPosition
            };

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

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

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

                var para = new A.Paragraph();
                para.ParagraphProperties = new A.ParagraphProperties();
                para.ParagraphProperties.Append(new A.DefaultRunProperties());
                va.TextProperties.Append(para);
            }
            else if (IsStylish)
            {
                va.TextProperties = new C.TextProperties();
                va.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
                };
                va.TextProperties.ListStyle = new A.ListStyle();

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

                var 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;

                var 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 = CultureInfo.CurrentCulture.Name
                });

                va.TextProperties.Append(para);
            }

            va.CrossingAxis = new C.CrossingAxis {
                Val = CrossingAxis
            };

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

            va.Append(new C.CrossBetween {
                Val = CrossBetween
            });
            if (MajorUnit != null)
            {
                va.Append(new C.MajorUnit {
                    Val = MajorUnit.Value
                });
            }
            if (MinorUnit != null)
            {
                va.Append(new C.MinorUnit {
                    Val = MinorUnit.Value
                });
            }

            if (BuiltInUnitValues != null)
            {
                var du = new C.DisplayUnits();
                du.Append(new C.BuiltInUnit {
                    Val = BuiltInUnitValues.Value
                });
                if (ShowDisplayUnitsLabel)
                {
                    var dul = new C.DisplayUnitsLabel();
                    dul.Layout = new C.Layout();
                    du.Append(dul);
                }
                va.Append(du);
            }

            return(va);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Design settings for Y axis.
        /// </summary>
        public virtual ValueAxis SetValueAxis(PlotArea plotArea)
        {
            // Postavljanje Gridline-a.
            MajorGridlines       majorGridlines       = new MajorGridlines();
            ChartShapeProperties chartShapeProperties = new ChartShapeProperties();
            Outline     outline     = new Outline();
            SolidFill   solidFill   = new SolidFill();
            SchemeColor schemeColor = new SchemeColor()
            {
                Val = SchemeColorValues.Accent1
            };
            Alpha alpha = new Alpha()
            {
                Val = 10000
            };

            schemeColor.Append(alpha);
            solidFill.Append(schemeColor);
            outline.Append(solidFill);
            chartShapeProperties.Append(outline);
            majorGridlines.Append(chartShapeProperties);

            var valueAxis = plotArea.AppendChild <ValueAxis>(new ValueAxis(
                                                                 new AxisId()
            {
                Val = new UInt32Value(48672768u)
            },
                                                                 new Scaling(new Orientation()
            {
                Val = new EnumValue <DocumentFormat.OpenXml.Drawing.Charts.OrientationValues>(
                    DocumentFormat.OpenXml.Drawing.Charts.OrientationValues.MinMax)
            }),
                                                                 new Delete()
            {
                Val = !ChartProperties.AxisY
            },
                                                                 new AxisPosition()
            {
                Val = new EnumValue <AxisPositionValues>(AxisPositionValues.Left)
            },
                                                                 majorGridlines,
                                                                 SetTitle(ChartProperties.AxisYTitle),
                                                                 new NumberingFormat()
            {
                FormatCode   = ChartProperties.AxisYFormatCode,
                SourceLinked = new BooleanValue(true)
            },
                                                                 new MajorTickMark()
            {
                Val = TickMarkValues.None
            },
                                                                 new MinorTickMark()
            {
                Val = TickMarkValues.None
            },
                                                                 new TickLabelPosition()
            {
                Val = new EnumValue <TickLabelPositionValues>
                          (TickLabelPositionValues.NextTo)
            }, new CrossingAxis()
            {
                Val = new UInt32Value(48650112U)
            },
                                                                 new Crosses()
            {
                Val = new EnumValue <CrossesValues>(CrossesValues.AutoZero)
            },
                                                                 new CrossBetween()
            {
                Val = new EnumValue <CrossBetweenValues>(CrossBetweenValues.Between)
            }));

            if (ChartProperties.AxisYFormatCategory == "Time")
            {
                valueAxis.Append(new MajorUnit()
                {
                    Val = getMajorUnitFromSeconds((int)yAxisValue)
                });
            }

            return(valueAxis);
        }