In MS Excel 2010, I have the following data. I created a simple line chart but it uses the data axis automatically (that's what I want). The problem is that the first date (11/25/2015) is right below 0% (of the y-axis) and I don't want that to happen. I want to move the middle area of the chart along with the x-axis a bit to the right so that it doesn't look shabby. How to go about doing this?
I added a new row and then deleted it but the chart automatically adjusts by itself. I have also tried simply resizing the chart. I've also tried creating new rows but I don't know if that's the right way.
Chart Example
select your X axis and right click on it and then select Format Axis from the pop up menu.
in the options screen that comes up on the right you can set your MAX and MIN values so your chart does not resize on you at all or you can limit how much it can resize in one direction. You can also set where the AXIS crosses. now this will apply to where the Y axis crosses.
This information can be set for the Y axis as well by selecting it and repeating this process. When you do it for the Y axis, you are controlling where the X axis will cross.
Related
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.
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
I'm trying to plot 6 timeseries side by side in excel. The default 3d bar charts and surface plots almost do the right thing. The problem is the timeseries are laid on the z-axis as I expected but they're jammed so close together you can't read the labels.
I've tried changing the tick interval and re-sizing the chart. Re-sizing the chart only seems to affect the x and y axis lengths leaving the z-axis pretty much the same short useless length.
How do I change the z-axis length in Excel?
To adjust the z-axis size, do the following:
Select Layout/3D Rotation on the ribbon. A 3d rotation dialog box opens.
Ensure 3D Rotation is highlighted on the dialog's left pane and then deselect Autoscale at bottom the right pane in the dialog box.
To lengthen the z-axis, increase the Depth percentage from 100 to 200, 300 or whatever is needed to accommodate your z-axis labels.
A few other points - the graph itself is contained in a picture within the chart panel. You can lengthen the z-axis somewhat by clicking on the chart to select the chart's frame and then resize the frame.
If you're plotting time series data using the 3d bar graph, you can click on a specific bar and Excel will show you the datum value that produced the bar.
To look on the backside of the graph to see if there are hidden values, set the x-axis rotation to 135. Lengthening the z-axis alleviates the issue somewhat as it spreads the series further apart and lets you see "behind" the front series a bit better.
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.
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.