Can't bind datatable to Chart Control

后端 未结 3 510
萌比男神i
萌比男神i 2021-01-21 02:24

I\'d like to use a polar chart in my test application. I\'ve a data table with a couple of columns where the column with the name of \"X\" should provide the x value members, th

3条回答
  •  無奈伤痛
    2021-01-21 03:16

    It won't compile because DataTable doesn't implement IEnumerable interface. Try:

    var enumerableTable = (dt as System.ComponentModel.IListSource).GetList();
    chart1.DataBindTable(enumerableTable , "X");
    

提交回复
热议问题