Beispiel #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;
        }
        protected CategoryAxis GenerateCategoryAxis(AxisId axisId, AxisPositionValues axisPosition, string formatCode, AxisId crossingAxisId)
        {
            CategoryAxis categoryAxis1 = new CategoryAxis();
            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 = axisPosition };
            NumberingFormat numberingFormat1 = new NumberingFormat() { FormatCode = formatCode, SourceLinked = true };
            TickLabelPosition tickLabelPosition1 = new TickLabelPosition() { Val = TickLabelPositionValues.Low };

            ChartShapeProperties chartShapeProperties5 = GenerateChartShapeProperties(3175);

            TextProperties textProperties1 = new TextProperties();
            A::BodyProperties bodyProperties2 = new A::BodyProperties() { Rotation = 0, 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();

            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 };
            LabelAlignment labelAlignment1 = new LabelAlignment() { Val = LabelAlignmentValues.Center };
            LabelOffset labelOffset1 = new LabelOffset() { Val = (UInt16Value)100U };
            TickLabelSkip tickLabelSkip1 = new TickLabelSkip() { Val = 1 };
            TickMarkSkip tickMarkSkip1 = new TickMarkSkip() { Val = 1 };

            categoryAxis1.Append(axisId3);
            categoryAxis1.Append(scaling1);
            categoryAxis1.Append(axisPosition1);
            categoryAxis1.Append(numberingFormat1);
            categoryAxis1.Append(tickLabelPosition1);
            categoryAxis1.Append(chartShapeProperties5);
            categoryAxis1.Append(textProperties1);
            categoryAxis1.Append(crossingAxis1);
            categoryAxis1.Append(crosses1);
            categoryAxis1.Append(autoLabeled1);
            categoryAxis1.Append(labelAlignment1);
            categoryAxis1.Append(labelOffset1);
            categoryAxis1.Append(tickLabelSkip1);
            categoryAxis1.Append(tickMarkSkip1);

            return categoryAxis1;
        }
        protected void AppendValueAxis(PlotArea plotArea, uint id, string name, uint crossingAxisId, AxisPositionValues axisPos = AxisPositionValues.Left, TickLabelPositionValues tickPos = TickLabelPositionValues.NextTo, bool showMajorGridlines = true)
        {
            List <OpenXmlElement> elements = GetAxisElements(id, name, crossingAxisId, tickPosition: tickPos);

            elements.Add(new AxisPosition {
                Val = new EnumValue <AxisPositionValues>(axisPos)
            });
            if (showMajorGridlines)
            {
                elements.Add(new MajorGridlines());
            }
            elements.Add(new DocumentFormat.OpenXml.Drawing.Charts.NumberingFormat()
            {
                FormatCode   = new StringValue("General"),
                SourceLinked = new BooleanValue(true)
            });
            elements.Add(new CrossBetween {
                Val = new EnumValue <CrossBetweenValues>(CrossBetweenValues.Between)
            });

            plotArea.AppendChild(new ValueAxis(elements));
        }
