Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends.,

I have been trying to plot datatable values in kendo Scatter Chart, but it is not working. Also it is not working even if I convert DataTable value into array for plotting.

It is plotting values if I use two dimensional array like below.
series.Scatter(new double[][] { new[] { 16.4, 5.4 }, new[] { 21.7, 2 }, new[] { 25.4, 3 }, new[] { 19.0, 2.0 }, new[] { 10.9, 1 }, new[] { 13.6, 3.2 }, new[] { 10.9, 7.4 }, new[] { 10.9, 0 }, new[] { 10.9, 8.2 } })

Anyone does know how to plot DataTable values in Kendo Scatter Chart???
Posted

1 solution

C#
for (int j = 0; j < DataTable.Columns.Count - 1; j++)
{
    object[][] dTemp = new object[DataTable.Rows.Count][];
    for (int i = 0; i < DataTable.Rows.Count; i++)
    dTemp.SetValue(new[] { DataTable.Rows[i][0], DataTable.Rows[i][j + 1] }, i);
    series.Scatter(dTemp).Name(DataTable.Columns[j + 1].ColumnName.ToString());
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900