> For the complete documentation index, see [llms.txt](https://docs2.bunifuframework.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs2.bunifuframework.com/docs/dataviz/basic-charts/bar-chart.md).

# Bar Chart \[Deprecated]

Simply use bar chart to show comparison. Bunifu Bar Chart displays data using horizontal bars.&#x20;

## **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.&#x20;

We will use button click event handler to display our chart called render\_bar

**C# code**

```csharp
private void render_bar()
{   

 var r = new Random();   
 
 var canvas = new Bunifu.Dataviz.WinForms.BunifuDatavizBasic.Canvas();   
 var datapoint = new Bunifu.Dataviz.WinForms.BunifuDatavizBasic.DataPoint(Bunifu.Dataviz.WinForms.BunifuDatavizBasic._type.Bunifu_bar);   
 
 datapoint.addLabely("SUN", r.Next(0, 100).ToString());   
 datapoint.addLabely("MON", r.Next(0, 100).ToString());   
 datapoint.addLabely("TUE", r.Next(0, 100).ToString());   
 datapoint.addLabely("WED", r.Next(0, 100).ToString());   
 datapoint.addLabely("THU", r.Next(0, 100).ToString());   
 datapoint.addLabely("FRI", r.Next(0, 100).ToString());   
 datapoint.addLabely("SAT", r.Next(0, 100).ToString());   
 
 // Add data sets to canvas   
 canvas.addData(datapoint);   
 //render canvas   
 bunifuDataViz1.Render(canvas);
 
}
```

**VB.NET code**

```
Private Sub render_bar()
    
    Dim canvas As Bunifu.Dataviz.WinForms.BunifuDatavizBasic.Canvas = New Bunifu.Dataviz.WinForms.BunifuDatavizBasic.Canvas()
    Dim datapoint1 As Bunifu.Dataviz.WinForms.BunifuDatavizBasic.DataPoint
    
    bunifuDataViz1.colorSet.Add(Color.Black)
    datapoint1 = New Bunifu.Dataviz.WinForms.BunifuDatavizBasic.DataPoint(Bunifu.Dataviz.WinForms.BunifuDatavizBasic._type.Bunifu_bar)
    
    Dim random As Random = New Random()
    datapoint1.addLabely("MON", random.[Next](0, 50).ToString())
    datapoint1.addLabely("TUE", random.[Next](0, 50).ToString())
    datapoint1.addLabely("WED", random.[Next](0, 50).ToString())
    datapoint1.addLabely("THU", random.[Next](0, 50).ToString())
    datapoint1.addLabely("FRI", random.[Next](0, 50).ToString())
    datapoint1.addLabely("SAT", random.[Next](0, 50).ToString())
    datapoint1.addLabely("SUN", random.[Next](0, 50).ToString())
    
    canvas.addData(datapoint1)
    bunifuDataViz1.Renderint2))

End Sub

```

In order to display bar chart we need the following controls:

* &#x20;**Bunifu Data Viz** - This is the container for our chart
* &#x20;**Bunifu Canvas** - This is the middle layer between the data viz (container) and the dataset
* &#x20;**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:

![](https://downloads.intercomcdn.com/i/o/73575121/d2c16332b9d8d012bd393e3a/bar-chart%5B1%5D.png)

That's it!

We hope Bunifu Dataviz will help you bring out the best data visualization for your data in your application.&#x20;

Should you have feedback or suggestions please send us via chat on the bottom right corner of the screen.&#x20;
