Bunifu Pie chart
Create beautiful pie charts for your dashboards with Bunifu Pie charts.
Bunifu Pie chart is a chart component that generates a circular statistical graphic, in which the data is divided into slices representing the numerical proportion. Each sector corresponds to a proportional portion of the total. Consider the following example that uses Bunifu Pie Chart for data visualization:
This section explains the steps required to start creating a simple pie chart:
Step 1: Drag the
canvascontrol to the form from the toolbox.
Step 2: Access the canvas label property and add the following values in the collection editor window.
Step 3: From the toolbox, drag and drop the
BunifuPieChartto the form.
Step 4: To begin, go to the pie chart property section and set the label property to, for example, Market Value of Cloud Infrastructure.
Step 5: Access
BunifuPieChart'sData property and populate the double collection editor with the following values:
Step 6: On the target property of the Pie component, select
bunifuCanvas1as the target component where it will be rendered.
Step 7: Set a list of colors in the BackgroundColor/colors property to specify the back color for each sector in the pie chart. For instance, the following is a list of colors assigned to the sectors in the color collection editor.
copy the following set of colors one by one to the color editor:
- 1.38, 68, 120
- 2.140, 193, 104
- 3.112, 173, 71
- 4.68, 114, 196
- 5.255, 192, 0
- 6.67, 104, 43
Step 7: Advance to the canvas properties and set the value of the XAxesGridLines and YAxesGridLines properties to false. Also, set the properties ShowXAxis and ShowYAxis to false.
Step 8: Run the application.
Pie chart legends are often located on either the bottom, right or left side of the pie chart. By setting the LegendPostion property of the canvas to value right, we can place the legends to the right of the pie, rather than above it.
We can code and render a pie chart without using the design view. Here's how to do it:
Bunifu.Charts.WinForms.ChartTypes.BunifuPieChart bunifuPieChart = new Bunifu.Charts.WinForms.ChartTypes.BunifuPieChart();
* For this example we will use random numbers
var r = new Random();
* Add your data from your source - accepts double list
* Below is an example from a random number
List<double> data = new List<double>();
for (int i = 0; i < 5; i++)
* Set your data
bunifuPieChart.Data = data;
* Specify the target canvas
bunifuPieChart.TargetCanvas = bunifuChartCanvas1;