Stacked Area Graph

feetimo

New Member
Joined
Mar 14, 2010
Messages
18
I am trying to plot a series of regions ("passes") that represent a polygon. All regions are defined by a set of X and Y data that define their border. Each polygon region is a continuum...i.e. although on polygon one there is a y-value of 0 at x=8.0 and a y-value of 0.35 at x=7.25, it is assumed that this defines a sloping edge to the polygon.

This would not be a problem to plot (using a line chart, for example), except that I need the polygons to be "stacked". A stacked area chart gives an idea of what I need--however, an area chart does not have the capability for a numeric X-axis. I show 2 polygons here, but the spreadsheet has the capability of producing up to 8 polygons. Each one may have up to 40 "points" that define its shape.

End result would be a series of shaded (filled) areas that show. Chart would be fixed on a worksheet (NOT a seperate chart worksheet but on an existing one) with the source data being variable--perhaps each x,y data for each polygon in it's own set of columns?

VBA is OK to use, too, as much of the data is generated by VBA.

-Tim
(data is below)

Polygon One
x y1
8.00 0.00
7.25 0.35
6.40 0.75
-7.85 0.75
-9.00 0.50
-10.00 0.30
-13.20 0.25
-14.00 0.00

Polygon Two
x y2
-7.90 0.00
-7.15 0.38
-6.40 0.75
-4.80 0.75
-3.80 0.69
-2.80 0.63
-1.80 0.55
1.80 0.55
2.80 0.63
3.80 0.69
4.80 0.75
6.40 0.75
7.25 0.73
8.00 0.70
9.00 0.50
10.00 0.30
13.20 0.25
14.00 0.00
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Interesting...but it looks as though I am still stuck on using the same "X" values for both areas. My "X"'s are different for each polygon area.

-Tim
 
Upvote 0
You have many of the same X values, and you can interpolate where needed.

List all your X values with corresponding Y1 or Y2 values:

Rich (BB code):
    x     y1     y2
  -14      0       
-13.2   0.25       
  -10    0.3       
   -9    0.5       
 -7.9             0
-7.85   0.75       
-7.15          0.38
 -6.4          0.75
 -4.8          0.75
 -3.8          0.69
 -2.8          0.63
 -1.8          0.55
  1.8          0.55
  2.8          0.63
  3.8          0.69
  4.8          0.75
  6.4   0.75   0.75
 7.25   0.35   0.73
    8      0    0.7
    9           0.5
   10           0.3
 13.2          0.25
   14             0

Interpolate where necessary (in blue):

Rich (BB code):
    x     y1     y2
  -14      0       
-13.2   0.25       
  -10    0.3       
   -9    0.5       
 -7.9  0.739      0
-7.85   0.75  0.025
-7.15   0.75   0.38
 -6.4   0.75   0.75
 -4.8   0.75   0.75
 -3.8   0.75   0.69
 -2.8   0.75   0.63
 -1.8   0.75   0.55
  1.8   0.75   0.55
  2.8   0.75   0.63
  3.8   0.75   0.69
  4.8   0.75   0.75
  6.4   0.75   0.75
 7.25   0.35   0.73
    8      0    0.7
    9           0.5
   10           0.3
 13.2          0.25
   14             0
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,426
Messages
6,124,828
Members
449,190
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top