From 1fda0efe82fa5d148db023c2f1280c329c625bf5 Mon Sep 17 00:00:00 2001 From: vderyushev Date: Fri, 4 Oct 2024 17:34:02 +0300 Subject: [PATCH 1/6] Updated examples --- .../Join and append documents.cs | 60 +++++++++++-------- .../Working with List.cs | 26 ++++---- 2 files changed, 50 insertions(+), 36 deletions(-) diff --git a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs index 9af5c5f80..b37fdd5b9 100644 --- a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs +++ b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Drawing; using System.Text; using Aspose.Words; using Aspose.Words.Fields; @@ -336,7 +337,7 @@ public void KeepSourceTogether() dstDoc.Save(ArtifactsDir + "JoinAndAppendDocuments.KeepSourceTogether.docx"); //ExEnd:KeepSourceTogether - } + } [Test] public void ListKeepSourceFormatting() @@ -460,17 +461,31 @@ public void UseDestinationStyles() public void SmartStyleBehavior() { //ExStart:SmartStyleBehavior - Document srcDoc = new Document(MyDir + "Document source.docx"); - Document dstDoc = new Document(MyDir + "Northwind traders.docx"); + Document dstDoc = new Document(); DocumentBuilder builder = new DocumentBuilder(dstDoc); - - builder.MoveToDocumentEnd(); - builder.InsertBreak(BreakType.PageBreak); - ImportFormatOptions options = new ImportFormatOptions { SmartStyleBehavior = true }; + Style myStyle = builder.Document.Styles.Add(StyleType.Paragraph, "MyStyle"); + myStyle.Font.Size = 14; + myStyle.Font.Name = "Courier New"; + myStyle.Font.Color = Color.Blue; + + builder.ParagraphFormat.StyleName = myStyle.Name; + builder.Writeln("Hello world!"); + + // Clone the document and edit the clone's "MyStyle" style, so it is a different color than that of the original. + // If we insert the clone into the original document, the two styles with the same name will cause a clash. + Document srcDoc = dstDoc.Clone(); + srcDoc.Styles["MyStyle"].Font.Color = Color.Red; - builder.InsertDocument(srcDoc, ImportFormatMode.UseDestinationStyles, options); - builder.Document.Save(ArtifactsDir + "JoinAndAppendDocuments.SmartStyleBehavior.docx"); + // When we enable SmartStyleBehavior and use the KeepSourceFormatting import format mode, + // Aspose.Words will resolve style clashes by converting source document styles. + // with the same names as destination styles into direct paragraph attributes. + ImportFormatOptions options = new ImportFormatOptions(); + options.SmartStyleBehavior = true; + + builder.InsertDocument(srcDoc, ImportFormatMode.KeepSourceFormatting, options); + + dstDoc.Save(ArtifactsDir + "DocumentBuilder.SmartStyleBehavior.docx"); //ExEnd:SmartStyleBehavior } @@ -520,21 +535,18 @@ public void InsertDocumentInline() public void KeepSourceNumbering() { //ExStart:KeepSourceNumbering - Document srcDoc = new Document(MyDir + "Document source.docx"); - Document dstDoc = new Document(MyDir + "Northwind traders.docx"); - - // Keep source list formatting when importing numbered paragraphs. - ImportFormatOptions importFormatOptions = new ImportFormatOptions { KeepSourceNumbering = true }; - - NodeImporter importer = new NodeImporter(srcDoc, dstDoc, ImportFormatMode.KeepSourceFormatting, - importFormatOptions); - - ParagraphCollection srcParas = srcDoc.FirstSection.Body.Paragraphs; - foreach (Paragraph srcPara in srcParas) - { - Node importedNode = importer.ImportNode(srcPara, false); - dstDoc.FirstSection.Body.AppendChild(importedNode); - } + Document srcDoc = new Document(MyDir + "List source.docx"); + Document dstDoc = new Document(MyDir + "List destination.docx"); + + ImportFormatOptions options = new ImportFormatOptions(); + // If there is a clash of list styles, apply the list format of the source document. + // Set the "KeepSourceNumbering" property to "false" to not import any list numbers into the destination document. + // Set the "KeepSourceNumbering" property to "true" import all clashing + // list style numbering with the same appearance that it had in the source document. + options.KeepSourceNumbering = true; + + dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting, options); + dstDoc.UpdateListLabels(); dstDoc.Save(ArtifactsDir + "JoinAndAppendDocuments.KeepSourceNumbering.docx"); //ExEnd:KeepSourceNumbering diff --git a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs index aecc313f9..aba3015a4 100644 --- a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs +++ b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs @@ -14,27 +14,29 @@ public void RestartListAtEachSection() { //ExStart:RestartListAtEachSection Document doc = new Document(); - + DocumentBuilder builder = new DocumentBuilder(doc); + doc.Lists.Add(ListTemplate.NumberDefault); List list = doc.Lists[0]; list.IsRestartAtEachSection = true; - DocumentBuilder builder = new DocumentBuilder(doc); - builder.ListFormat.List = list; - - for (int i = 1; i < 45; i++) + // The "IsRestartAtEachSection" property will only be applicable when + // the document's OOXML compliance level is to a standard that is newer than "OoxmlComplianceCore.Ecma376". + OoxmlSaveOptions options = new OoxmlSaveOptions { - builder.Writeln($"List Item {i}"); + Compliance = OoxmlCompliance.Iso29500_2008_Transitional + }; - if (i == 15) - builder.InsertBreak(BreakType.SectionBreakNewPage); - } + builder.ListFormat.List = list; - // IsRestartAtEachSection will be written only if compliance is higher then OoxmlComplianceCore.Ecma376. - OoxmlSaveOptions options = new OoxmlSaveOptions { Compliance = OoxmlCompliance.Iso29500_2008_Transitional }; + builder.Writeln("List item 1"); + builder.Writeln("List item 2"); + builder.InsertBreak(BreakType.SectionBreakNewPage); + builder.Writeln("List item 3"); + builder.Writeln("List item 4"); - doc.Save(ArtifactsDir + "WorkingWithList.RestartListAtEachSection.docx", options); + doc.Save(ArtifactsDir + "OoxmlSaveOptions.RestartingDocumentList.docx", options); //ExEnd:RestartListAtEachSection } From 20a23f8c29cb6f0440efacb80dfd9072127dc5cf Mon Sep 17 00:00:00 2001 From: vderyushev Date: Fri, 4 Oct 2024 18:03:12 +0300 Subject: [PATCH 2/6] Updated API examples --- Examples/ApiExamples/ApiExamples/ExCharts.cs | 55 ++++++++++++++++ .../ApiExamples/ExMarkdownSaveOptions.cs | 36 +++++++++++ .../ApiExamples/ExPdfSaveOptions.cs | 2 +- Examples/ApiExamples/ApiExamples/ExShape.cs | 64 +++++++++++++++++++ 4 files changed, 156 insertions(+), 1 deletion(-) diff --git a/Examples/ApiExamples/ApiExamples/ExCharts.cs b/Examples/ApiExamples/ApiExamples/ExCharts.cs index 50ad4b427..390394735 100644 --- a/Examples/ApiExamples/ApiExamples/ExCharts.cs +++ b/Examples/ApiExamples/ApiExamples/ExCharts.cs @@ -2243,5 +2243,60 @@ public void TickLabelsOrientationRotation() doc.Save(ArtifactsDir + "Charts.TickLabelsOrientationRotation.docx"); //ExEnd:TickLabelsOrientationRotation } + + [Test] + public void DoughnutChart() + { + //ExStart:DoughnutChart + //GistId:bb594993b5fe48692541e16f4d354ac2 + //ExFor:ChartSeriesGroup.DoughnutHoleSize + //ExFor:ChartSeriesGroup.FirstSliceAngle + //ExSummary:Shows how to create and format Doughnut chart. + Document doc = new Document(); + DocumentBuilder builder = new DocumentBuilder(doc); + + Shape shape = builder.InsertChart(ChartType.Doughnut, 400, 400); + Chart chart = shape.Chart; + // Delete the default generated series. + chart.Series.Clear(); + + string[] categories = new string[] { "Category 1", "Category 2", "Category 3" }; + chart.Series.Add("Series 1", categories, new double[] { 4, 2, 5 }); + + // Format the Doughnut chart. + ChartSeriesGroup seriesGroup = chart.SeriesGroups[0]; + seriesGroup.DoughnutHoleSize = 10; + seriesGroup.FirstSliceAngle = 270; + + doc.Save(ArtifactsDir + "Charts.DoughnutChart.docx"); + //ExEnd:DoughnutChart + } + + [Test] + public void PieOfPieChart() + { + //ExStart:PieOfPieChart + //GistId:bb594993b5fe48692541e16f4d354ac2 + //ExFor:ChartSeriesGroup.SecondSectionSize + //ExSummary:Shows how to create and format pie of Pie chart. + Document doc = new Document(); + DocumentBuilder builder = new DocumentBuilder(doc); + + Shape shape = builder.InsertChart(ChartType.PieOfPie, 440, 300); + Chart chart = shape.Chart; + // Delete the default generated series. + chart.Series.Clear(); + + string[] categories = new string[] { "Category 1", "Category 2", "Category 3", "Category 4" }; + chart.Series.Add("Series 1", categories, new double[] { 11, 8, 4, 3 }); + + // Format the Pie of Pie chart. + ChartSeriesGroup seriesGroup = chart.SeriesGroups[0]; + seriesGroup.GapWidth = 10; + seriesGroup.SecondSectionSize = 77; + + doc.Save(ArtifactsDir + "Charts.PieOfPieChart.docx"); + //ExEnd:PieOfPieChart + } } } diff --git a/Examples/ApiExamples/ApiExamples/ExMarkdownSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExMarkdownSaveOptions.cs index c901545ae..960fdd41f 100644 --- a/Examples/ApiExamples/ApiExamples/ExMarkdownSaveOptions.cs +++ b/Examples/ApiExamples/ApiExamples/ExMarkdownSaveOptions.cs @@ -245,6 +245,42 @@ public void LinkExportMode() string outDocContents = File.ReadAllText(ArtifactsDir + "MarkdownSaveOptions.LinkExportMode.Inline.md"); Assert.AreEqual("![](MarkdownSaveOptions.LinkExportMode.Inline.001.png)", outDocContents.Trim()); } + + [Test] + public void ExportTableAsHtml() + { + //ExStart:ExportTableAsHtml + //GistId:bb594993b5fe48692541e16f4d354ac2 + //ExFor:MarkdownExportAsHtml + //ExFor:MarkdownSaveOptions.ExportAsHtml + //ExSummary:Shows how to export a table to Markdown as raw HTML. + Document doc = new Document(); + DocumentBuilder builder = new DocumentBuilder(doc); + + builder.Writeln("Sample table:"); + + // Create table. + builder.InsertCell(); + builder.ParagraphFormat.Alignment = ParagraphAlignment.Right; + builder.Write("Cell1"); + builder.InsertCell(); + builder.ParagraphFormat.Alignment = ParagraphAlignment.Center; + builder.Write("Cell2"); + + MarkdownSaveOptions saveOptions = new MarkdownSaveOptions(); + saveOptions.ExportAsHtml = MarkdownExportAsHtml.Tables; + + doc.Save(ArtifactsDir + "MarkdownSaveOptions.ExportTableAsHtml.md", saveOptions); + //ExEnd:ExportTableAsHtml + + string outDocContents = File.ReadAllText(ArtifactsDir + "MarkdownSaveOptions.ExportTableAsHtml.md"); + Assert.AreEqual("Sample table:\r\n" + + "
" + + "

