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

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

  1. Download the latest release from the Aspose.Cells .NET releases page.

  2. Install via NuGet:

    PM> Install-Package Aspose.Cells
    

    The package includes all necessary assemblies and dependencies.

Create a ScatterConnectedByLinesWithDataMarker Chart in Excel using C#

Below is a complete, self‑contained C# program that:

  1. Creates a new workbook.
  2. Populates sample X‑Y data.
  3. Inserts a ScatterConnectedByLinesWithDataMarker chart.
  4. Formats the chart (title, axis labels, marker style, line style).
  5. 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

StepPurpose
Create workbook & worksheetInitializes an in‑memory Excel file.
Populate dataSupplies X‑Y pairs that the scatter chart will render.
Add chartInserts a chart of type ScatterConnectedByLinesWithDataMarker.
Define seriesLinks Y‑values (B2:B9) and X‑values (A2:A9) to the series.
Customize markers & lineAdjusts visual styling – marker shape, size, colors, and line thickness.
Axis titlesImproves readability for end‑users.
SavePersists 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

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.

See Also