Overlapping bar chart

Hello! I am trying to create a bar chart that shows the minimum, maximum and average for a particular time period (month). Its almost like a candlestick chart, but I did this in Excel by creating a bar chart:

  • maximum is a dark bar, charted first
  • minimum is a white par, charted second (creating the white space). This is overlapped over the first bar (done by a negative value in the gap between columns in Excel)
  • Average is a line chart, but with no line, mapped on a second Y-axis


I can do most of this in Numbers as well, however I cannot seem to figure out how to overlap the white bar on top of the dark bar to creating the floating bar that I am looking for. Note that I am trying to do this in Numbers, because that way I can track and view this data on my phone, housing all the data on the cloud through Numbers.


Can anyone help me to figure out how to do this? Thanks!

iPhone 12 Pro

Posted on Aug 28, 2022 7:04 PM

Reply
Question marked as Top-ranking reply

Posted on Aug 28, 2022 7:49 PM

Sounds like a stacked bar chart and a line chart. The 2-axis mixed chart in Numbers can do a bar chart and a line chart together but not a stacked bar chart with a line chart. And there is no setting the gap between bars to a negative number (too bad). However, you can do this with two charts that are overlapped (sorry, I did a line chart with a line vs just the data points):



Formula in column E is =B

All it does is recreate column B but without the word in the header. This will make the legend for the bar/column chart look correct with just the one label


Formula in F is =C-B


For the stacked bar chart, select columns A, E & F

Set the Y axis min to 0 and the max to an appropriate number.

Set the fill color for the Min series to "none".

Choose for the chart to show hidden data (so you can hide columns E and F later).


For the line chart, select columns A and D

Set the Y axis min and max to the same as the bar chart.

Slide this chart over the bar chart so you can resize and position it.

The X axis will need to be squished until the X axis labels align with each other.

After it fits, turn off the X and Y axis, gridlines, and value labels so all that is left is the line and the legend.


Move the two legends so they look like one. Be careful not to move an entire chart.


4 replies
Question marked as Top-ranking reply

Aug 28, 2022 7:49 PM in response to robm30

Sounds like a stacked bar chart and a line chart. The 2-axis mixed chart in Numbers can do a bar chart and a line chart together but not a stacked bar chart with a line chart. And there is no setting the gap between bars to a negative number (too bad). However, you can do this with two charts that are overlapped (sorry, I did a line chart with a line vs just the data points):



Formula in column E is =B

All it does is recreate column B but without the word in the header. This will make the legend for the bar/column chart look correct with just the one label


Formula in F is =C-B


For the stacked bar chart, select columns A, E & F

Set the Y axis min to 0 and the max to an appropriate number.

Set the fill color for the Min series to "none".

Choose for the chart to show hidden data (so you can hide columns E and F later).


For the line chart, select columns A and D

Set the Y axis min and max to the same as the bar chart.

Slide this chart over the bar chart so you can resize and position it.

The X axis will need to be squished until the X axis labels align with each other.

After it fits, turn off the X and Y axis, gridlines, and value labels so all that is left is the line and the legend.


Move the two legends so they look like one. Be careful not to move an entire chart.


Aug 29, 2022 3:55 AM in response to robm30

It would help to have a screenshot to see the look you are trying to achieve.


However, note that a 2D Scatter chart can be handy for quickly displaying avg-max-min data. The trick is to add two extra columns to the chart data table and use error bars, as illustrated in this Numbers document (Dropbox download). In its basic form (easily customized) the chart can look something like this:




SG



Aug 28, 2022 8:07 PM in response to Badunit

Alternatively, if you need the second Y axis, you could plot Max and Avg in a combination chart and plot Min as a bar chart with the bars being white fill then overlay it. You can make the white minimum bars a little wider to make it easier to align (just set the gap to a smaller %). You'll have to turn off gridlines. You won't need columns E and F in your table if you do it this way but you might want to do something similar for purposes of the chart legend, if you have one. As you see, the one in the screenshot has the blue bars labeled as "max".


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Overlapping bar chart

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.