翻譯|使用教程|編輯:安雯斯|2023-05-17 09:52:30.167|閱讀 123 次
概述:本章介紹如何設(shè)置圖表數(shù)據(jù)標簽,歡迎查閱!
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
Aspose.Words是一種高級Word文檔處理API,用于執(zhí)行各種文檔管理和操作任務(wù)。API支持生成,修改,轉(zhuǎn)換,呈現(xiàn)和打印文檔,而無需在跨平臺應(yīng)用程序中直接使用Microsoft Word。
Aspose API支持流行文件格式處理,并允許將各類文檔導出或轉(zhuǎn)換為固定布局文件格式和最常用的圖像/多媒體格式。
Aspose技術(shù)交流群(761297826)
修訂(跟蹤更改)是 Word 文檔跟蹤您在文檔中所做更改的一種方式。我們在此版本中添加了新功能,以處理文檔的原始版本和修訂版本。為此功能添加了新屬性 Document.RevisionsView 以及 RevisionsView 枚舉。此屬性用于獲取或設(shè)置一個值,該值指示是使用文檔的原始版本還是修訂版本。以下代碼示例顯示了如何使用文檔的修訂版本。
// For complete examples and data files, please go to //github.com/aspose-words/Aspose.Words-for-.NET Document doc = new Document(dataDir + "Test.docx"); doc.UpdateListLabels(); // Switch to the revised version of the document. doc.RevisionsView = RevisionsView.Final; foreach (Revision revision in doc.Revisions) { if (revision.ParentNode.NodeType == NodeType.Paragraph) { Paragraph paragraph = (Paragraph)revision.ParentNode; if (paragraph.IsListItem) { // Print revised version of LabelString and ListLevel. Console.WriteLine(paragraph.ListLabel.LabelString); Console.WriteLine(paragraph.ListFormat.ListLevel); } } }
您可能在 Word 文檔中使用過圖表系列的數(shù)據(jù)標簽。數(shù)據(jù)標簽使圖表更易于理解,因為它們顯示了數(shù)據(jù)系列或單個數(shù)據(jù)點的詳細信息。您可以根據(jù)需要向圖表系列添加標簽。我們在 ChartDataLabelCollection 類中添加了新屬性,例如 ShowSeriesName、ShowPercentage、ShowLegendKey、ShowBubbleSize、ShowCategoryName 等。您可以使用這些屬性來設(shè)置數(shù)據(jù)標簽的默認選項。以下代碼示例顯示了如何使用這些屬性。
// For complete examples and data files, please go to //github.com/aspose-words/Aspose.Words-for-.NET Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); Shape shape = builder.InsertChart(ChartType.Pie, 432, 252); Chart chart = shape.Chart; chart.Series.Clear(); ChartSeries series = chart.Series.Add("Series 1", new string[] { "Category1", "Category2", "Category3" }, new double[] { 2.7, 3.2, 0.8 }); ChartDataLabelCollection labels = series.DataLabels; labels.ShowPercentage = true; labels.ShowValue = true; labels.ShowLeaderLines = false; labels.Separator = " - "; doc.Save(dataDir + "Demo.docx");
以上便是本篇文章的所有內(nèi)容,要是您還有其他關(guān)于產(chǎn)品方面的問題,歡迎咨詢我們,或者加入我們官方技術(shù)交流群。
歡迎下載|體驗更多Aspose產(chǎn)品
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn