I could only find a direct example with the names Andy, Pete and Bob.. No Mike, sorry.
Let's say you've managed to install chart controls and you're using some fairly new version of visual studio.
Create a new (Visual Basic) Windows Froms Application.
There should be a Form1 ready for you in the project.
Open that form and add a Chart from the toolbox to the form in the design view.
Open the code of the form the menu View -> Code (or press F7) and just paste the following on top everything that's already there.
Imports System.Windows.Forms.DataVisualization.Charting
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Init chart
'You don't have to do this if you use the default values.
Chart1.Legends.Clear()
Chart1.ChartAreas.Clear()
Chart1.Series.Clear()
'Create a chartarea
Dim area As New ChartArea("AREA")
'To have a percentage on the y-axis
area.AxisY.Minimum = 0
area.AxisY.Maximum = 100
Chart1.ChartAreas.Add(area)
'Create a series
Dim series As New Series("SERIES")
series.ChartArea = "AREA"
'It won't be a real histogram, since it doesn't group any x-values, there won't be
'any empty points on the x-axis and the y-axis won't indicate the amount of names.
'You most likely don't need a histogram here anyway.
'So, we just use the column type.
series.ChartType = SeriesChartType.Column
'To show the label on top of the column.
series.IsValueShownAsLabel = True
series.LabelFormat = "{0:0}%"
Chart1.Series.Add(series)
'You probably have a query looking something like this.
Dim sql As String = _
"SELECT name, COUNT(name) AS amount FROM sometable GROUP BY name ORDER BY name"
'getDataToDataTable is just some function (that you have to implemet)
'that returns a datatable with the selected data.
'Use some other datatype if you don't want to use a datatable.
Dim dTable As DataTable = getDataToDataTable(sql)
'Find the total amount of names in your data
Dim total As Integer = 0
For Each row As DataRow In dTable.Rows
total += CInt(row("amount"))
Next
Dim percentOfTotal As Double
For Each row As DataRow In dTable.Rows
'You could also bind the data to the chart, but this way you can manipulate the data
'in a straightforward way and might get some sense of what's happening.
percentOfTotal = row("amount") / total * 100
series.Points.AddXY(row("name"), percentOfTotal)
Next
End Sub
Private Function getDataToDataTable(ByVal sql As String) As DataTable
'This is just to get example data.
'Normally you'd connect to your database and fetch the data from there.
Dim dtable As DataTable = New DataTable
dtable.Columns.Add("name")
dtable.Columns.Add("amount")
Dim row As DataRow
row = dtable.NewRow
row("name") = "Andy"
row("amount") = 25
dtable.Rows.Add(row)
row = dtable.NewRow
row("name") = "Pete"
row("amount") = 10
dtable.Rows.Add(row)
row = dtable.NewRow
row("name") = "Bob"
row("amount") = 15
dtable.Rows.Add(row)
Return dtable
End Function
End Class
Now press play on tape.
Someone please make a sticky FAQ-thread to this forum.