Bar charts from excel
-
Would anyone be interested in writing this script? I don't have the skills to do it myself, but I think the results could be very useful.
The idea is to take the contents of an excel file or csv file and turn that in to a 3d bar chart / pie chart / line chart in sketchup
the data in the excel / csv file would need to contain titles and figures like this
hour, qty;
hour 1, 15;
hour 2, 16;
hour 3, 33;
hour 4, 24;
hour 5, 34;
number of bubbles counted per hour;the LAST row should contain the heder only
the first row should contain the x and y axis titles.
the first column should contain the x axis data and can be alphanumeric
the second column should contain the y axis data and should be numericalthe ruby script needs to figure out how many rows of data there are (n)
the ruby script needs to figure out the largest number (negative numbers should be treated as positive numbers for this step) (z)
it needs to check that for each row there is data in columns 1 and 2, except for the last row which contains only the header
it needs to check that the data in column 2, from the 2nd row onwards is numerical
it probably needs to check some other things I haven't consideredthen the script should then create (n) squares in sketchup, placed in a line along the red axis moving from left to right
the size of these squares should be (z0.1) = (p)
the pitch between squares should be (p1.25) = (s)
starting with the first sqare, push / pull the face by the value of the row in column 2 of the excel / csv file
group each cubiod, then group all cuboids together
for the x axis
starting with the first cuboid place insert the value of column 1 of the csv / excel file as 3d text centred underneath the cuboid
(for negative numbers, place above)
for the y axis
produce a y axis with appropriately spaced values (will need some clever algorithm to work this out - see http://stackoverflow.com/questions/361681/algorithm-for-nice-grid-line-intervals-on-a-graph )
stick the header in as screen text.
Advertisement