昌吉网站建设电话网页设计 网站开发 网络安全

张小明 2026/1/13 7:07:26
昌吉网站建设电话,网页设计 网站开发 网络安全,wordpress get_post_meta,家政的网站怎么做使用旭日图可以更清晰地可视化层级信息#xff0c;例如组织结构、产品类别或文件系统布局。本文将演示如何使用Aspose.Cells for .NET在 Excel 工作簿中创建旭日图。该示例完全可运行#xff0c;仅需 Aspose.Cells NuGet 包#xff0c;并且可以适用于任何层级数据集。 Aspo…使用旭日图可以更清晰地可视化层级信息例如组织结构、产品类别或文件系统布局。本文将演示如何使用Aspose.Cells for .NET在 Excel 工作簿中创建旭日图。该示例完全可运行仅需 Aspose.Cells NuGet 包并且可以适用于任何层级数据集。Aspose.Cells官方试用版免费下载用于创建旭日图的 C# Excel 库Aspose.Cells for .NET是一个功能强大的 Excel 自动化库无需 Office 互操作即可使用。它提供了一个简洁的面向对象的 API用于创建、修改和设置图表样式包括 Excel 2016 中引入的旭日图。选择 Aspose.Cells 生成旭日图的主要原因全面的 API– 完全访问图表类型、数据系列和格式选项。无需安装 Excel– 可在服务器端、云端或容器环境中运行。支持跨格式——保存为 XLSX、XLS、CSV、PDF、PNG 等格式。高性能——高效处理大型工作簿和数据集。入门从慧都网Aspose.Cells页面下载该库。从NuGet安装PM Install-Package Aspose.CellsAspose.Cells在你的C#项目中添加对它的引用。使用 C# 在 Excel 中创建旭日图下面是一个完整的、独立的 C# 示例演示如何在 Excel 中创建旭日图。// ------------------------------------------------------------ // 1. Create a new workbook and obtain the first worksheet. // ------------------------------------------------------------ var workbook new Workbook(); var sheet workbook.Worksheets[0]; sheet.Name Hierarchy; // ------------------------------------------------------------ // 2. Populate hierarchical data. // The data layout follows the structure required by Sunburst: // Column A ¨C Category (Level 1) // Column B ¨C Sub?Category (Level 2) // Column C ¨C Item (Level 3) // Column D ¨C Value (numeric) // ------------------------------------------------------------ string[,] data new string[,] { // Category, Sub?Category, Item, Value { Technology, Hardware, Laptop, 120 }, { Technology, Hardware, Desktop, 80 }, { Technology, Software, OS, 150 }, { Technology, Software, Office, 100 }, { Finance, Banking, Retail, 200 }, { Finance, Banking, Corporate, 180 }, { Finance, Investments,Equity, 130 }, { Finance, Investments,Bonds, 90 } }; // Write the header row sheet.Cells[A1].PutValue(Category); sheet.Cells[B1].PutValue(Sub?Category); sheet.Cells[C1].PutValue(Item); sheet.Cells[D1].PutValue(Value); // Fill the data rows for (int r 0; r data.GetLength(0); r) { for (int c 0; c data.GetLength(1); c) { sheet.Cells[r 1, c].PutValue(data[r, c]); } } // ------------------------------------------------------------ // 3. Add a Sunburst chart. // ------------------------------------------------------------ // The chart will be placed starting at row 12, column 0 and // will span 20 rows and 10 columns. int chartIdx sheet.Charts.Add(ChartType.Sunburst, 12, 0, 32, 10); Chart sunburstChart sheet.Charts[chartIdx]; sunburstChart.Title.Text Company Revenue by Category; // ------------------------------------------------------------ // 4. Set the data range for the chart. // Sunburst expects the first column to contain the innermost // level (Category), and the last column to hold the numeric // values. // ------------------------------------------------------------ // A2:D9 contains the hierarchy values. sunburstChart.SetChartDataRange(Hierarchy!$A$2:$D$9, true); // ------------------------------------------------------------ // 5. (Optional) Customize the appearance. // ------------------------------------------------------------ // Example: Set a pastel background for the PlotArea. sunburstChart.PlotArea.Area.Formatting FormattingType.Custom; sunburstChart.PlotArea.Area.ForegroundColor Color.FromArgb(247, 250, 255); // Set the legend to the right side. sunburstChart.Legend.Position LegendPositionType.Right; // ------------------------------------------------------------ // 6. Save the workbook. // ------------------------------------------------------------ string outputPath SunburstChart_Output.xlsx; workbook.Save(outputPath); Console.WriteLine($Sunburst chart created successfully: {outputPath});关键步骤说明步目的2层级数据按列排列其中最左边的列代表最外层的环类别最右边的数值列保存值。3ChartType.Sunburst创建所需的图表类型。4SetChartDataRange将数据范围与图表关联起来该标志true告诉 Aspose.Cells 该范围包含类别和值。5可选的外观调整背景填充、图例位置。6将工作簿保存为 XLSX 格式以便进一步处理或导出为 PDF/PNG。结论使用Aspose.Cells for .NET以编程方式创建旭日图非常简单。该库无需在服务器上运行 Microsoft Excel 即可处理数据层次结构、图表类型选择和样式设置。您可以以提供的示例为基础根据您的领域调整数据源并利用 Aspose 丰富的 API 生成精美且可直接导出的可视化图表。
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

免费制作二维码的网站最近营销热点

ACS712电流传感器完整使用指南:从安装到实战 【免费下载链接】ACS712 Arduino library for ACS Current Sensor - 5A, 20A, 30A 项目地址: https://gitcode.com/gh_mirrors/ac/ACS712 欢迎来到ACS712电流传感器的完整使用指南!无论你是电子爱好者…

张小明 2026/1/10 20:35:54 网站建设

优秀的网站通过什么提供信息专业定制网站建设公司

智能游戏助手:ok-ww鸣潮自动化助手的3大智能玩法与终极解放指南 【免费下载链接】ok-wuthering-waves 鸣潮 后台自动战斗 自动刷声骸上锁合成 自动肉鸽 Automation for Wuthering Waves 项目地址: https://gitcode.com/GitHub_Trending/ok/ok-wuthering-waves …

张小明 2026/1/10 20:35:43 网站建设

网站源码下载软件个人网站 空间 多少够

HTML前端Python后端开发:Miniconda统一管理多语言依赖 在现代Web开发中,一个常见的场景是:前端用HTML、JavaScript构建交互界面,后端用Python处理数据逻辑甚至集成AI模型。但每当新成员加入项目,或者要把本地服务部署到…

张小明 2026/1/10 20:35:50 网站建设

重庆水务建设项目集团网站使用pycharm网站开发

在统信 UOS、麒麟 Kylin 等国产 Linux 内核操作系统上,使用 Qt 框架实现硬件调用的具体方法,核心是掌握 Qt 原生硬件接口、以及 Qt 对接 Linux 底层硬件库的方式。 一、前期准备:国产系统搭建 Qt 硬件开发环境 国产系统(UOS / 麒麟)对 Qt 有官方适配,优先通过系统自带包…

张小明 2026/1/10 23:19:34 网站建设

主流网站宽度wordpress装了英文版怎么转中文

城通网盘直连解析工具:技术解析与高效应用指南 【免费下载链接】ctfileGet 获取城通网盘一次性直连地址 项目地址: https://gitcode.com/gh_mirrors/ct/ctfileGet 在当今数字资源分享的浪潮中,城通网盘作为广泛使用的存储平台,其下载体…

张小明 2026/1/11 16:20:21 网站建设