Reputation: 751
As shown in the figure below, I plot three lines. The legend entry, series 1, 2, 3, are created automatically by Excel. I want to edit these entries to be, such as line 1, 2, 3. But I didn't find a way to do this.
Upvotes: 13
Views: 285691
Reputation: 4974
There are 3 ways to do this:
Right-click on the Chart and click Select Data then edit the series names directly as shown below.
You can either specify the values directly e.g. Series 1
or specify a range e.g. =A2
Simply select your data range (in similar format as I specified) and create a simple bar chart. The labels should be defined automatically.
Similarly you can define the series names dynamically using VBA. A simple example below:
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(1).Name = "=""Hello"""
This will redefine the first series name. Just change the index from (1)
to e.g. (2)
and so on to change the following series names. What does the VBA above do? It sets the series name to Hello
as "=""Hello"""
translates to ="Hello"
("
have to be escaped by a preceding "
).
Upvotes: 6
Reputation: 11
Left Click on chart. «PivotTable Field List» will appear on right. On the right down quarter of PivotTable Field List (Σ Values), you see the names of the legends. Left Click on the legend name. Left Click on the «Value field settings». At the top there is «Source Name». You can’t change it. Below there is «Custom Name». Change the Custom Name as you wish. Now the legend name on the chart has the new name you gave.
Upvotes: 1
Reputation: 6571
The data series names are defined by the column headers. Add the names to the column headers that you would like to use as titles for each of your data series, select all of the data (including the headers), then re-generate your graph. The names in the headers should then appear as the names in the legend for each series.
Upvotes: 17