Click here to Skip to main content
15,895,370 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,

i want to dynamically create and add chart to a panel , i am using a telerik html chart.

what i am doing is that i have a gridview with multiple check box, i want that when user select more than one check box then that many no of htmlchart should be created and displayed in panel.
what iam doing is:

var htmlchartlist = new List<radhtmlchart>();
C#
foreach (GridDataItem gvrow in RadGrid1.MasterTableView.Items)
           {
               CheckBox chk = (CheckBox)gvrow.FindControl("Chk2");
               {
                   if (chk != null & chk.Checked)
                   {

                       NewMethodForChart(event_name, ref strname, ref struserid, ref multiple_count, gvrow);
                       htmlchartlist.Add(RadHtmlChart1);
                   }
               }
           }

           for (int chartno = 0; chartno < htmlchartlist.Count; chartno++)
           {

               panelChart.Controls.Add(RadHtmlChart1);
           }
       }


but the o/p is not coming what i want, it is not creating multiple different Chart, it is creating one chart only and adding different series in it. i want multiple chart .

can any suggest me any approach ?
Posted
Comments
syed shanu 16-Apr-14 0:58am    
yes it will not create multiple chart .you need to create chart at runtime and add that to panel.now you have one chart as RadHtmlChart1.htmlchartlist.Add(RadHtmlChart1);
and here panelChart.Controls.Add(RadHtmlChart1); you have used the same chart but insted of this you need to create chart dynamically and add to the panel.

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