Related Tags:
C# C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java. Learn More, Visual Studio Tools for Office (VSTO) Visual Studio Tools for Office is a set of development tools available in the form of a Visual Studio add-in and a runtime that allows Microsoft Office 2003 and later versions of Office applications to host the .NET Framework Common Language Runtime to expose their functionality via .NET. Learn More, Microsoft PowerPoint Microsoft PowerPoint is a presentation program, created by Robert Gaskins and Dennis Austin at a software company named Forethought, Inc. It was released on April 20, 1987, initially for Macintosh computers only. Microsoft acquired PowerPoint for $14 million three months after it appeared. Learn More, Microsoft Excel Microsoft Excel is a spreadsheet developed by Microsoft for Windows, macOS, Android and iOS. It features calculation, graphing tools, pivot tables, and a macro programming language called Visual Basic for Applications. Learn More, Add-in An add-in is a software program that expands the capabilities of bigger programs. It is a term commonly used by Microsoft and other platforms which have additional functions that can be added to primary programs. An add-in has specific but limited features that require only minimal memory resources. Learn More,

How to update Legend / series text of powerpoint chart using VSTO in C#?

Description:I am dynamically adding series items but the series/Legend items always showing text as series1,series2 and so on… but let say I want to update them as my series 1, my series 2, and so on.
I am clueless as there is very less information available regarding the topic.

Posted by: | Posted on: Jan 10, 2020

1 answers

Replies

3

hi Samantha,
It would be good if you can provide some code that you have tried so that the answer can be more specific, but as far as I understood your problem you can update the series or Legend item text by using its Name property for example the following code will update its text exactly as per your requirement. You just need to get your chart's SeriesCollection and update the Name for all items in the series collection.

var sc = chart.SeriesCollection();
int counter = 1;
int total = sc.Count + 1;
do
{
var seriesTemp = sc.Item((counter));
seriesTemp.Name = "my series" + " " + counter;
counter++;
}
while (counter != total);

Replied by: | Replied on: Jan 13, 2020



Reply
×

Code block Hyperlink bold Quotes block Upload Images

Preview