Visualizing relationships between two numeric variables often calls for a scatter chart. When you need to emphasize each data point and illustrate the trend by connecting points with lines, the ScatterConnectedByLinesWithDataMarker chart type is ideal. In this guide you’ll discover how to create such a chart in Excel using C# with Aspose.Cells for .NET. The solution is fully programmable, requires no Excel installation, and produces a chart that can be saved as XLSX, PDF, or an image.
This article covers the following topics:
- C# Excel Library to Create ScatterConnectedByLinesWithDataMarker Chart
- Create a ScatterConnectedByLinesWithDataMarker Chart in Excel using C#
- Free License & Resources
- See Also
C# Excel Library to Create ScatterConnectedByLinesWithDataMarker Chart
Aspose.Cells for .NET is a comprehensive Excel manipulation library that enables developers to create, edit, and render Excel files without the need for Microsoft Office. It supports all chart types provided by Excel, including the ScatterConnectedByLinesWithDataMarker chart.
Key advantages of using Aspose.Cells for chart generation:
- Full API Coverage – Access to every Excel feature, from basic cell operations to advanced chart customizations.
- No Interop Dependency – Works on any platform that supports .NET, eliminating COM interop issues.
- High Performance – Efficient handling of large workbooks and datasets.
- Multiple Export Formats – Save charts as XLSX, PDF, PNG, JPEG, and more.
Getting Started
Download the latest release from the Aspose.Cells .NET releases page.
Install via NuGet:
PM> Install-Package Aspose.CellsThe package includes all necessary assemblies and dependencies.
Create a ScatterConnectedByLinesWithDataMarker Chart in Excel using C#
Below is a complete, self‑contained C# program that:
- Creates a new workbook.
- Populates sample X‑Y data.
- Inserts a ScatterConnectedByLinesWithDataMarker chart.
- Formats the chart (title, axis labels, marker style, line style).
- Saves the workbook as
ScatterConnectedByLinesWithDataMarker.xlsx.
Note: The code targets .NET 6.0 (or later) and uses the latest Aspose.Cells API. Adjust the project SDK version if needed.
Explanation of Key Steps
| Step | Purpose |
|---|---|
| Create workbook & worksheet | Initializes an in‑memory Excel file. |
| Populate data | Supplies X‑Y pairs that the scatter chart will render. |
| Add chart | Inserts a chart of type ScatterConnectedByLinesWithDataMarker. |
| Define series | Links Y‑values (B2:B9) and X‑values (A2:A9) to the series. |
| Customize markers & line | Adjusts visual styling – marker shape, size, colors, and line thickness. |
| Axis titles | Improves readability for end‑users. |
| Save | Persists the workbook to disk (can be changed to PDF/Image via Save overloads). |
You can adapt the data range, styling, or chart placement to fit your specific scenario. The same approach works for larger datasets or multiple series by adding additional NSeries entries.
Get a Free License
Aspose offers a temporary free license that removes evaluation watermarks and unlocks full functionality for a limited period. Obtain it from the Aspose temporary license page. Apply the license before creating the workbook:
var license = new License();
license.SetLicense("Aspose.Total.lic"); // Path to your temporary license file
Free Resources
- Developer’s Guide – Comprehensive tutorials: https://docs.aspose.com/cells/net/
- Online Apps – Try chart creation without coding: https://products.aspose.app/cells/family
- API Reference – Detailed class & method definitions: https://reference.aspose.com/cells/net/
- How‑To Articles – Explore more chart types and Excel features: https://blog.aspose.com/categories/aspose.cells-product-family/
Conclusion
The ScatterConnectedByLinesWithDataMarker chart is perfect for illustrating data trends while still highlighting each individual point. With Aspose.Cells for .NET you can create, style, and export this chart entirely through code—no Excel installation required. The provided sample is ready to compile and run, giving you a solid foundation to integrate sophisticated visualizations into your .NET applications.
If you encounter any challenges or have questions, feel free to visit our free support forum where the Aspose community and engineers are happy to help.