View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.charting
[email protected] hughe297@gmail.com is offline
external usenet poster
 
Posts: 1
Default Circular Bar chart?

On Tuesday, September 25, 2012 at 11:12:03 PM UTC-4, DaveinVT wrote:
Hello,
Is it possible to create a circular bar chart, with the radii of the
circle serving as the y-axis of the chart, and the perimeter of the
circle serving as the x-axis?
Thanks!




--
DaveinVT


It's been a long time since this was asked, but in case there are any other searchers out there, this page gave me the solution I used to build mine in MATLAB.

http://interworks.co.uk/blog/radial-bar-chart/

This website shows you the trigonometric solution you need to plot a line using the regular old plot function. Each line has two points, and you plot your first one like this in MATLAB:

plot([innerx outerx], [innery outery])

When I made mine, I selected r1 to the same number for all observations and r2 to be the value for that observation. Here's all the code for MATLAB.

values = [3 4 1 8 9];
nvalues = size(values,2) %values has 5 rows and 1 column.
indices = 1:nvalues
angledeg = 360/nvalues;
anglerad = degtorad(angledeg);
angles = indices.*anglerad
innerr = 5; % pick anything you want
values = innerr + values;
cosines = cos(angles);
sines = sin(angles);

xinners = innerr.*cosines;
yinners = innerr.*sines;

for i = indices
plot([xinners(i) xvalues(i)], [yinners(i) yvalues(i)])
end

xvalues = values.*cosines;
yvalues = values.*sines;