Beispiel #4
0
        protected ValueAxis GenerateValueAxis(AxisId axisId, AxisPositionValues position, string formatCode, AxisId crossingAxisId)
        {
            ValueAxis valueAxis1 = new ValueAxis();
            AxisId axisId4 = new AxisId() { Val = (UInt32Value)axisId.Val };

            Scaling scaling2 = new Scaling();
            Orientation orientation2 = new Orientation() { Val = OrientationValues.MinMax };

            scaling2.Append(orientation2);
            AxisPosition axisPosition2 = new AxisPosition() { Val = position };

            MajorGridlines majorGridlines1 = new MajorGridlines();

            ChartShapeProperties chartShapeProperties4 = GenerateChartShapeProperties(3175);

            majorGridlines1.Append(chartShapeProperties4);
            NumberingFormat numberingFormat2 = new NumberingFormat() { FormatCode = formatCode, SourceLinked = false };
            TickLabelPosition tickLabelPosition2 = new TickLabelPosition() { Val = TickLabelPositionValues.NextTo };

            ChartShapeProperties chartShapeProperties5 = GenerateChartShapeProperties(3175);

            TextProperties textProperties2 = new TextProperties();
            A::BodyProperties bodyProperties3 = new A::BodyProperties() { Rotation = 0, Vertical = A::TextVerticalValues.Horizontal };
            A::ListStyle listStyle3 = new A::ListStyle();

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

            A::ParagraphProperties paragraphProperties3 = new A::ParagraphProperties();

            A::DefaultRunProperties defaultRunProperties3 = new A::DefaultRunProperties() { Language = DEFAULT_LANG };

            A::SolidFill solidFill8 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex8 = new A::RgbColorModelHex() { Val = "000000" };

            solidFill8.Append(rgbColorModelHex8);

            paragraphProperties3.Append(defaultRunProperties3);
            A::EndParagraphRunProperties endParagraphRunProperties2 = new A::EndParagraphRunProperties() { Language = DEFAULT_LANG };

            paragraph3.Append(paragraphProperties3);
            paragraph3.Append(endParagraphRunProperties2);

            textProperties2.Append(bodyProperties3);
            textProperties2.Append(listStyle3);
            textProperties2.Append(paragraph3);
            CrossingAxis crossingAxis2 = new CrossingAxis() { Val = (UInt32Value)crossingAxisId.Val };
            Crosses crosses2 = new Crosses() { Val = CrossesValues.AutoZero };
            CrossBetween crossBetween1 = new CrossBetween() { Val = CrossBetweenValues.Between };

            valueAxis1.Append(axisId4);
            valueAxis1.Append(scaling2);
            valueAxis1.Append(axisPosition2);
            valueAxis1.Append(majorGridlines1);
            valueAxis1.Append(numberingFormat2);
            valueAxis1.Append(tickLabelPosition2);
            valueAxis1.Append(chartShapeProperties5);
            valueAxis1.Append(textProperties2);
            valueAxis1.Append(crossingAxis2);
            valueAxis1.Append(crosses2);
            valueAxis1.Append(crossBetween1);

            return valueAxis1;
        }
