In the course of data warehouse and data mining today, the teacher is always proposing bar charts, pie charts, and so on,
We also told us to come back and draw a few more. Alas, it's annoying,
Come back in the evening and have a whimsy. Why don't I write a pie chart generator by myself,
Haha, just do it, so we have the following pie chart generator.
This generator is actually very simple, that is, the use of a simple knowledge of GDI +,
What about the pie chart generator,
Mainly to complete the following functions, through a group of user input data,
Each group of data should have a corresponding variable name, variable value, and a color that must be selected by the user,
Of course, the variable names and colors cannot be repeated.
Then, we use GDI + for drawing. What about drawing,
That's easy. I instantiate a bitmap and use this bitmap to generate a graphics,
In this way, you can easily draw a picture,
You can put this bitmap in a picturebox and it will be OK,
Because the examples are relatively simple, I will not introduce them more,
Here are a few screenshots.
The user can store a group of input data in a list generic set.
- The color and variable names cannot be repeated in the list set.
Click "generate pie chart" to view the pie chart.
The above is an image, and the following is a dview control.
Still adhering to the consistent principle, if you do not, you can leave your mailbox,
I will send you the source code to learn !!!