![]() ![]() ![]() In a 'Finish Angle' column multiply the cumulutive figure for '% of 360' by 360. In the top row enter 0, then for each row below reference the cell above. Next we need to calculate the start and end angles that each sector covers. Add a column called '% of 360', dividing the sector weight by the sum of all sector weights. Now we need to calculate the slice proportions that each sector needs to cover. eg if you wanted 'WORK' to appear as a double/triple/quadruple-sized slice, just change the sector weight to 2/3/4 etc. In your example we want all the sectors to be the same size, but let's make things flexible and add in a sector weight column. There's a bit of data manipulation to do before we create the chart. Let's say this is the data you're starting with. ![]() I used plotly.This walkthrough is based on Andy Pope's original tutorial here. ![]() It automatically calculates the total and pourcentage even if you add more categories. Percentage (%) = 100 x partial value / total value I calculate the percentage by adding the values of all the category present in the table and using this formula (you can see it in the script.js file): In this example, I use a Json file to get the data from the embedded spreadsheet, so I can use it in my javascript code and create a bar chart. Here is a working code I have written for you: Javascript is a powerful language offering a lot of useful data visualization libraries like plotly.js. But if you want to keep your data as it is, there is a solution by using some javascript. You can do this with a pivot table and add a line with the pourcentage for each category like brettdj showed in his answer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |