Excel Chart - Do not Hide Horizontal Data Label - excel

I want to plot a simple chart with Date on the X axis and Number on my Y axis. Tried XY scatter but Excel try to be smart and hide my data labels.
Also, Excel tried to re-order my Date which I do not want.
Date POS
22/10/2017 7
01/10/2017 14
08/09/2017 8
11/08/2017 6
28/07/2017 4
09/07/2017 3
26/06/2017 4
09/06/2017 11
19/05/2017 8
23/04/2017 8
02/04/2017 5
19/03/2017 1
19/02/2017 3
05/02/2017 10
30/01/2017 8
08/01/2017 3
20/11/2016 13
11/11/2016 7
28/10/2016 12
16/10/2016 5
30/09/2016 7
16/09/2016 3
27/08/2016 8
14/08/2016 13
24/07/2016 3
17/07/2016 7
17/06/2016 2
27/05/2016 4
24/04/2016 16
10/04/2016 1
27/03/2016 2
04/03/2016 4
19/02/2016 4
24/01/2016 1
03/01/2016 1
Would like to see everything. Is it possible ?
Thanks.

To answer your questions:
Brief:
1) You can't see all your data labels on the X axis unless you format the X axis to have major interval of 1.
2) With a scatter plot, you cannot have your original labels retained on the X axis and, in your case, as your dates are recognised , they are ordered as such. You would need to convert the dates to text and plot as a line chart without the line.
Solution:
1) Right click X axis and set the major interval to a balance between the amount of detail you want to see and that which is legible. To see all data points, with data that are whole numbers, then 1 should do it, but may become very crowded, so a trade-off.
2) To stop the re-ordering of your dates: The trick is to convert your dates to text using =TEXT(A2,"dd/mm/yy") where A2 is a data point for the X axis etc. In the picture below, this is showing above B39, as I have transposed your original dataset, but the formula was pointing at your original vertical dataset. If that makes sense.
You arrange your data horizontally with each data point in its own column (i.e. transpose your original data set) and then plot this as a line chart and right click format data series > no line. Making sure markers are visible.
On an old Mac with Excel 2011, similar process for Windows and later Excel, removing the line would look like:
And you can select a line colour and add it back in:
Reference i gave in comments which reminded me to transpose the data is scatter-chart-with-one-text-non-numerical-axis
To be honest, if you are going to plot a line chart which has one axis which appears to be dates, it may confuse users if those dates are not then in order.

I recommend to convert all values to date and graph away with standard scatter plot...if you treat the dates as text, and then graph only the entries, then the variance between the dates can be very misleading (unless there are no gaps, 100% consistent).
Below is a snippit of text and of dates with your provided data. It is nearly identical, but not quite. If your data set is larger and there is larger variation between date entries then it will definitely provide a misleading chart.
If you go with the text path, change to line chart, hide line, set color to markers, and put the max interval to 1.
If you go with the date path, then you will not be able to read the x-axis with each date explicitly stated. There would be too many dates to display. You could add data labels to display in the plot area instead of the x-axis, but it is clutter.

