How to set different horizontal (category) labels for each different product in MS Excel line chart - excel

I am plotting a line graph for 3 different products in MS Excel. The x axis is revenue and the y axis is cummulative p/l. The problem is that when I set the horizontal (category labels) for each of the products (series), it also sets the same range for the two remaining products. The range for the horizontal axis for the last product that i set, modifies the horizontal ranges for the rest. The output (chart) that i get shows all lines reaching a maximum of that x value for the last set product.
Please advice me.
Thank you

A line chart has a categorical X axis. It can also use dates, but I'm not even sure if Excel 2007, which you are using, has that feature or if that came later.
In a category axis, the values of the cells don't matter. They are all in the same position.
If you want to plot the X axis points based on their value, you need to create an XY Scatter chart instead of a line chart.

Related

Excel data representation, Axis labelling non-numeric

I wanted to display my data from my Excel spreadsheet graphically, in the form of a scatter chart.
I know that Excel can do this, but there is one "special feature" about my coordinate system of my graphic, and that is that one of the axes should be labeled with "words" (instead of numbers) to match my table similar to the picture. But I am not sure if Excel can process this at all, I guess that Excel can only work with numbers on the axes.
I would be very grateful for any help and tips and also alternatives!
By definition, the axes in an XY Scatter plot are numeric. But your desired chart can easily be created by adding a helper series to the plot. Assuming the current Y values for the other series are the numbers 1 to 6 for even positioning, you can use a range with Y values 1 to 6 and X values of zero and add that data range as a new series to the plot.
The plot points will sit right on the Y axis. Remove the Y axis labels in the Axis formatting options. You can then use data labels from the worksheet and position them to the left of the plot points of the helper series. Finally, format the markers of the helper series to have no fil and no line to make them invisible.

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.

How can I customize the horizontal axis values in excel?

So I am trying to make a nice line graph for some data that I have. Each line has 100 data points, so excel automatically makes the horizontal axis from 1-100. I want to change the min/max values for the horizontal axis from 0-1, without moving the frame of the graph (i.e. without zooming in the graph). I just want to divide the horizontal axis numbers by 100 in order to rescale the time. This is what my graph looks like now:
http://imgur.com/33KD7RY
So I want to change the numbers on the horizontal axis to be fractions or decimals in the range [0,1]. Does anyone know how I can do this, or any other graphing software that would allow me to do this (I have tried using google sheets, but they have less options to customize axes than excel). Thank you!
Did you use two column to plot one line and did you use the Scatter with smooth lines chart type?
Have one column (X) go from 0 to 1 using intervals of 0.01 and your data in your second column (Y). When using a scatter with smooth lines chart type your answer should look like this:
image graph
Plotting your second line in the same chart can be done the same way by adding it through the 'select data' options of the chart.

Highlight points on an Excel Line Graph according to a list

I have 2 data series, which records how much a user is meditating/attentive (out of 100) plotted onto a graph. The x axis is the number of seconds since the start of the experiment, and the y axis shows the value for meditation/attention at that point of time.
I have a 3rd set of data that is a series of key timestamps during the experiment (not exactly matching the timestamps from attention/meditation values).
I want to create a graph where you can compare how the attention/meditation values change at the key points
Whether the key points are highlighted by a line or dots I don't care. I tried adding the 3rd data set as a secondary axis, but it still uses the original x-axis of the main graph and I don't know how to make excel do what I want.
Thanks in advance
You should use an XY Scatter chart, not a line chart. A line chart ignores any numerical value in the X values, treats each X value as a text label, and uses the X values from the first series as X values for all series.
You can format the first two series so that they use lines and not markers, and the third so it uses markers without lines.
You may find this link helpful: superuser.com/questions/825692 You don't need to use the secondary axis, just add another series with tag times and constant 45 value, then format vertical error bars to 100% and horizontal to 0%.

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