How to fix formatting when adding another series to Excel chart? - excel

My original Excel bar chart looks like:
I want to add another series for 2014 data, as shown below:
I want the 2014 series to be scatter points overlaid on the original bar chart. However, when I add the 2014 series to the chart and change its chart type to Scatter, I obtain the following chart:
How can I change the bar chart back to its varying palette of colors as it is in the original chart, and change the 'Current' axis label to its original format which lists the different categories?
Ideally I'd want a time-efficient solution as I'll have to repeat this process with a number of similar charts.

I'm not sure if this is possible to do (quickly, elegantly, and/or without VBA) with multiple chart types. A few possible alternatives:
If you are only showing the difference from 2014, is a chart even necessary? Would a table be a better visualization?
Since it appears you are trying to plot the difference, why not plot this as a line graph?
Better yet, just plot the difference.

Start with a graph of one data series:
Add a second data series using Chart Tools|Design|Select Data:
Click the Add button and add data (series values) for a second series. Your chart should look like:
In the chart select the second data series. Then use the Chart Tools|Design|Change Chart Type tools to change the chart to a Line Chart.
From here on in it's formatting.
Select the second data series and do Chart Tools|Format|Format Selection to set the line color to no line. You can do any other formatting at this time.
Select the first data series and select each bar one at a time. Then use the Shape Fill button to customize each bar color:
Hope that helps!

Related

How to change chart axis type to include only existing data

I have been trying to change the chart axis on a scatter plot chart so that Excel doesn't fill in missing dates (my data table has missing weekend dates). However, I cannot do that through the UI in Axis options. I had two scenarios:
For one chart, the option to change the Axis type to Date axis in the formatting windows that appears, however clicking that radio button doesn't do anything. After leaving and re-entering the interface, the option goes back to Automatically select based on data.
The option doesn't exist on another scatter plot I have. When I enter the Axis options in the interface, there is no option to change the Axis Type for the second chart. In fact it is quite different.
So I tried to change the Axis type using VBA. I found that this line of code should work (based on macro recorder and Microsoft Docs). cht is a valid chart object referring to an existing chart
cht.Axes(xlCategory).CategoryType = xlTimeScale
I doesn't do anything on the second chart, no issues running though. However, when run using the first chart(the one where the radio button to change the axis type appears), I'm thrown this error
Run-time error '-2147467259 (80004005)'
Parameter not valid
Which seems strange since the macro recorder agrees with the line of code.
Additionally, Microsoft states here: https://learn.microsoft.com/en-us/office/vba/api/excel.axis.categorytype
You cannot set this property for a value axis.
While in the example, they clearly set the CategoryType property to something else.
So in essence, I need to format the chart to contain only the data I have in the data source range and nothing else. I tried Excel's UI and VBA, but they don't work and are contradictory.
Does anyone have a solution to format these charts?
Also, if someone can explain these weird property behaviours, that would be awesome!
CategoryType is only valid for the X axis, that is, the horizontal axis of a line chart, area chart, or column chart or the vertical axis of a bar chart. The X axis of an XY scatter chart, like the Y axis, is a numeric axis.
If you choose a date scale axis, Excel will fill in dates. It's almost like a numerical axis, in that if you have some numbers (like 1,2,4,5) the axis contains any numbers in between (like 3). If you want weekend dates to be omitted, you have to choose xlCategoryScale.

How do I create a contour map like the one in the attached image? (preferably in Excel, but open to other options)

