Excel: как создать неоднородную диаграмму стека

895
user1539217

Я хочу создать диаграмму стека, которая показывает временную шкалу из 3 фаз по оси X (интервалы, разделенные месяцем) и общий бюджет по оси Y. Бюджеты для всех проектов будут складываться друг против друга. Как мне создать этот график и как отобразить имя проекта на каждой панели? Я хотел бы иметь 3 цвета на графике, чтобы представить 3 разные фразы. Ниже приведен пример данных для двух проектов. В этом примере данных часть фазы 1 проекта B складывается в фазу 2 проекта A.

Project Phase Start End Budget A 1 07/01/2014 01/16/2015 $150,000 A 2 01/19/2015 08/28/2015 $790,000 A 3 08/28/2015 09/29/2015 $650,000 B 1 07/01/2014 07/30/2015 $ 68,000 B 2 07/31/2015 12/16/2016 $335,000 B 3 12/16/2016 01/17/2017 $543,000 

gantt_bar_sample

2
У вас есть образец того, как вы хотите, чтобы он выглядел (чтобы помочь вашему описанию)? dav 9 лет назад 0
Я не могу загрузить изображения сюда, но я также задал этот вопрос на справочном форуме Excel: http://www.excelforum.com/excel-charting-and-pivots/1021477-gantt-chart-and-budget-in -one-graph.html Вы можете увидеть изображение того, как я хочу, чтобы оно выглядело там после входа в систему user1539217 9 лет назад 0

1 ответ на вопрос

3
dav

You can create that type of chart using Excel's stacked column chart. To make things easier, you should reformat your data. Here's one method:

  1. Create a table of your data, with the following columns:

    • Date
    • Project A, Phase 1
    • Project A, Phase 2
    • Project A, Phase 3
    • Project B, Phase 1
    • Project B, Phase 2
    • Project B, Phase 3

    Each date period (month or day) will have its own row of data in the table.

  2. Enter your monthly budget values on the appropriate line, in the appropriate column. Leave blanks (or insert =NA()) into the cells that have no value.

    data sample

  3. Create a stacked column chart, using the above data.

  4. Format the chart series to have 0 gap (this creates the gantt effect) and no borders. Then, format the rest to taste.

Here's what the chart could look like: gantt_column_excel

I used two date columns (Month & Year) to get the stacked label effect on the horizontal axis. Also, I only used month level, but you could use daily level for more granularity.

For the labels, I simply chose a single data point for each series and added a label to that point. That works for a small number of labels. If you have many more, you'll want to consider something more automated (consider an XY chart overlay, with the datapoints to place labels).

To create data labels using an XY chart overlay, you'll need to add some data to your table and your chart (you can shortcut some of this by installing and using the excellent FREE add-in XY Chart Labeler)

  1. Add these additional columns to your data table (again, you can shortcut some of this, once you learn the basic principle):
    • Number (from 1 to whatever your row count is)
    • A column for each data series (e.g. A1, A2, A3, B1, B2, B3). Name the column what you want your label to say. (Excel, by default, can only use a Series name, X value or Y value as a data label).
  2. In each label column, on the row of the middle value in your series, enter the series value divided by 2. That will place a data point half-way through your data series on the X Axis, and half-way up your data series on the Y Axis.
  3. Add another data series to your chart (it doesn't matter what, we'll change it in the next step).
  4. Select the new data series and change that series chart type to XY.
  5. Use Select Data to update your new data series with the XY data values. You'll want"
    • Series Name = your new column header, which will be your new data label.
    • X Values = Your new counter column (from step 1).
    • Y Values = Your new data label column (from step 2).
  6. Once your data point is added, format it to no symbol (we're only using it as a placeholder for your label).
  7. Add a data label for this new point, selecting Series Name and Y Value, separated by a new line.
  8. Repeat for all points.
Спасибо за ваше предложение! Я все еще пытаюсь понять, как добавить метки, используя наложение XY-диаграммы. Как ты это делаешь? user1539217 9 лет назад 0
Добавил несколько указаний внизу ответа. dav 9 лет назад 0
Это сработало для вас? dav 9 лет назад 0
Да, спасибо! Есть ли способ добавить границу для каждой комбинации фазы проекта вместо отображения границ для каждого месяца? Я попытался использовать диаграмму с областями с накоплением, но линии границы показаны по диагонали, а не по вертикали. user1539217 9 лет назад 0
Я не думаю, что есть простой способ сделать границы таким образом, так как Excel смотрит на каждый столбец с накоплением как на отдельный объект. Один из возможных способов (но я не уверен, что оно того стоит) - использовать XY Chart для рисования ваших границ - я просто не думаю, что это будет легко сделать автоматически - вам, вероятно, придется создавать собственные данные установите (на основе вашего основного набора) каждую из угловых координат для точек XY, затем отформатируйте их с видимой соединительной линией. dav 9 лет назад 0
Я думаю, что использование Shape Effects -> Inner Shadow для каждого объекта работает, чтобы получить границу. user1539217 9 лет назад 0

Похожие вопросы