Given the following data set:
Request starttime Duration (ms)
1 00.000 222
2 00.005 257
3 00.001 270
4 00.003 299
5 00.292 198
6 00.327 199
7 00.318 319
8 00.333 451
9 00.511 323
I need to draw an overlapping bar graph, something akin to this overlapping bar graph (from google):
However, when I try to draw the bar chart in mac excel, excel overloads the y-axis with request count and start time, rather than making start time and duration as both applied to the x-axis.
In short, the y-axis is the request number and the x-axis the both the start time and duration. Is there a way in excel to shift the bars to the starting time listed in the dataset?
SOLUTION:
After learning how to draw Gantt Chart in excel, the resulting chart looks great.
Found the answer in https://www.officetimeline.com/gantt-chart-excel. Thanks all.
Related
I'm trying to plot a diagram with varying timestamps (the diff of timepoints are variable). And I would like to show the variability in the X axis, so the distance of timestamps be reflected on the diagram. For instance, my data is like this (time points in milliseconds):
time value
---------
0 102
3 104
15 121
29 123
59 111
78 110
So once I plot it, I want the distance of timestamps be shown accordingly, like the plot below.
How can I do that? I have thousands of points like this.
If you highlight your data set (including the headings), you can go to Insert and then click the dialog box launcher to get chart options.
(see the blue square to the right)
From there, you'll get a popup screen like this:
You can then go through and see what chart will work best for you. You'll be able to modify your data, colors, etc. from the new Design and Format tabs that appear on the ribbon when you click anywhere within the newly created chart.
*I'm running Office 365 ProPlus, but the steps are similar in other versions of 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.
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.
I need to plot a bar chart in spotfire where in there should be 6 bars.. 5 bars should be the top 5 values from column and 6th should be the average one that is needed for comparison. for eg. we have cities and the amount spent like this
new york 200
texas 150
LA 300
windsor 100
New jersey 250
Bay ridge 120
so out of this it should have top 5 and 6th bar for average which will be 200+150+300+100+250+120/6.
can anyone please suggest solution.
This is backwards from info-graphic logic and would be confusing to everyone other than people with specific knowledge of this design and that's why it isn't a feature of Spotfire. Instead, insert a line showing the average.
Right Click on your Chart > Properties > Lines & Curves
Then either click on the Horizontal Line: Avg(Y) or add your own
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: