Search code examples
excelchartsexcel-2007

Don't show empty lines in chart's legend


I have a question about charts and legends in excel 2007. I need to plot some lines from a dynamically filled array, this array have at maximum 9 lines, but sometimes I don't need to plot of them. enter image description here

So, I made of chart of the all 9 lines, even the empty ones. My issue is that the empty lines (without data and no label) are plot in the chart, there are some empty legend label, and i would like to get rid of them so my chart will be me readable. enter image description here

I can't figure how to remove them, maybe it's impossible without VBA or in this version of excel.

Thank you


Solution

  • I found a solution !

    Maybe not the prettiest one, but it works.

    Apply a filter on your table and hide the empty cell, they will not be showed on the graph anymore