Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

No data is displayed in "Chart"

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");
}

Result

Item settings.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You define DataTable table = new DataTable(); but you don’t change the source of the chart itself…

Try calling chartRate.DataSource = table;

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading