Bar Chart [Deprecated]
Comparatively bring data to life with Bar Chart
Simply use bar chart to show comparison. Bunifu Bar Chart displays data using horizontal bars.

How to display bar chart using Bunifu Dataviz

Simply locate Bunifu Dataviz control in your toolbox and drag it to the location on your form where you would like to display it.
We will use button click event handler to display our chart called render_bar
C# code
1
private void render_bar()
2
{
3
4
var r = new Random();
5
6
var canvas = new Bunifu.Dataviz.WinForms.BunifuDatavizBasic.Canvas();
7
var datapoint = new Bunifu.Dataviz.WinForms.BunifuDatavizBasic.DataPoint(Bunifu.Dataviz.WinForms.BunifuDatavizBasic._type.Bunifu_bar);
8
9
datapoint.addLabely("SUN", r.Next(0, 100).ToString());
10
datapoint.addLabely("MON", r.Next(0, 100).ToString());
11
datapoint.addLabely("TUE", r.Next(0, 100).ToString());
12
datapoint.addLabely("WED", r.Next(0, 100).ToString());
13
datapoint.addLabely("THU", r.Next(0, 100).ToString());
14
datapoint.addLabely("FRI", r.Next(0, 100).ToString());
15
datapoint.addLabely("SAT", r.Next(0, 100).ToString());
16
17
// Add data sets to canvas
18
canvas.addData(datapoint);
19
//render canvas
20
bunifuDataViz1.Render(canvas);
21
22
}
Copied!
VB.NET code
1
Private Sub render_bar()
2
3
Dim canvas As Bunifu.Dataviz.WinForms.BunifuDatavizBasic.Canvas = New Bunifu.Dataviz.WinForms.BunifuDatavizBasic.Canvas()
4
Dim datapoint1 As Bunifu.Dataviz.WinForms.BunifuDatavizBasic.DataPoint
5
6
bunifuDataViz1.colorSet.Add(Color.Black)
7
datapoint1 = New Bunifu.Dataviz.WinForms.BunifuDatavizBasic.DataPoint(Bunifu.Dataviz.WinForms.BunifuDatavizBasic._type.Bunifu_bar)
8
9
Dim random As Random = New Random()
10
datapoint1.addLabely("MON", random.[Next](0, 50).ToString())
11
datapoint1.addLabely("TUE", random.[Next](0, 50).ToString())
12
datapoint1.addLabely("WED", random.[Next](0, 50).ToString())
13
datapoint1.addLabely("THU", random.[Next](0, 50).ToString())
14
datapoint1.addLabely("FRI", random.[Next](0, 50).ToString())
15
datapoint1.addLabely("SAT", random.[Next](0, 50).ToString())
16
datapoint1.addLabely("SUN", random.[Next](0, 50).ToString())
17
18
canvas.addData(datapoint1)
19
bunifuDataViz1.Renderint2))
20
21
End Sub
22
Copied!
In order to display bar chart we need the following controls:
  • Bunifu Data Viz - This is the container for our chart
  • Bunifu Canvas - This is the middle layer between the data viz (container) and the dataset
  • Bunifu Data Point - This will contain the data that we want to represent as pairs of X and Y coordinates
On running the code you should see something like this:
That's it!
We hope Bunifu Dataviz will help you bring out the best data visualization for your data in your application.
Should you have feedback or suggestions please send us via chat on the bottom right corner of the screen.