I'm trying to create an Excel chart in VBA with time on the X axis and bearing angles (from North) on the Y axis. This looks fine most of the time except where the sample of data is dealing with Northerly bearings. In this case, we might get a sample with bearing values of 000.1, 000.2, 359.9, 359.8, 000.5 etc.. The chart Y axis then stretches from 0 to 360 with data at the bottom and data at the top with a lot of empty space in between. Is there any way that the Y axis can be configured to either restart at zero when it reaches 360 or split into two so that for example, it covers the range 0 to 5 and then the range 355 to 360?
I'm simply asking whether this is feasible or not. I don't want to get too busy with coding just yet if it's a non-starter.
EDIT: - a couple of images to try and explain the problem. One image shows the sample of bearings to be around 90 degrees and it produces a nice Y axis. The second image shows the sample of bearings to be around 359-360 degrees with the odd one in the middle at 0 degrees
For the sample with Bearings around 360, I would like to be able to either "rollover" the Y axis back to 0 as it reaches 360 or have a split Y axis such that the section between 5 degrees and 355 degrees is not visible.
You need to mess with your data. Suppose the times are in A2:A41 and the angles in B2:B41. Plotting columns A and B works fine unless the values are on either side of 360.
Put a test formula in E1:
=AND(MAX(B2:B41)>350,MIN(B2:B41)<10)
This tells us that some values are close to 0 and some close to 360.
Enter this formula in cell C2 and copy it down to C41:
=IF(AND($E$1,B2<10),B2+360,B2)
This adds 360 to any small value if the large values are near 360.
Finally, plot columns A vs C.
Below are two pairs of charts where I've implemented this, one not close to 360 and one close to 360.
Related
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.
Is there a way to center the y-axis at 0.30 instead of 0 in Google Sheets or Excel?
So for example, in the chart I have right now pasted here, I want the first bar (0.26) to face downward (i.e. flipped downward like a negative number would on a normal axis) since it is less than 0.3. Thanks in advance!
Try selecting "Horizontal Axis Crosses" at axis value "0.30" in the Y axis options.
I am on day #2 of searching the web and, while I have found plenty of hits that seem like they should work, none of them seem to apply to my particular situation.
I have an Excel chart with two series displayed. One is a sort of exponential decay curve, and one is a constant that intersects with the exponential curve, but does not continue past it (the final x-value of the orange line is estimated to make it look like it intersects the blue curve):
The raw data for the blue curve is as follows (leaving off data labels for confidentiality reasons, but x-values are on the left and y-values are on the right):
The orange line is simply set at 24 all the way across until it intersects with the blue curve.
So here's the problem I need to solve: I need to fill in all of the area below the blue curve with one color, and I need to fill in the area below the orange line with another color. Everything above the blue curve needs to be blank (transparent). Here's an illustration of what I want:
I know in order to get the coloring/shading I need to use an area chart. However, when I try to change the chart type to Area the scales of the axes change for each series and they no longer match up, and I am unable to edit the axes (can't set min, max, etc) to make them match up again. Additionally, only the area directly beneath the constant line fills in (as expected), but I am looking for a way to fill in the area between the orange line, the blue curve, and the axes:
How might one go about doing what I need to do?
If there's any other information I could provide that would be of help, please let me know and I'll be sure to add it in.
EDIT:
I can extend the orange line to follow the blue line off to the right, which may help fill in the lower area. However, when I switch to an area chart I still get the issue with mismatched axes with scale I can't edit:
Notice how the "567" point (the x-value where the orange line should intersect the blue curve) is spaced evenly between "500" and "600", rather than scaling slightly to the right of center as I would have expected.
How do I keep the spacing of one tick every 100 units on the x-axis but keep the datapoint for 567?
You could find the intersection point's coordinates (graphically or analitically), then split your data in two separate series within the same graph as follows :
Edit post comment section :
For some reason x-values are considered by default as text.
Righ click the x-axis > format > Select date on the axis
Then play with the principal and base in days/months to have the intervals you want.
Good parameters for this data :
main : 100 in days
base : in days
I would just have two identical charts : one does the blue and the other the orange then lay the orange chart on top of the blue and make it transparent ... worked a treat in the past...
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.
Here is the issue:
X has 0 - 8
I need them to start bottom left corner, and also you see all the legends stop on same vertical line but need to be at different stop points so in theory X and Y need to have 0 - 8 and then draw the legend / items from 0,0 to the X,Y set point so if 4.54 X and Y should be 4.54.
Anyone have any ideas? I have added screenshot below.
I tried and managed to get something like this, but it's not quite right. I need to start 0,0 (bottom left) and have straight lines up until the right value by X and Y
UPDATE
I have also attempted a point value system which think might help. Although a point 0.00 value series I guess is required, I need to set the display like it is on the left just showing 0 - 8 and same for bottom but working on the 0.00 series basis?
I really can't imagine what you want to achieve by this. What you want to do is basically drawing eight y = x lines on the SAME plane, which is visually meaningless. As far as I can tell from what you provide, your last try is right approach. You just need to edit the X-axis format. I made something similar based on 0.1 point system. Under this approach, I had to MANUALLY edit each series' ranges, which was also painful.