Bunifu Doughnut Chart
Pimp up your app data visualization with single and multi-layered doughnut charts.
Last updated
Pimp up your app data visualization with single and multi-layered doughnut charts.
Last updated
Bunifu Doughnut Chart is a chart control that visualizes the proportion of a value related to the whole in a data series. The proportions of each value create the size of each slice. Each slice represents a subset of a bigger total. It somewhat remedies this problem by de-emphasizing the use of the proportional area just as in the pie charts. Instead, readers focus more on reading the length of the arcs, rather than comparing the proportions between slices. Here’s an example:
This section explains the steps required to start creating a simple doughnut chart using sample data:
Step 1: Drag the canvas
control 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 BunifuDoughnutChart
to the form.
Step 4: To begin, go to the pie chart property section and set the label property to, for example, Share in G.D.P - 2021.
Step 5: Access BunifuDoughnutChart's
Data property and populate the double collection editor with the following values:
Step 6: On the target property of the Pie component, select bunifuCanvas1
as 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.
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.
Doughnut 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:
Let us examine Bunifu Doughnut charting properties.
This property gets or sets a collection of values that will be visualized on the doughnut chart. The order in which data values are added to the property will correspond to the order in which the canvas's label values are input.
To reflect the intended label's value data effectively, data must be provided in the correct order relative to the canvas's labels.
Here is an example of how to use code to populate the doughnut chart with data at run-time.
Here's the visualized graphical data after running the codes shown above. The data is loaded during the form load event.
This property gets or sets the canvas that will be used to show Bunifu doughnut chart.
Take note of the following properties to be modified on the canvas:
a) Set the ShowXAxis and ShowYAxis to false
.
b) Additionally, set the properties XAxesGridLines and YAxesGridLines to false
.
c) Assign the LegendPosition property to a value that is either bottom, left, or right.
If more than one data series needs to be displayed, one can target multiple Bunifu Doughnut charts in a single canvas. Thus, by combining many doughnut charts, a ring of doughnut charts will form above and around each other, each of which will display a separate data series.
The sample showcase illustrates a scenario in which the canvas is targeted with multiple Bunifu Doughnut charts, each displaying a distinct data series:
This property gets or sets the doughnut sectors' background color value. We can specify the colors using the Red Green Blue (RGB) color format as well as the Alpha, Red, Green, and Blue (ARGB) color values in the color collection editor. The background color of each sector is set by adding color sets to the color selection editor.
Each color set will correspond with the order of the data provides in the Data
property the sector of the pie chart.
Let's provide each sector with its own background color as shown below via code:
Here's the output of the colors from the code above:
This property gets or sets a color set to a doughnut chart sector border. The sample form illustrates a doughnut chart with the border color set to: 105, 48, 195
Alternatively, we can set each pie sector to have its own border color by adding additional color sets to its color collection editor.
Take note that the order in which the border colors in the color collection editor are set will correspond to the order in which the data in the Data property is defined.
This property gets and sets an integer value that changes the width of the doughnut sector border. The greater the value, the denser the sector borders.
This property sets a back color value to a doughnut sector when hovered.
This property changes the color of the border around a doughnut sector when hovered
This property specifies an integer value that alters the boundary width of a targetted doughnut sector when hovered
Since, it can be quite difficult to compare different sections of the doughnut chart, just like with a pie chart, doughnut charts are best used to compare the size of a particular slice with the whole, rather than comparing individual sections of the donut chart with each other.
Just like a pie chart, a doughnut chart shows the relationship of parts to a whole, but a doughnut chart can contain more than one data series. Each data series that you plot in a doughnut chart adds a ring to the chart.