Assignment 1
Description: From a multi-dimensional table with general data, visualize this data as a bar an pie charts in 2D and 3D.
First part. 2D pie chart.
- In a statistical application it is necessary to represent a pie chart for a set of percentage values
- The elements are in an array and their sum is equal to 100%
- Example:
float[] values = {25.0, 45.0, 5.0, 15.0, 10.0};
- Implement a function to draw this information in a pie chart receiving this array as input
- The function will also receive as input the center and radius of the chart
- This function can know the number of values of the array by using the length attribute
- Choose a random color for each sector
Second part. 2D bar chart.
- Develop an analogous function of the previous assignment but now with the objective of drawing a 2D bar chart
- Take the most of the available window sizes and draw the coordinates axes
- Choose the bar width in function of the total number of values and the total window width; and the bar height in function of its particular value and the maximum value of all the elements, taking into account that the height of the bar of the element of maximum value is going to be the height of the window
Third part. 3D bar chart.
- Lets start now from an n-dimensional array
- Draw it in 3D using the primitive box. With it, and by tems of a proper model/view matrix, create a function able to draw each of the 3D bars
- Draw the axes and an auxiliar grid