I need to create a graph that properly represents the profit-maximizing model of aircraft in different scenarios. I apologize in advance for my lack of understanding in what exactly to call it. As mentioned, I have found the type of graph that would best represent this, but cannot figure out how to code/create it. I have tried using Excel and Think-Cell (and either one of them may work, I just haven't figured out how) and haven't had much luck. The image below represents the ideal graph, linked here:
Does anyone have any idea how to best go about this? Thanks in advance.
Edit: The data I have now looks like this, linked here:
You need to use the data to generate a Stacked Column chart.
Here is how I set up my own example data (before you posted your own data format):
Next, select all rows and only the first four columns of the data (42R x 5C) and Insert-->Charts-->2D Column-->Stacked Column. You should get a chart like this:
Then change the vertical axis options to show Bounds Min=1.0, Max=4.0, Units Major=0.2, Minor=0.1.
Next, select any of the data series in the chart and format the Series Options for Series Overlap=100%, Gap Width=0%.
After that, I deleted the Title and Legend, set the Line Style for both Axis to Solid Fill, Black Color. Then I changed the data series colors to be close to your example. Lastly, make sure the chart is selected (the border is highlighted with the squares at the corners), then Insert a TextBox over your data and type "B747-200P2F" and manually place it over the correct data area. Repeat this for the other series and you get this:
Finally, we'll work on the Jet Fuel price line. This series will be added to the chart, then plotted on the secondary axis and it's chart type changed to Line.
To start, select only the Jet Fuel price column (F1:F42) and then copy that range into the clipboard. Then, make sure the chart is selected and, from the Home ribbon, select Paste Special. Use the default settings, or choose Add cells as New Series, Values (Y) in Columns, check Series Names in First Row, uncheck Categories (X Labels) in First Column, then click OK. (Not much will seem different on the chart yet!)
The next steps are important to take in order (at least for me). Select only the "Jet Fuel Price" series and change the Series Options to Plot on Secondary Axis. Then change the axis options to set the range from 1.0 to 4.0 and set labels to None. Just so we're tracking, here's what I have so far:
The (almost) final step is to select only the "Jet Fuel Price" series again, then right click it and choose Change Series Chart Type. Make sure you select the Combo chart type and make the selections for each of the series chart types as indicated in this picture:
Now (finally!) just add another textbox, put in your label and set the text color to red.

Excel: Z-Order of Series in Chart and Legend

I have a combo chart in excel, with clustered bar charts (for a box plot) and lines. I am trying to display the bar charts/box plot in front of the lines, but am able to do so.
I tried moving the bar charts to the top and/or bottom in "select data" - but no change.
Any suggestions?
Am using Excel 2013.
Thanks!
I believe it is not possible. You can change display ordering of Excel series by:
changing the plot order of the series (this is what you have done in the "Select data" dialog),
changing the axis on which the series are displayed (series on secondary axis are displayed over the series on the primary axis).
But from my experiments no combination of changes makes the lines appear behind the columns.
There are two workarounds that might or might not help you:
you can create two charts on top of each other and put the chart with the lines behind the one with the columns,
or you could create a line chart (most likely you would need scatter chart), that is not a single line but a series of segments where the columns are not shown (this one is not that easy to do)
What are the lines for? If you are just trying to identify some zones along the value axis, you could instead use stacked areas, which would give a banded appearance. Areas are always drawn behind bars and columns, while lines are always drawn in front of lines and columns.

Excel chart with countries in y-axis, % in x-axis, circles as markers and control groups

Do you know if this chart, as shown in the following image, can be done in Excel?
Chart:
I don't even know how this kind of chart is named, so I cannot search in the web for tutorials. I don't need to display three points on every row as in this chart (one is enough), and even I can mark the control group manually.
Yes this can be done in Excel.
If you want vertical orientation like on the picture above, then you should probably use the Scatter chart with quite some modifications. You would set the x values of the series to your values and the y values can be just 1,2,3,4,5.... The biggest problem with this approach would be how to display the correct categories. There is a tool to help you do that and it is discussed here: https://superuser.com/questions/485883/how-to-create-dynamic-scatter-plot-matrix-with-labels-and-categories-on-both-axi
For horizontal one you can use a normal line chart - with hidden line and only markers visible (Excel doesn't support vertical line graphs).
Even three groups are easy to do, you just need to add three series and format them accordingly.
The lines are also quite easy to do, you add minor / major gridlines to the chart and then format those as well.

Excel - self adjusting chart marker

I have a series of line graphs in excel that is data over time.
There are several date milestones in the chart (I.E. Nov 24th: Black Friday)
On the chart I'm trying to put in an arrow on the chart with the label over the chart near the date. (See attached, below)
The problem is that these are manually added and as I expand the data in the chart (add another month of data) the chart compresses and my milestone markers have to all be hand repositioned.
How can I do these milestone markers so that I don't have to hand edit the table every time I expand the chart? A sample chart with a column for the desired labels can be found at this link.
As an added note, I'm using Office (Excel) 11 for Mac.
is it possible to use data labels for the milestones? There is a nice article about using a formula to make a custom data label:
http://chandoo.org/wp/2010/05/05/change-data-labels-in-charts/
Make your arrow and label outside the chart. Plot a new series with one point, with X corresponding to the date and Y determined appropriately (as I'll describe in a moment).
Copy the shapes you want to use as a milestone, select the point you added above, and paste (Ctrl+V).
Now adjust the Y value for this point so the milestone is where you want it.
This tutorial shows a similar approach:
Use an Arrow to Indicate Special Points

Resources