Visualizing data points that are connected by smooth curves while still showing individual markers can greatly improve the readability of analytical reports. In this guide you will learn how to create a ScatterConnectedByCurvesWithDataMarker chart in Excel using C# with Aspose.Cells for .NET. The example covers data population, chart creation, series configuration, data‑marker customization, and workbook saving.
This article covers the following topics:
- C# Excel Library to Create ScatterConnectedByCurvesWithDataMarker Chart
- Create a ScatterConnectedByCurvesWithDataMarker Chart in Excel using C#
- Customize Data Markers for the Scatter Chart
- Get a Free License
- Free Resources
- Conclusion
- See Also
C# Excel Library to Create ScatterConnectedByCurvesWithDataMarker Chart
Aspose.Cells for .NET is a robust Excel manipulation library that empowers developers to create, modify, and style Excel files programmatically without Microsoft Office. It offers a rich Chart API that includes the ScatterConnectedByCurvesWithDataMarker chart type, enabling smooth curve connections with visible data markers.
Key advantages of Aspose.Cells for .NET:
- Comprehensive API – Access every Excel feature from worksheets to advanced charts.
- High Performance – Process large workbooks efficiently.
- Zero Dependency on Office – No need for Excel installation on the server.
- Multi‑Format Support – Read/write XLSX, XLS, CSV, ODS, PDF, and more.
Getting Started
Download the latest release from the Aspose.Cells releases page.
Install via NuGet:
PM> Install-Package Aspose.CellsAdd a reference to
Aspose.Cellsin your C# project.
Create a ScatterConnectedByCurvesWithDataMarker Chart in Excel using C#
The following example creates a workbook, inserts sample data, adds a ScatterConnectedByCurvesWithDataMarker chart, and saves the file as ScatterChart_Output.xlsx.
What the Code Does
| Step | Description |
|---|---|
| 1 | Instantiates a new Workbook and grabs the first Worksheet. |
| 2 | Writes a header row and a set of X‑Y points into columns A and B. |
| 3 | Inserts a chart of type ScatterConnectedByCurvesWithDataMarker at a specified location on the sheet. |
| 4 | Adds a single data series. NSeries.Add sets the X range; YValues assigns the Y range. |
| 5 | (Optional) Sets titles for the category (X) and value (Y) axes. |
| 6 | Saves the workbook to disk. |
Run the program; the generated ScatterChart_Output.xlsx will contain a smooth‑curve scatter chart where each point is highlighted by a data marker.
Customize Data Markers for the Scatter Chart
Data markers can be styled to improve visual impact. The example below demonstrates how to change marker shape, size, color, and border for the series created above.
Marker Customization Highlights
| Property | Effect |
|---|---|
MarkerStyle | Changes the shape (e.g., Diamond, Circle, Square). |
MarkerSize | Controls the size in points. |
Area.ForeColor + Area.Formatting | Sets the fill color of the marker. |
Border properties | Defines outline visibility, color, weight, and line style. |
By tweaking these properties you can match corporate branding, emphasize key data points, or simply improve chart aesthetics.
Get a Free License
Explore Aspose products risk‑free by requesting a temporary license. Visit the Aspose temporary license page to obtain a free key that unlocks the full functionality of Aspose.Cells for .NET.
Free Resources
Enhance your Excel automation skills with the following free resources:
- Developer’s Guide – https://docs.aspose.com/cells/net/
- Online Demo Apps – https://products.aspose.app/cells/family
- API Reference – https://reference.aspose.com/cells/net/
- How‑To Articles – https://blog.aspose.com/categories/aspose.cells-product-family/
Conclusion
In this article we demonstrated how to create a ScatterConnectedByCurvesWithDataMarker chart using C# and Aspose.Cells for .NET. The guide covered:
- Setting up a workbook and populating X‑Y data.
- Adding the specialized scatter chart type.
- Configuring series and axis titles.
- Customizing data markers for a polished visual output.
Aspose.Cells makes chart creation straightforward, allowing you to generate complex, publication‑ready visuals entirely programmatically.
If you have any questions, need further assistance, or wish to share your feedback, please visit our free support forum.