Cell1

" + + "
" + + "

Cell2

" + + "
", outDocContents.Trim()); + } } } diff --git a/Examples/ApiExamples/ApiExamples/ExPdfSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExPdfSaveOptions.cs index 2ee9394bf..3f5072675 100644 --- a/Examples/ApiExamples/ApiExamples/ExPdfSaveOptions.cs +++ b/Examples/ApiExamples/ApiExamples/ExPdfSaveOptions.cs @@ -547,7 +547,7 @@ public void UsePdfDocumentForCompliance(PdfCompliance pdfCompliance) Assert.AreEqual("2.0", pdfDocument.Version); break; case PdfCompliance.PdfA4: - Assert.AreEqual(PdfFormat.v_2_0, pdfDocument.PdfFormat); + Assert.AreEqual(PdfFormat.PDF_A_4, pdfDocument.PdfFormat); Assert.AreEqual("2.0", pdfDocument.Version); break; case PdfCompliance.PdfA4Ua2: diff --git a/Examples/ApiExamples/ApiExamples/ExShape.cs b/Examples/ApiExamples/ApiExamples/ExShape.cs index 3a522742b..12e36cfce 100644 --- a/Examples/ApiExamples/ApiExamples/ExShape.cs +++ b/Examples/ApiExamples/ApiExamples/ExShape.cs @@ -3400,5 +3400,69 @@ public void InsertGroupShape() doc.Save(ArtifactsDir + "Shape.InsertGroupShape.docx"); //ExEnd:InsertGroupShape } + + [Test] + public void CombineGroupShape() + { + //ExStart:CombineGroupShape + //GistId:bb594993b5fe48692541e16f4d354ac2 + //ExFor:DocumentBuilder.InsertGroupShape(Shape[]) + //ExSummary:Shows how to combine group shape with the shape. + Document doc = new Document(); + DocumentBuilder builder = new DocumentBuilder(doc); + + Shape shape1 = builder.InsertShape(ShapeType.Rectangle, 200, 250); + shape1.Left = 20; + shape1.Top = 20; + shape1.Stroke.Color = Color.Red; + + Shape shape2 = builder.InsertShape(ShapeType.Ellipse, 150, 200); + shape2.Left = 40; + shape2.Top = 50; + shape2.Stroke.Color = Color.Green; + + // Combine shapes into a GroupShape node which is inserted into the specified position. + GroupShape groupShape1 = builder.InsertGroupShape(shape1, shape2); + + // Combine Shape and GroupShape nodes. + Shape shape3 = (Shape)shape1.Clone(true); + GroupShape groupShape2 = builder.InsertGroupShape(groupShape1, shape3); + + doc.Save(ArtifactsDir + "Shape.CombineGroupShape.docx"); + //ExEnd:CombineGroupShape + } + + [Test] + public void InsertCommandButton() + { + //ExStart:InsertCommandButton + //GistId:bb594993b5fe48692541e16f4d354ac2 + //ExFor:CommandButtonControl + //ExFor:DocumentBuilder.InsertForms2OleControl(Forms2OleControl) + //ExSummary:Shows how to insert ActiveX control. + DocumentBuilder builder = new DocumentBuilder(); + + CommandButtonControl button1 = new CommandButtonControl(); + Shape shape = builder.InsertForms2OleControl(button1); + Assert.AreEqual(Forms2OleControlType.CommandButton, ((Forms2OleControl)shape.OleFormat.OleControl).Type); + //ExEnd:InsertCommandButton + } + + [Test] + public void Hidden() + { + //ExStart:Hidden + //GistId:bb594993b5fe48692541e16f4d354ac2 + //ExFor:ShapeBase.Hidden + //ExSummary:Shows how to hide the shape. + Document doc = new Document(MyDir + "Shadow color.docx"); + + Shape shape = (Shape)doc.GetChild(NodeType.Shape, 0, true); + if (!shape.Hidden) + shape.Hidden = true; + + doc.Save(ArtifactsDir + "Shape.Hidden.docx"); + //ExEnd:Hidden + } } } From 582177e5987a6fac0496d9b96987cc325d4af769 Mon Sep 17 00:00:00 2001 From: vderyushev Date: Sun, 6 Oct 2024 13:50:00 +0300 Subject: [PATCH 3/6] Fixed EpubHeadings test --- .../ApiExamples/ApiExamples/ExHtmlSaveOptions.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs b/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs index 4c24f4d03..f92fca428 100644 --- a/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs +++ b/Examples/ApiExamples/ApiExamples/ExHtmlSaveOptions.cs @@ -868,24 +868,24 @@ public void EpubHeadings() //ExEnd TestUtil.DocPackageFileContainsString("Heading #1", - ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx"); + ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx"); TestUtil.DocPackageFileContainsString("Heading #2", - ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx"); + ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx"); TestUtil.DocPackageFileContainsString("Heading #4", - ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx"); + ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx"); TestUtil.DocPackageFileContainsString("Heading #5", - ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx"); + ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx"); Assert.Throws(() => { TestUtil.DocPackageFileContainsString("Heading #3", - ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx"); + ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx"); }); Assert.Throws(() => { TestUtil.DocPackageFileContainsString("Heading #6", - ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "HtmlSaveOptions.EpubHeadings.ncx"); + ArtifactsDir + "HtmlSaveOptions.EpubHeadings.epub", "toc.ncx"); }); } From b364acce79becf82bc853ad67e50545aeaf006c8 Mon Sep 17 00:00:00 2001 From: vderyushev Date: Mon, 7 Oct 2024 11:07:10 +0300 Subject: [PATCH 4/6] Fixed ExFor tags --- Examples/ApiExamples/ApiExamples/ExShape.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Examples/ApiExamples/ApiExamples/ExShape.cs b/Examples/ApiExamples/ApiExamples/ExShape.cs index 12e36cfce..bb54bff7c 100644 --- a/Examples/ApiExamples/ApiExamples/ExShape.cs +++ b/Examples/ApiExamples/ApiExamples/ExShape.cs @@ -3369,8 +3369,8 @@ public void InsertGroupShape() { //ExStart:InsertGroupShape //GistId:e06aa7a168b57907a5598e823a22bf0a - //ExFor:DocumentBuilder.InsertGroupShape(double, double, double, double, Shape[]) - //ExFor:DocumentBuilder.InsertGroupShape(Shape[]) + //ExFor:DocumentBuilder.InsertGroupShape(double, double, double, double, ShapeBase[]) + //ExFor:DocumentBuilder.InsertGroupShape(ShapeBase[]) //ExSummary:Shows how to insert DML group shape. Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); @@ -3406,7 +3406,7 @@ public void CombineGroupShape() { //ExStart:CombineGroupShape //GistId:bb594993b5fe48692541e16f4d354ac2 - //ExFor:DocumentBuilder.InsertGroupShape(Shape[]) + //ExFor:DocumentBuilder.InsertGroupShape(ShapeBase[]) //ExSummary:Shows how to combine group shape with the shape. Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); From 559fb0e8a03276dc2cba694c6eb128bf91a3060b Mon Sep 17 00:00:00 2001 From: vderyushev Date: Mon, 7 Oct 2024 13:49:59 +0300 Subject: [PATCH 5/6] Fixed names --- .../Working with Document/Join and append documents.cs | 2 +- .../Programming with Documents/Working with List.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs index b37fdd5b9..ed986d599 100644 --- a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs +++ b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with Document/Join and append documents.cs @@ -485,7 +485,7 @@ public void SmartStyleBehavior() builder.InsertDocument(srcDoc, ImportFormatMode.KeepSourceFormatting, options); - dstDoc.Save(ArtifactsDir + "DocumentBuilder.SmartStyleBehavior.docx"); + dstDoc.Save(ArtifactsDir + "JoinAndAppendDocuments.SmartStyleBehavior.docx"); //ExEnd:SmartStyleBehavior } diff --git a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs index aba3015a4..9fafafeec 100644 --- a/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs +++ b/Examples/DocsExamples/DocsExamples/Programming with Documents/Working with List.cs @@ -36,7 +36,7 @@ public void RestartListAtEachSection() builder.Writeln("List item 3"); builder.Writeln("List item 4"); - doc.Save(ArtifactsDir + "OoxmlSaveOptions.RestartingDocumentList.docx", options); + doc.Save(ArtifactsDir + "WorkingWithList.RestartingDocumentList.docx", options); //ExEnd:RestartListAtEachSection } From 5a441e79bace60efa949faf003b799688fd692e8 Mon Sep 17 00:00:00 2001 From: vderyushev Date: Mon, 14 Oct 2024 11:28:30 +0300 Subject: [PATCH 6/6] Updated API examples 24.10 --- .../ApiExamples/ApiExamples.csproj | 14 +++++----- Examples/ApiExamples/Runner.MAUI/ExCharts.cs | 28 +++++++++---------- .../Runner.MAUI/Runner.MAUI.csproj | 12 ++++---- Examples/DocsExamples/Docker/Docker.csproj | 2 +- .../DocsExamples/DocsExamples.csproj | 10 +++---- .../DocumentExplorer/DocumentExplorer.csproj | 2 +- .../PluginsExamples/PluginsExamples.csproj | 2 +- 7 files changed, 35 insertions(+), 35 deletions(-) diff --git a/Examples/ApiExamples/ApiExamples/ApiExamples.csproj b/Examples/ApiExamples/ApiExamples/ApiExamples.csproj index 6842a715e..91fdce50e 100644 --- a/Examples/ApiExamples/ApiExamples/ApiExamples.csproj +++ b/Examples/ApiExamples/ApiExamples/ApiExamples.csproj @@ -125,13 +125,13 @@ - - - - - + + + + + - + @@ -139,7 +139,7 @@ runtime; build; native; contentfiles; analyzers - + diff --git a/Examples/ApiExamples/Runner.MAUI/ExCharts.cs b/Examples/ApiExamples/Runner.MAUI/ExCharts.cs index 473de78e5..5f33e7edb 100644 --- a/Examples/ApiExamples/Runner.MAUI/ExCharts.cs +++ b/Examples/ApiExamples/Runner.MAUI/ExCharts.cs @@ -191,9 +191,9 @@ public void AxisProperties() xAxis.MinorTickMark = AxisTickMark.Cross; xAxis.MajorUnit = 10.0d; xAxis.MinorUnit = 15.0d; - xAxis.TickLabelOffset = 50; - xAxis.TickLabelPosition = AxisTickLabelPosition.Low; - xAxis.TickLabelSpacingIsAuto = false; + xAxis.TickLabels.Offset = 50; + xAxis.TickLabels.Position = AxisTickLabelPosition.Low; + xAxis.TickLabels.IsAutoSpacing = false; xAxis.TickMarkSpacing = 1; ChartAxis yAxis = chart.AxisY; @@ -204,7 +204,7 @@ public void AxisProperties() yAxis.MinorTickMark = AxisTickMark.Cross; yAxis.MajorUnit = 100.0d; yAxis.MinorUnit = 20.0d; - yAxis.TickLabelPosition = AxisTickLabelPosition.NextToAxis; + yAxis.TickLabels.Position = AxisTickLabelPosition.NextToAxis; // Column charts do not have a Z-axis. Assert.Null(chart.AxisZ); @@ -222,9 +222,9 @@ public void AxisProperties() Assert.Equal(AxisTickMark.Cross, chart.AxisX.MinorTickMark); Assert.Equal(1.0d, chart.AxisX.MajorUnit); Assert.Equal(0.5d, chart.AxisX.MinorUnit); - Assert.Equal(50, chart.AxisX.TickLabelOffset); - Assert.Equal(AxisTickLabelPosition.Low, chart.AxisX.TickLabelPosition); - Assert.False(chart.AxisX.TickLabelSpacingIsAuto); + Assert.Equal(50, chart.AxisX.TickLabels.Offset); + Assert.Equal(AxisTickLabelPosition.Low, chart.AxisX.TickLabels.Position); + Assert.False(chart.AxisX.TickLabels.IsAutoSpacing); Assert.Equal(1, chart.AxisX.TickMarkSpacing); Assert.Equal(AxisCategoryType.Category, chart.AxisY.CategoryType); @@ -234,7 +234,7 @@ public void AxisProperties() Assert.Equal(AxisTickMark.Cross, chart.AxisY.MinorTickMark); Assert.Equal(100.0d, chart.AxisY.MajorUnit); Assert.Equal(20.0d, chart.AxisY.MinorUnit); - Assert.Equal(AxisTickLabelPosition.NextToAxis, chart.AxisY.TickLabelPosition); + Assert.Equal(AxisTickLabelPosition.NextToAxis, chart.AxisY.TickLabels.Position); } [Fact] @@ -285,7 +285,7 @@ public void DateTimeValues() // Define Y-axis properties for decimal values. ChartAxis yAxis = chart.AxisY; - yAxis.TickLabelPosition = AxisTickLabelPosition.High; + yAxis.TickLabels.Position = AxisTickLabelPosition.High; yAxis.MajorUnit = 100.0d; yAxis.MinorUnit = 50.0d; yAxis.DisplayUnit.Unit = AxisBuiltInUnit.Hundreds; @@ -306,7 +306,7 @@ public void DateTimeValues() Assert.Equal(AxisTickMark.Cross, chart.AxisX.MajorTickMark); Assert.Equal(AxisTickMark.Outside, chart.AxisX.MinorTickMark); - Assert.Equal(AxisTickLabelPosition.High, chart.AxisY.TickLabelPosition); + Assert.Equal(AxisTickLabelPosition.High, chart.AxisY.TickLabels.Position); Assert.Equal(100.0d, chart.AxisY.MajorUnit); Assert.Equal(50.0d, chart.AxisY.MinorUnit); Assert.Equal(AxisBuiltInUnit.Hundreds, chart.AxisY.DisplayUnit.Unit); @@ -1170,9 +1170,9 @@ public void AxisDisplayUnit() // Set the X-axis bounds so that the X-axis spans 5 major tick marks and 12 minor tick marks. axis.Scaling.Minimum = new AxisBound(-10); axis.Scaling.Maximum = new AxisBound(30); - axis.TickLabelAlignment = ParagraphAlignment.Right; + axis.TickLabels.Alignment = ParagraphAlignment.Right; - Assert.Equal(1, axis.TickLabelSpacing); + Assert.Equal(1, axis.TickLabels.Spacing); // Set the tick labels to display their value in millions. axis.DisplayUnit.Unit = AxisBuiltInUnit.Millions; @@ -1198,8 +1198,8 @@ public void AxisDisplayUnit() Assert.Equal(10.0d, axis.MajorUnit); Assert.Equal(-10.0d, axis.Scaling.Minimum.Value); Assert.Equal(30.0d, axis.Scaling.Maximum.Value); - Assert.Equal(1, axis.TickLabelSpacing); - Assert.Equal(ParagraphAlignment.Right, axis.TickLabelAlignment); + Assert.Equal(1, axis.TickLabels.Spacing); + Assert.Equal(ParagraphAlignment.Right, axis.TickLabels.Alignment); Assert.Equal(AxisBuiltInUnit.Custom, axis.DisplayUnit.Unit); Assert.Equal(1000000.0d, axis.DisplayUnit.CustomUnit); diff --git a/Examples/ApiExamples/Runner.MAUI/Runner.MAUI.csproj b/Examples/ApiExamples/Runner.MAUI/Runner.MAUI.csproj index 9dc72518a..c102ef579 100644 --- a/Examples/ApiExamples/Runner.MAUI/Runner.MAUI.csproj +++ b/Examples/ApiExamples/Runner.MAUI/Runner.MAUI.csproj @@ -49,20 +49,20 @@ - - - - + + + + - + - + diff --git a/Examples/DocsExamples/Docker/Docker.csproj b/Examples/DocsExamples/Docker/Docker.csproj index 370bcf7d5..b16a432a2 100644 --- a/Examples/DocsExamples/Docker/Docker.csproj +++ b/Examples/DocsExamples/Docker/Docker.csproj @@ -6,7 +6,7 @@ - + diff --git a/Examples/DocsExamples/DocsExamples/DocsExamples.csproj b/Examples/DocsExamples/DocsExamples/DocsExamples.csproj index a80ac888d..68b60251a 100644 --- a/Examples/DocsExamples/DocsExamples/DocsExamples.csproj +++ b/Examples/DocsExamples/DocsExamples/DocsExamples.csproj @@ -116,14 +116,14 @@ - - - - + + + + - + diff --git a/Examples/DocsExamples/DocumentExplorer/DocumentExplorer.csproj b/Examples/DocsExamples/DocumentExplorer/DocumentExplorer.csproj index 9ec974fd6..eb8fc886b 100644 --- a/Examples/DocsExamples/DocumentExplorer/DocumentExplorer.csproj +++ b/Examples/DocsExamples/DocumentExplorer/DocumentExplorer.csproj @@ -141,7 +141,7 @@ - 24.9.0 + 24.10.0 diff --git a/Examples/DocsExamples/PluginsExamples/PluginsExamples.csproj b/Examples/DocsExamples/PluginsExamples/PluginsExamples.csproj index 9e00635c9..3916c8dde 100644 --- a/Examples/DocsExamples/PluginsExamples/PluginsExamples.csproj +++ b/Examples/DocsExamples/PluginsExamples/PluginsExamples.csproj @@ -11,7 +11,7 @@ - +