Custom labels aren't applying properly when copy/pasting filtered charts between applications

Copper Contributor

Edit: I believe this is a bug in Excel [Version 2208 (Build 15601.20538 Click-to-Run)]. See my second reply below.

 

When attempting to embed paste a copied chart from Excel 2016 to another application (Outlook, PowerPoint, etc.) that has been filtered in some way (to remove rows from the chart), custom labels apply from the start of the set of custom labels, regardless of what data is included.

 

Replication steps:

  1. Create a chart of any type. This is happening mostly on column and line charts for me. Add data labels. Customize those data labels with custom entries.
    1. In my instance, I have a column of values, and a formatted set of those values in a subsequent column. The data is in line by rows. The formatted data is what's being used as custom records.
  2. Filter that chart to limit the number of rows being included, specifically excluding at least the first line of data.
    1. In my instance, I have data that is organized by month. I have selected a middle range of data from that dataset.
  3. Copy this chart and attempt to paste into PPT or Outlook. The chart's data will be correct, but the labels will show from the first custom data label, regardless of what rows have been filtered.

 

I confirmed this happening in several Office products. When pasting a chart as an embed, if I edit the data within PPT/Outlook/whatever, it still looks right, but I noticed that the chart appears to only embed the specific fields that are being not filtered out, rather than everything in the chart. I think this is related to that.

 

Example:

 

In Excel, I made the following chart. I attached the custom labels to each row's data. I filtered it to remove the first and last columns. Note that columns 2-4 have labels with the appropriate value in them.

in excel.JPG

 

When I paste this chart into PPT via embed and use destination formatting (K), the below chart is pasted. Note that the entire chart is the same, but the labels show the first three entries in the custom label column, instead of the correct entries.

in ppt.JPG

2 Replies
If you paste the chart into another application unfiltered, and then filter it after being embedded, it works fine. However, even copying that 'fixed' chart won't correct the issue - it still pastes with incorrect custom labels.

My use case is that I paste embedded, update the sizing as needed, then copy that embedded chart, delete, paste as picture. This pastes it without a border (unlike if you just paste as picture initially) and ensures proper sizing. This does not work with the above defect.
More research into this - it appears that, as of a recent update, when you paste a filtered chart as embedded, the chart's range is truncated (probably in an attempt to reduce memory footprint). That is, if you have a chart that covers B2:C6, and you paste the middle three rows, Excel's embed only contains B3:C5 if you look at Select Data in the embedded instance. However, this truncated range does not carry over to the Custom Labels select box, which still is only reflecting the original range. This may be due to how Excel handles custom labels (since they can be an entirely separate set of cells with no correlation to the original dataset size), but it's 100% an Excel bug. I can't find documentation around this.