Column chart with primary and secondary y-axes - excel

My problem seems simple, I just want to make a column chart with 2 y-axes. When I do this, Excel automatically puts the columns overlapping. I do not want them overlapped! How do I go about correcting this?
An image of what is happening:

I believe this method is more straightforward:
Create two dummy series. Series1 and dummy1 on the primary axis, Series2 and dummy2 on the secondary axis.
Reorder the series so dummy1 is above Series1

You could achieve the chart as shown below with some rather careful manipulation:
Basically is requires spacing out your data as shown in columns A:C but also right-aligning the horizontal axis labels, adjusting the secondary axis maximum (and format of both vertical axes, if necessary) and the Gap Width for Series1 to about 10% and for Series2 to about 5%.
(PS I chose the wrong value for C5.)

I find it easier to change the secondary Y data's chart-type to a scatter plot. The overlap of this symbol with the bars of the primary Y, is the desired result. You simply right click the secondary bar and select "Change the chart type", and select scatter with or without the connecting line.

Related

Excel Pivot Chart 'fixed' horizontal axis

I have got a horizontal axis that holds numbers (roughly 7,5 through 18 at 0,5 intervals) based on the set filters.
I would like it to always show the 7,5 though 18 on the horizontal axis, even if the filtered only is applicable 10 to 12,5 for example.
Thing is, the axis options do not show bounds to set as I have found to appear in other solutions:
I've double checked to make sure my axis data is formated as numbers:
In case of possible relevancy, the formula used to calculate the day time indicator is
=mround((mod(GDQ[Timestamp];1)*24);0,5)
Is there a way to have the horizontal axis always show start through end plotting the filtered data always on the same timeframe?
I had exactly the same issue, and solved it on the pivot table side.
Go to the field setting (in your case for the day/time indicator, your x-axis), then to the tab "Layout & Print", and activate "Show items with no data".
Now every category will always show up in the pivot table, even with no data after you do some filtering with your slicer, and the layout of the graph will remain constant (axis limits).

Can't align x-axis on hybrid scatter/area chart

Please have a look at This Excel chart. Here is a screenshot:
Here is the data:
There is a scatter series of blue of dots (plus a trendline) and a green area series. The chart data are contained within the series.
The problem I have is that the x-axis values of the two series are not aligned. For example, the second and third blue dots at x = 3.1 and x = 3.8 are in the correct place along the x-axis, but in the green area series they appear to be above x = 2.0 and x = 3.3. How to fix this?
Change the Scatter to a Line Chart, then format Line Color so that there is "No Line". Add trendline.
There may be another way to do this while retaining the Scatterplot, I'm not sure, but this seems to be visually what you're looking for, but I think you will need to use a Line Chart for this unfortunately. The problem is summarized in this similar Q on SuperUser:
https://superuser.com/questions/964264/aligning-stacked-bar-chart-w-scatter-plot-data
The short answer is that your combining (unsuccessfully) a categorical series (the columns) with interval/ratio series (the line charts). So, Excel doesn't know how to plot your categories (columns) on an interval scale (the current X axis).
You can verify this by selecting Chart > Layout > Axes > Secondary Horizontal Axis > More Secondary Horizontal Axis Options. Without making any changes to the axes configuration, the second X-axis will now appear along the bottom of the chart, and you can see it is scaled differently from your Scatter data.
I.e., in the Scatter series, the data is X/Y pairs. But in your Area chart, it treats the X-values as categorical, and in this context "1.1" is no different than "Bob" -- it is a cardinal representation of the data rather than an ordinal representation.
The problem I have is that the x-axis values of the two series are not aligned.
So even though the two series appear to share the same set of X-Values, the Chart is simply incapable of treating those as the same type of data. The x-axes are not aligned because they are not the same data or even the same type of data!
All that said, if you change both series to XY Scatter, it is possible (with some extraordinary effort) to apply shading/coloring below a series or between two series, etc.
http://peltiertech.com/fill-under-between-series-in-excel-chart/
http://chandoo.org/wp/2013/02/13/shaded-line-charts-excel/
What you can do is plot the Area graph on a secondary axis. Then go to Chart -> Layout -> Axes -> Display Secondary Horizontal Axis to see the axis, right click for its properties and change the type of the Axis Type to "Date axis". This (kind of) changes the axis to a numerical type, as opposed to a category type.
However, the area graph will still be placed incorrectly too far to the right because Excel will continue to plot the series as a (kind of) category type, with its data points appearing in the centre of each category as opposed to at the correct x value like in an XY scatter plot.
To get the graphs overlaying the most correctly, you can create a Scaled-up x value series which is, say, 1,000 times the original x-values and use this for the x-values of the area plot. By scaling by 1,000 or 10,000, you eventually get the granularity to a point where it looks more like X-Y plot, but is actually an area plot, and the graphs look like they coincide perfectly.

Secondary axes in Excel for the same data series

