Tag Archives: histogram

Use label controls to draw a simple labeled histogram in C#

The example Draw a simple labeled histogram in C# draws a labeled histogram on a PictureBox in that control’s Paint event handler. It does a fair amount of work to ensure that the histogram’s bars are in their proper positions … Continue reading

Posted in drawing, graphics, mathematics | Tagged , , , , , , , , , , , | Leave a comment

Draw a simple labeled histogram in C#

The example Make a simple histogram in C# shows how to draw a simple histogram on a PictureBox. This example adds Label controls above the histogram’s bars. When the program loads, it uses the following code to generate some random … Continue reading

Posted in drawing, graphics, mathematics | Tagged , , , , , , , , , , | 1 Comment

Draw a picture-filled histogram in C#

The example Make a simple histogram in C# shows how to draw a histogram. This example shows how to fill the histogram’s bars with pictures. The following TileRectangle method fills a rectangle with an image. // Tile an area from … Continue reading

Posted in drawing, graphics, mathematics | Tagged , , , , , , , , , , , , | 2 Comments

Make a simple histogram in C#

This example displays a histogram showing the distribution of random values that simulate rolling two 6-sided dice. At design time I gave the program’s form two groups of Label controls across the bottom of the form. The bottommost group displays … Continue reading

Posted in algorithms, controls, graphics, mathematics | Tagged , , , , , , , , , , , , | 4 Comments

Draw a histogram with tooltips in C#

The example Draw a simple histogram in C# explains how to draw a simple histogram. When you click on a bar, that program displays a message box showing the bar’s value. This example takes a different approach. When you move … Continue reading

Posted in drawing, graphics, mathematics | Tagged , , , , , , , , , , | Leave a comment

Draw a simple histogram in C#

When the program loads, the following code generates some random data. private const int MIN_VALUE = 0; private const int MAX_VALUE = 100; private float[] DataValues = new float[10]; // Make some random data. private void Form1_Load(object sender, EventArgs e) … Continue reading

Posted in drawing, graphics, mathematics | Tagged , , , , , , , , | 9 Comments