You have stumbled across what many also find, that Excel stinks as a graphing tool. This is because about 10 years ago, Micro Soft went stupid and started trying to make software that is "really helpful for the user" translate "makes stupid decisions we don't want". One case in point is your problem.
Excel Line charts are not line charts; they are bar charts that just use lines instead of bars. The issue at hand is how different chart types treat the X-Axis. How you treat the X-Axis determines what kind of chart you use. There are basically only two kinds of X-Axis: discreet/continuous (aka. category/value). For example category would be something like color (RED/BLUE/GREEN). There is no "distance between colors" (what is the distance between red and blue?). Where as numbers and time have a concept of distance inherent in them. For example: how many days are there between jan-1-2001 and jan-10-2001? or What is the distance from the 10 yard line and the 20 yard line?
The problem is that to use charts in Excel, you have to know how each chart type treats the X-Axis. Most people would expect the LINE chart to treat the X-Axis as a value, but MS is not most people so they decided to treat it like a category (unless it is a date more on that in a moment). So, you cannot plot a number X-Axis on a line chart. You should use the XY SCATTER chart instead. Scatter chart in Excel assumes both axis are numbers and thus plots your numeric X-Axis in the expected manner.
if you use a line chart (or bar chart) and you double click your x-axis values, or right click them, you can go to their format axis page where you will see that you have the choice of treating the x-axis as text or dates, but not numbers. This is why when you sort your data differently in a line chart or bar chart, the chart changes, it is because the x-axis is being treated as a category and categories are plotted on the chart in the order they are seen in the data. This can be very useful when your x-axis really is a category but then if that were so you would most likely be using bar charts not line charts. My experience is that BAR charts and LINE charts in Excel behave exactly the same so consider that when thinking about using a line chart.
if your x-axis is a category use bar chart or pivot table and exploit sorting.
if your x-axis is a date use bar/line chart and mark it as date in format-axis page.
if your x-axis is a number use scatter chart.
if your data is something else, or you have a specific perspective you want to emphasize, then do some reading about the different chart types in Excel and pick the one that was created to show what you want to show.

Related

How to show two regression trend lines in one chart using excel 365

I want to plot two trend lines, one from 2-3 cm and the other from 3-4 centimeter like the attached picture. How can I do it using Excel 365?
My output is coming like this
Here's a solution without the need to split your dataset.
The chart is a XY scatterplot, with 7 series (Vol-1, Vol-2, Vol-3, Vol-4, Vol-5, Trend1, and Trend2)
The Trend1 series is a bit weird, but basically in the Series X Values box, you select the Dist column (A2:A4 only) 5 times separated by a comma:
=('Temp Sheet'!$A$2:$A$4,'Temp Sheet'!$A$2:$A$4,'Temp Sheet'!$A$2:$A$4,'Temp Sheet'!$A$2:$A$4,'Temp Sheet'!$A$2:$A$4)
Then in the Series y-value box, you select the appropriate rows in each of the Vol columns:
=('Temp Sheet'!$B$2:$B$4,'Temp Sheet'!$C$2:$C$4,'Temp Sheet'!$D$2:$D$4,'Temp Sheet'!$E$2:$E$4,'Temp Sheet'!$F$2:$F$4)
So Trend1 looks like this:
Repeat the same thing for Trend2, but with rows 4 through 6.
Next, add a trend line for Trend1 and Trend2.
Finally, remove the markers for Trend1 and Trend2 so the only datapoints visible are Vol1 through Vol5.
From there you may choose to add axis titles, set axis limits, etc.
Split your data into two series (2-3 and 3-4), then add a trendline to each series.

Is is possible to create a scatter chart in excel that has a 2 dimensional X axis

I'm trying to create what I would call a Vertical stacked scatter plot or a scatte plot with a 2 dimensional x-axis. I tried using excel's normal charting tools as well as its pivot charting functionality, but I have not been able to crack this one. As anyone had any luck with this type of a chart or can you recommend a tool that can handle it. I've included an image of what I'm trying to achieve below:
The Y axis has months, and the X axis is a combination of Year and Units.
Thanks in advance for your input.
This can be easily handled in Tableau, if you and your users have access to it. For example, using sample Excel data with this format:
Date Units
1/1/2014 10
2/1/2014 20
3/1/2014 30
4/1/2014 40
...
You can create the scatter plot you've shown in your mock-up by doing the following:
Drag Date to Rows and change it to Month level
Drag Date to Columns and leave it at Year level
Drag Units to Columns
Change the Marks type to Circle
Reduce the size of the circles so they look like points
Sort Month according to your preference
Here's a link to a screenshot of the set-up and resulting plot:
screenshot of scatter plot
There are also many formatting options to change the look of the plot.

Dynamic Milestone Trend Analysis Graph needs same y-axis as x-axis in Excel with VBA

