# Chart from groupings

``````col1 | col2 | col3
-----+------+----
alfa | foo  | 10
beta | foo  | 20
gamma| bar  | 12
delta| bar  | 42
``````

I'd like to generate a chart grouping values from `col2` and presenting it as %.

In this case it would be an circle divided fifty-fifty between `foo` and `bar`.

Is it achievable, or do I have to write something myself to do it? I found I can "categorize" `col2`, which seems to me on of the steps I have to to, but what's next?

-
you are looking for a pie chart? – soandos Jul 12 '11 at 17:31
Yes, but the chart type is not a problem. How to compute (group and count) values in col2? I'd like to know i have 2 foos and 2 bars. This is just oversimplified example, real data consists of more than 2000 rows with approx. 100 unique elements in "col2". – korbatz Jul 12 '11 at 17:36
Where do the rows exist? in a cvs? spreadsheeet? Database? There are tricks for the latter for sure, but I'd hesitate to answer on the assumption of one of those! – Drav Sloan Jul 12 '11 at 18:56
Originally the question title said "Apple Numbers" or something. I was trying to achieve it using Apple's Numbers. Then i switched to Open-Office, sorted by col2 and used "subtotals" to count the elements. This worked fine, but i couldn't find a way to present it in separate spreadsheet in foo | 2 format. Then i had to read some forums about how to solve the latter in Microsoft Excel. I am not a Spreadsheet type of guy, i am a programmer, and honestly guys such basic operation is nearly impossible to do after so many years of development. Finally a SQL query and some perl delivered. – korbatz Jul 13 '11 at 5:28