I am trying to display the column "сoach" from the DB, and display their ranking according to the values in the column "total". As a result I have an empty "Chart"
private void fillshar()
{
conn.Open();
string selectQuerry = "SELECT сoach,total FROM groupfit";
NpgsqlCommand command = new NpgsqlCommand(selectQuerry, conn);
NpgsqlDataAdapter adapter = new NpgsqlDataAdapter(command);
DataTable table = new DataTable();
adapter.Fill(table);
conn.Close();
chartRate.Series["total"].XValueMember = "сoach";
chartRate.Series["total"].YValueMembers = "total";
chartRate.Titles.Add("Rating of the most popular trainers");
}
>Solution :
You define DataTable table = new DataTable(); but you don’t change the source of the chart itself…
Try calling chartRate.DataSource = table;