After a couple hours of work I come to you guys with this graphing problem. I need to create a Milestone-Trend-Analysis which can be seen on the german wikipedia , though not in the english version.
General Information
In short, the diagram has report dates on the x-axis (for now, on every first of the month, another report is due).
The y-axis should mirror the x-axis completely. In length and also the tickmarks. The dates get bigger from the bottom to the top.
In my case the x-Axis is on top of the diagram.
Every report consists of a number of "due-dates", one for each assignement in progress. They are the estimated "finishing dates" of that particular assignement.
If the estimated finishing date stays the same in the next report period, the graph for that assignement stays on the same level. If the estimate is earlier, the graph trends down. Normally they go up, since the assignement has some delay :-D
The x-axis needs to be dynamic, since the whole project is basically finished when its last assignement is finished. If one of the assignements is running late, the whole project gets delayed an thus the x-axis needs to be longer/get more ticks.
Since the y-Axis mirrors that, it has to change too.
MY PROBLEM
The x-axis has a number of discreet values, since the reports come in every month, or every two weeks. But that does not change.
The values for the finishing dates are continuous, since the assignements can be terminated whenever.
That leaves me with the problem of having to cut the y-axis in equal-size chunks, although the months of the year are not equal in size. At least that is, what I think excel forces me to do.
I can assign a max limit and a min limit for the y-axis and I can assign a distance between each main tickmark. Since Excel works with a continous number for each date, the 2014/01/01 would be 41640. And 2015/01/01 is 42005. Since I have 12 month on the x-axis and I need 12 on the y axis, I would have to have the main Ticks at a distance of 30.42 ... which gives me the following Months on my axis
January January March .... December December
Does anyone know an answer for this? Is there a way to have excel make the tickmarks on the y-axis not equal distance?
Any input greatly appreciated.
Kaz
I did not find a way to make Excel have variable tick mark distances. But since I coud not have it that way, I had to make the month equally long.
This works for me now:
'calculate the norm for different type of month including Schaltjahr
Select Case cellMonth
'February
Case 2
'Schaltjahr and Schaltjahrhundert
If (cellYear Mod 4 = 0) Or (cellYear Mod 400 = 0) Then
resultDay = (30 / 29) * cellDay
Else
resultDay = (30 / 28) * cellDay
End If
'31 day months
Case 1, 3, 5, 7, 8, 10, 12
resultDay = (30 / 31) * cellDay
'30 day months
Case Else
resultDay = cellDay
End Select
Now I just have to scale the axis to numberOfMonths * 30. It now leaves adjusting the names of the y-Axis, which seems to be a whole different story.
Kaz
You can put arbitrary labels along the Y axis by adding a dummy XY series.
Here is some data that I think captures your issue, plus a line chart showing the data, plus the data that I'll use to construct a dummy Y axis.
I used a line chart so the X axis at least would be easy. You just have to make sure that the axis is formatted as a date axis with Base Unit of Days.
Here is how I built the axis.
Top Left Chart Below: I copied the dummy axis data, both columns of the data includingt the header row. I selected the chart, and used Paste Special to add the data as a new series, data in columns, series names in first row, categories in first column (but don't replace existing categories).
Top Right Chart Below: I right-clicked on the added series, clicked on Change Series Chart Type, and selected XY Scatter with Lines and Markers. Excel also put this series onto the secondary axes.
Middle Left Chart Below: I formatted the added series to be plotted on the Primary axis.
Middle Right Chart Below: I changed the scale of the vertical axis, giving it a minimum of the first date and a maximum of the last (1/1/16 to 9/1/16).
Bottom Left Chart Below: I formatted the vertical axis to show no labels.
Bottom Right Chart Below: Format format format. I formatted the dummy axis series so it used light gary lines (matching the horizontal axis) and light gray cross markers (simulating tickmarks). I changed the tickmarks of the horizontal axis so they crossed the axis, matching the cross markers of the dummy series. I added data labels to the left of the dummy series points, simulating vertical axis labels.

How to draw line X=1?

I know how to draw a line with scatter plot options where X is the independent and Y the dependent variable.
In the scatter plot of that data I need to add another line: X=2. I have the following data:
But how to draw a line X=1 ?
Maybe you want something like this:
I hear that charting is more different than many other aspects of Excel between versions and that perhaps my version (Excel 2007) is one of the least ‘friendly’ hence some of the reason for “not very easy” but the principle is as #Bill the Lizard has described. In view of some weird behaviour with (my?) Excel 2007 however I recommend being careful about the sequence in which the lines are drawn.
First I suggest getting your chart right for all aspects but the green line. Then add another series with X values of 1 and 1 and Y=2 values of 10 and -2 (or whatever the limits are of your chosen y-axis as displayed). Select and copy that array (four cells) select your chart and Paste Special…, and Add cells as New Series, Columns, Categories (X Values) in First Column, OK.
This should add a vertical line of the same chart type as the existing (ie XY (Scatter) Scatter with Straight Lines and Markers). The colour can be changed, by selecting that series (click on it and Format Data Series…, Line Color etc) and presumably you would want the markers removed. It was these that for me at first refused to disappear to order – but persistence paid off. Click on either of the data points, and under Marker Options choose none for Marker Type. If necessary, repeat for the other data point – and keep repeating if required!
Also, I selected what was showing as Series3 (text) in the legend and deleted that.
Forgot to mention that for anything to do with Excel charts Jon Peltier is the ultimate authority (eg) and that an alternative approach is to use an error bar and a secondary vertical axis.

Excel Chart doesn't keep format

I have a table (came from a pivot table) where I have formatted the column 4 cells to show 1 billion as 1. But when I select the table and insert a chart, I am getting my units in millions. So the 14.8 billion number for Mexico is showing up as 14,800 on the chart. Why might this be happening and how can I fix this? This is also making all my other bars negligibly small. Note that the first three columns are not in billions and are totally different things. Some are percentages, some are other small numbers.
Table:
Chart:
You need a secondary horizontal axis and some formatting on the Axes.
In Excel 2013
First change the Chart Type to Combo and select Clustered Bar for both sets of data, then Check
Secondary Axis for the Percentage Series.
Then set up the axis limits so they match, e.g.
Percentage: min -.5 max 2
Billions: min -5e9 max 20e9
Then set the percentage format on the source data to a custom Number format of "";(0)%;0%
Then set the Billions format as 0,,,;"";0
You will get something like this:
EDIT
Now that we have the general principles, we can apply them to your specific data.
I will also switch to Excel 2010 do show the different menus.
The data selection looks like this
Select the non-Billion series (plural!) and check the secondary axis
If the larger data is always positive then you can use custom formatting to clean up the axis
Align the primary and secondary axes so that the grid lines match on both
The end result is clean and readable.
Mixing percentages and numbers for the smaller numbers is not handled by this but I would suggest that that would be confusing anyway?
The simplest way to fix this might be to plot cells containing the billions values divided by 10^9 rather than to plot the billions themselves, though via a secondary axis may be possible.
Using Excel 2007. For the purple bars, the example on the left uses ColumnE values, on the right ColumnF values. E1 contains =F1/10^9 and F1 contains =14800000000:
It appears that there are 3 questions here: 1) "Why might this be happening", 2) "how can I fix this", and 3) something like "how can I plot data which lie on two widely differing ranges, and make them all reasonably visible anyway", even if there was no explicit question on this.
There are several ways to solve issue #2 about the units (e.g., billions) and numbers (e.g., 14.8 vs. 14,800.0) shown in the axis, each one with its own pros and cons:
Use Format Axis -> Axis Options -> Display units.
This might be the answer to your issue #1 as well, you might have the following selection: Display units -> Millions, and unchecked Show display units... Otherwise, I wouldn't know why you chart shows what it shows.
Use faked tick marks, as indicated in the (excellent) site of Jon Peltier
http://peltiertech.com/Excel/Charts/ArbitraryAxis.html
It gives detailed instructions on how to create tick marks on an axis with arbitrary labels (which may be text, numbers, etc.), which is more generic than what the OP wants here. In this particular case, the labels will be the desired numbers.
Create new cells containing data that would be plotted exactly the way you want.
As for your issue #3, I guess the only option is to have a Secondary Axis (see the answer by pnuts).
Thus, to come up with the best final chart for you might use a combination of one of the options I gave here and a secondary axis.

Resources