Beispiel #5
0
        protected ValueAxis GenerateValueAxis(AxisId axisId, AxisPositionValues position, AxisId crossingAxisId)
        {
            ValueAxis valueAxis1 = new ValueAxis();
            AxisId axisId4 = new AxisId() { Val = axisId.Val };

            Scaling scaling2 = new Scaling();
            Orientation orientation2 = new Orientation() { Val = OrientationValues.MinMax };

            scaling2.Append(orientation2);
            AxisPosition axisPosition2 = new AxisPosition() { Val = position };
            MajorGridlines majorGridlines1 = new MajorGridlines();
            NumberingFormat numberingFormat2 = new NumberingFormat() { FormatCode = valueAxisFormat, SourceLinked = false };
            MajorTickMark majorTickMark2 = new MajorTickMark() { Val = TickMarkValues.None };
            TickLabelPosition tickLabelPosition2 = new TickLabelPosition() { Val = TickLabelPositionValues.NextTo };

            ChartShapeProperties chartShapeProperties4 = GenerateChartShapeProperties(9525);

            TextProperties textProperties2 = new TextProperties();
            A::BodyProperties bodyProperties3 = new A::BodyProperties();
            A::ListStyle listStyle3 = new A::ListStyle();

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

            A::ParagraphProperties paragraphProperties3 = new A::ParagraphProperties();
            A::DefaultRunProperties defaultRunProperties3 = new A::DefaultRunProperties() { Language = DEFAULT_LANG };

            paragraphProperties3.Append(defaultRunProperties3);
            A::EndParagraphRunProperties endParagraphRunProperties2 = new A::EndParagraphRunProperties() { Language = DEFAULT_LANG };

            paragraph3.Append(paragraphProperties3);
            paragraph3.Append(endParagraphRunProperties2);

            textProperties2.Append(bodyProperties3);
            textProperties2.Append(listStyle3);
            textProperties2.Append(paragraph3);
            CrossingAxis crossingAxis2 = new CrossingAxis() { Val = crossingAxisId.Val };
            Crosses crosses2 = new Crosses() { Val = CrossesValues.AutoZero };
            CrossBetween crossBetween1 = new CrossBetween() { Val = CrossBetweenValues.Between };

            valueAxis1.Append(axisId4);
            valueAxis1.Append(scaling2);
            valueAxis1.Append(axisPosition2);
            valueAxis1.Append(majorGridlines1);
            valueAxis1.Append(numberingFormat2);
            valueAxis1.Append(majorTickMark2);
            valueAxis1.Append(tickLabelPosition2);
            valueAxis1.Append(chartShapeProperties4);
            valueAxis1.Append(textProperties2);
            valueAxis1.Append(crossingAxis2);
            valueAxis1.Append(crosses2);
            valueAxis1.Append(crossBetween1);

            return valueAxis1;
        }
        protected CategoryAxis GenerateCategoryAxis(AxisId axisId, AxisPositionValues axisPosition, string formatCode, AxisId crossingAxisId)
        {
            CategoryAxis categoryAxis1 = new CategoryAxis();
            AxisId axisId1 = 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 = formatCode, SourceLinked = true };
            TickLabelPosition tickLabelPosition1 = new TickLabelPosition() { Val = TickLabelPositionValues.Low };

            ChartShapeProperties chartShapeProperties1 = GenerateChartShapeProperties(3175);

            TextProperties textProperties1 = new TextProperties();
            A::BodyProperties bodyProperties1 = new A::BodyProperties() { Rotation = -1800000, Vertical = A::TextVerticalValues.Horizontal };
            A::ListStyle listStyle1 = new A::ListStyle();

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

            A::ParagraphProperties paragraphProperties1 = new A::ParagraphProperties();

            A::DefaultRunProperties defaultRunProperties1 = new A::DefaultRunProperties() { Language = DEFAULT_LANG, FontSize = 1000, Bold = false, Italic = false, Underline = A::TextUnderlineValues.None, Strike = A::TextStrikeValues.NoStrike, Baseline = 0 };

            A::SolidFill solidFill2 = new A::SolidFill();
            A::RgbColorModelHex rgbColorModelHex2 = new A::RgbColorModelHex() { Val = "000000" };

            solidFill2.Append(rgbColorModelHex2);

            defaultRunProperties1.Append(solidFill2);

            paragraphProperties1.Append(defaultRunProperties1);
            A::EndParagraphRunProperties endParagraphRunProperties1 = new A::EndParagraphRunProperties() { Language = DEFAULT_LANG };

            paragraph1.Append(paragraphProperties1);
            paragraph1.Append(endParagraphRunProperties1);

            textProperties1.Append(bodyProperties1);
            textProperties1.Append(listStyle1);
            textProperties1.Append(paragraph1);
            CrossingAxis crossingAxis1 = new CrossingAxis() { Val = (UInt32Value)crossingAxisId.Val };
            Crosses crosses1 = new Crosses() { Val = CrossesValues.AutoZero };
            AutoLabeled autoLabeled1 = new AutoLabeled() { Val = true };
            LabelAlignment labelAlignment1 = new LabelAlignment() { Val = LabelAlignmentValues.Center };
            LabelOffset labelOffset1 = new LabelOffset() { Val = (UInt16Value)100U };
            TickLabelSkip tickLabelSkip1 = new TickLabelSkip() { Val = 1 };
            TickMarkSkip tickMarkSkip1 = new TickMarkSkip() { Val = 1 };

            categoryAxis1.Append(axisId1);
            categoryAxis1.Append(scaling1);
            categoryAxis1.Append(axisPosition1);
            categoryAxis1.Append(numberingFormat1);
            categoryAxis1.Append(tickLabelPosition1);
            categoryAxis1.Append(chartShapeProperties1);
            categoryAxis1.Append(textProperties1);
            categoryAxis1.Append(crossingAxis1);
            categoryAxis1.Append(crosses1);
            categoryAxis1.Append(autoLabeled1);
            categoryAxis1.Append(labelAlignment1);
            categoryAxis1.Append(labelOffset1);
            categoryAxis1.Append(tickLabelSkip1);
            categoryAxis1.Append(tickMarkSkip1);

            return categoryAxis1;
        }