In this recipe, we will learn to draw bar charts. Let's assume we have data about the percentage of profit growth of a company for the last three years. We will assign that percentage of profit growth to an array, and on the basis of the values in the array, we will draw a bar chart with three bars on the screen.
Making a bar graph of the supplied values
How to do it...
The following are the steps for drawing a bar chart with the values defined in an array:
- Initialize GLUT, define the size of the top-level window, set its initial position for display, and display the window on the screen.
- Define the callback function that is auto-invoked after creating a window for drawing the bar chart.
- An array is defined...