Chart control

The Chart control is a chart object that exposes events. When you add a chart to a worksheet, Visual Studio creates a Chart object that you can program against directly without having to traverse the Microsoft Office Excel object model.

Applies to: The information in this topic applies to document-level projects and VSTO Add-in projects for Excel. For more information, see Features available by Office application and project type.

Create the control

You can add Chart controls to a Microsoft Office Excel worksheet at design time or at runtime in a document-level project.

You can add Chart controls to a worksheet at runtime in a VSTO Add-in. For more information, see How to: Add Chart controls to worksheets.

Note

Dynamically created chart objects are not persisted in the worksheet as host controls when the worksheet is closed. For more information, see Add controls to Office documents at runtime.

Formatting

All formatting that can be applied to a Chart can also be applied to a Chart control. This includes borders, fonts, chart type, gridlines, legend, and data labels.

Events

The following events are available for the Chart control:

See also

Office development samples and walkthroughs
Extend Word documents and Excel workbooks in VSTO Add-ins at runtime
Controls on Office documents
Add controls to Office documents at runtime
Automate Excel by using extended objects
How to: Add Chart controls to worksheets
Bind data to controls in Office solutions
Programmatic limitations of host items and host controls