1

I made an interactive chart that shows different data, depending on which ActiveX checkboxes are checked. I created a few tables that would show different data by using a few nested IF statements like:

=IF('Sheet1!$O$25;SUM(AV$2:AV8)/B8;IF('Sheet1'!$O$22;SUM(AK8;AL8;AT8;AU8);IF('Sheet1'!$P$22;AM8;IF('Sheet1'!$P$25;AQ8;NA()))))

Column O in Sheet1 gets the true or false values from the checkboxes. I made it possible to show three different values in the graph.

Now if I try to change the chart type from a normal line to a stacked line and only check the first and third checkboxes, the colors of the actual graphline and the legend are not equal. I have the linecolor setting to automatic. It looks like the first line in the graph is always blue and the second is always green and the third always red.

So what happens is, if I say "show only line 1 and 3", the legend leaves a gap for the second data, saying data3 (PM) is red, but the actual line in the graph is green. I double checked and the green line is indeed the "PM" datapoints.

Am I doing something wrong, is it a bug in Excel or might this actually be how the stacked line graph was designed?

See Stacked line here

EDIT:

You can simply duplicate this issue:

  • in column A paste random values, in my example below I used 3
  • in column B paste random values, in my example below I used 2
  • in column C paste random values, in my example below I used 1

Now make a stacked graph. Select column B and clear the values.

[see example here

As you can see, the legend shows green and blue as containing data, yet the lines are green and red!

5
  • your question is quite complex, unfortunately it can't be answered based on your description. I don't think we could identify the issue without seeing the workbook itself. Commented Nov 18, 2015 at 14:24
  • Problem is I cannot share the workbook as it contains sensitive data. I could however duplicate the issue with fake values.
    – Klister
    Commented Nov 18, 2015 at 14:31
  • How do I share a workbook? I guess I have to upload it somewhere?
    – Klister
    Commented Nov 19, 2015 at 12:35
  • I still have not resolved this issue. I'd be happy to recreate the issue in a non-sensitive workbook.
    – Klister
    Commented Jul 8, 2016 at 8:57
  • Re-reading your question it's quite confusing indeed. I suppose you also use macros but it's not mentioned. I think your issue is more related to the macro then to e.g. formulas you've posted. Please play around a bit to see whether excluding formula / macro sills your problem and post what's relevant. Unfortunately you can't share entire workbooks, only data and screenshots. Commented Jul 8, 2016 at 10:16

3 Answers 3

1

Ok, so I figured out what is going on here. As this is a stacked line graph, any line that is not the last line, but has all values at zero or NA() will be ON TOP OF line 3. By actively suppressing the no-value line visibility in VBA this can be fixed. I haven't found any other solution to get around this behavior.

0

In case somebody gets ever more interested - since I did not find any better place nor did I find an answer throughout the internet:

The same happend to me with manual graph settings (no VBA code). It turned out that every element of the legend can be formated independently of the actual series (*). I formated the corresponding legend element symbol (line color) to the (custom) line color I had chosen for my series before (and which did not show up correctly in the legend).

When I changed the color of the series later, the change magically propagated to the legend properly since then.

My hypothesis states that sometimes the legend elemnt keeps, e.g., its "line style" "automatic" (do not have proper English localization here) although the series formating got customized. Once the element is made "not-automatic" manually, it starts follows the (future) changes in the series formatting properly (?)

(*) My another hypothesis is that MS try their best to allow cheating your (their own??) CEO with mingled data graphs (or I cannot find any better reason for allowing independent legend formatting... :))

0

File > Options > Advanced > Chart >

  • deselect 'Properties follow chart data point for current workbook'

  • deselect 'Properties follow chart data point for all new workbooks'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .