Plot lines on an Excel chart - excel

I need to plot a line between two points on an excel spreadsheet. In my ideal world, it'd become a thin box with colors and text, but at this stage, I'll take what I can get.
Data:
min max value
1 2 28
2 3 64
3 5 87
4 7 99
In the end, there would be lines from {1,28} to {2,28}, {2,64} to {3,64}, {3,87} to {5,87} and {4,99} to {7,99}.
Flipping the axes in Excel, apparently, doesn't leave the original axes intact - it goes to numbering the data.

If you rearrange the data as shown in the animated gif below and then make separate plots for each min/max pair, you get the lines drawn just as you described. I show adding just the last min/max pair, and added labels for the sake of a legend. This seems to do what you described, but if not let me know.

Related

Excel Chart Scatter Straight Line and show length based on 3rd series

I'm trying to create a scatter straight line chart to visually show how a retaining wall looks in elevation view. I have a top of wall dimension and bottom of wall dimension and the length of each wall section. I am able to use the top and bottom of wall dimension but having trouble showing the length of the run. I have tried to add the wall length as another data point, but doesn't work, it just skews the other two points. Tried to use a cumulative run length, helper column, but couldn't get that value to populate the x axis properly. I added some notes in red in the image below. Spent a few hours and appreciate any help.
I perhaps wouldn't use excel for diagramming this, but I think you would need to add more points and interpolate the values. If your minimum wall length is 25, then you could use 25 as your base. Wall 1 is 100, so you need 4 points (100 / 25). Wall 3 is 150 so you need 6 points. Plus 1 point for each wall to accommodate start/stop.
For missing values in wall 1 top, you would take (230-224.3)/4 = 1.425. Then add 1.425 to the value above it.
It would look something like this:
And this would need to be a line chart, where column A can represent the X-axis for labeling.

Excel Chart - Do not Hide Horizontal Data Label

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.

excel scatter plot incorrect due to wrong format values

I've been trying the most simple of things, creating a scatter plot in excel.
I have one x-values and on set of y-values. Yet somehow excel thinks it knows better and creates its own set of x-values ranging between 0-10. Whereas my x-values range between 40-140. Manually changing the limits of the x-axis to 40 - 140 simply makes it so I don's see my data points any more, since excel change my x-values.
Label X Y
A 47 3.5
B 95 40.5
C 47 10.5
D 95 21.5
E 91 21.5
F 45 18.5
G 91 61.5
H 45 0.5
I 130 40.5
J 90 10.5
See picture for clarification.
How do I fix this!?
When copying and pasting data into a column it is important to ensure your data is coming across in the right format to be recognized by Excel. Simply setting the format in the ribbon to numeric from general does not change the way the data is stored. It merely changes the way the data is displayed.
When excel gets data in an unexpected format, strange things happen. Scatter plots become line plots because its seeing the X-axis as text instead of numbers. One way to spot this is if the numbers are not on the right side of the cell when no formatting has been applied to the cell. Another test would be to use a formula like the ones below assuming your data is in cell C3:
=ISTEXT(C3)
or
=ISNUMBER(C3)
On a side note, any number stored as text that is sent through a math operation will be converted to a number for the calculation. So one trick to convert a number stored as text is to use something like:
=C3+0
=C3*1
=--C3
Another option for converting columns of numbers stored as text is to use the Text-to-columns feature in the ribbon. On the last step it will give you the option to format the expected output to something excel will usually handle. This is really good for bringing across dates that are text and need to be converted, or numbers containing thousand separators like , or [space].
The most reliable method that I have found to ensure that the data to be plotted is numeric is to insert a 1 in an empty cell, copy it with ctrl-C, select the columns and choose Paste Special > Multiply. Any text data becomes numeric.
After verifying all my X (any Y) values were actually numbers, I found a solution:
Right click on plot, Change Chart Type (FYI: Scatter with Straight lines was already selected), Change to Line Type.
Now repeat. Right click on plot, Change Chart Type, Change back to Scatter
You will lose the X axis Minimum and Maximum Bounds and the "Vertical axis crosses" value, but at least this works!
FINALLY I FOUND AN ANSWER THAT HELPS HERE.
use =VALUE(cell reference) to make sure the xAxis values are seen by excel as numbers. Until this was done, my xAxis numbers were just spaced evenly across the axis.

Excel chart with markers -- how to automate the color, shape, and size of the markers

I have a chart with 90 series. The first 87 series are plotted as lines with markers. But since each series has just one data point, the 87 series show up as 87 dots represented by markers of different colors and shapes and sizes. I would like to make these markers of only two shapes and colors, say blue squares and red triangles. However, the only way I can do this is my manually clicking on each marker and changing its color, shape etc. It is very cumbersome and every time we decide to change the color, I have to repeat the process. Would really appreciate if someone could tell me how to automate this process. I don't know Visual Basic but if it is just a short code, I will try my best to work with it -- I want to have the capability to say which series should look like blue squares and which like red triangles.
For the sake of completeness, the last three series are stacked area chart.
Data example of one series
Year Series1
1990 N/A
1991 N/A
1992 5
1993 N/A
1994 N/A

Scale axis in Excel chart

I have made a record of some samples at different seconds:
50 40 36 33 32 30 28 25 22 20 17 15 13 10 7 5
When I create a line chart with markers in Excel, the x-axis is based on these values, but of course they are not normalised in the sense that there is the same distance from 50 to 40 than from 22 to 20.
Is there a way I can draw the line with the markers only at the positions I have recorded and that is properly scaled in the x-axis? (so from 50 to 40 there is no data in the middle but the line does not go down to "0", it should just link to the value at 40 smoothly. Format Axis does not seem to do anything here)
EDIT - see graph
Example of Scatter with Smooth Lines and Markers:
As the #Jon Peltier has kindly mentioned, prior to this edit I had incorrectly described the above as Scatter with Straight Lines and Markers.
Jon has also pointed out how this happens to be an example of the potential for smooth lines to be deceptive. If the vertical scale were percentages then anything over 100 might not be possible, though the 'bump' in the chart would indicate otherwise!
An alternative with Straight lines is shown below, where 'B' values as displayed have been changed to represent the sum of A and B values, as possibly nearer the OP's requirement:

Resources