I have a few dozen data points with an ordinary x and y axis. Now I want to have a secondary x axis for this data set.
That's how I'd like it: bottom (normal) x-axis being the "Time", the y-axis being the "Magnitude", and the top x-axis being the "Air". Attention, the Magnitude values are reversed - this is wanted.
Thank you very much for telling me how this works!
Here's the dropbox link
https://www.dropbox.com/s/dd94769ehg1rq6m/worksheetSecondaryAxis.xlsx?dl=0
Not sure I'm understanding your question correctly, but here goes. To plot the second set of data using the same y-axis and a secondary x-axis, follow these steps in Excel 2010:
1. Add the 2nd data series to the plot, e.g.
=SERIES(,Tabelle1!$D$6:$D$45,Tabelle1!$B$6:$B$45,2)
It will not be visible because it falls outside of your fixed x-scale.
2. Select the 2nd data series. You can do this by clicking on the 1st data series and then using the up-arrow to get to the next data series.
3. The left-most part of the ribbon should now show Series 2. Below that click the Format Selection button to open the Format Data Series dialog
4. Choose the Plot Series on Secondary Axis option
5. In the ribbon choose Chart Tools | Layout | Axes | Secondary Horizontal Axis | More Secondary Horizontal Axis Options
6. Choose appropriate values for min and max (say 1.0 and 1.6 for your data).
7. Select the secondary Y-axis (on the right of the graph). Format the Horizontal axis to cross at the max value (-13.18 in my case).
8. In the ribbon choose Chart Tools | Layout | Axes | Secondary Vertical Axis | None to hide the second y-axis.
9. Select any other formatting options you want for the 2nd x-axis
Hope this helps --- here's my result

Excel curve (Showing values at both sides of y-axis)

I have created a curve in Excel 2013.
At the Y-Axis I am showing some values that show the probability for survival for each 100.000 citizen. Now my problem is, that I want to also show it in percentage, at the right side of the Y-Axis.
How do I do this?
Thanks in advance.
Ps. I have added an the curve as an image, so that you can see how it looks at the moment.
Add a secondary (Y) axis:
Create a combo chart with a secondary axis
When the numbers in a chart you created vary widely from data series to data series, or when you have mixed types of data (for example, price and volume), you can plot one or more data series on a secondary vertical (value) axis. The scale of the secondary vertical axis shows the values for the associated data series. A secondary axis works well in a chart that shows a combination of column and line charts.
Combo chart with secondary axis
In Microsoft Excel 2013, you can quickly show a chart like the one above by changing your chart to a combo chart.
Click anywhere in the chart you want to change to a combo chart to show the Chart Tools.
Chart Tools
Click Design > Change Chart Type.
Type group on the Design tab
On the All Charts tab, choose Combo, and then pick the Clustered Column - Line on Secondary Axis chart.
Combo chart with secondary axis on All Charts tab
Under Choose the chart type and axis for your data series, check the Secondary Axis box for each data series you want to plot on the secondary axis, and then change their chart type to Line.
Make sure that all other data series are shown as Clustered Column.
To clarify what is plotted on each of the vertical axes, you can add axis titles.
.
If I understood you correctly, you only need a right axis that shows a percentage scale, with, e.g., the tick mark for 100% at the same level as the tick mark for 100000 on the left axis.
You do not need any additional curves.
Then, you need to:
Create some dummy data. You may use two cells, which will give you a series with a single data point. Use 10 (X range) and -1 (Y range). Depending on the options you selected for your y axis, you may have to set the Minimum value fixed at 0 (you can do this now or later).
Add it to the plot.
Assign it to a secondary y-axis. Right-click on the series, Format Data Series -> Series Options -> Secondary Axis. Or, if you find it difficult to select it this way, select the chart, Go to Format, select the series from the pull-down menu on the top left, and Format Selection.
Format the right axis scale to give you a correct matching with the left scale. Right click on the secondary y axis, set the Minimum fixed at 0, the Maximum fixed at 1.2 (to match the figure you posted), and the number format as Percentage. PS: there will be a tick label "120%" on the right axis. That will not look good for what you are plotting. It will be best to set the Maximum of the left axis to 115000 (say), and the right axis to 1.15 then.

Getting The Maximum Of An Excel Chart's Y Axis (When There Are Two)

I would like to know how to programmatically find and the Y axis maximum of an excel chart when there is more than one available.
My end goal is to find the max y-axis values, compare them, and set them both to the greater of the two.
VBA similar to this will retrieve scale value
With ActiveChart.Axes(xlValue, xlPrimary)
ActiveSheet.Range("A1").Value = .MaximumScale
End With
For more detail on how to link chart axis scale parameters to values in cells check out
http://peltiertech.com/Excel/Charts/AxisScaleLinkToSheet.html#ixzz0r8qN248l
If you want both axes to automatically show the same min and max values, you need both to plot the same spread of data.
In this simple example, I used the following data to create a chart, with "primary" plotted on the primary axis and "secondary" plotted, well, you know.
In the next table, I've calculated the min and max of all the data. I calculated min and max twice and staggered them to clearly show what I'm doing. I copied the shaded range, celected the chart, and used Paste Special to add the data as new series, in columns, series names in first row.
The resulting chart is shown below left. I've ensured the the new series "pri" is on the primary axis and "sec" is on the secondary axis. Since both axes are using the same min and max data to autoscale, both have the same scales. Below right I've hidden the dummy series by formatting them with no lines and no markers. I've hidden each unwanted legend entry by first clicking on the legend, then clicking on the individual legend entry, then pressing Delete.
This technique can also be used to synchronize the axes of multiple charts. Below are three small charts with different scales (top row). In the middle row, the calculated min and max have been added to each chart, causing their axes to autoscale on the same min and max. In the bottom row, the dummy series have been hidden, leaving behind uniform axis scales.

Resources